forked from science-ation/science-ation
catch a few more role/add errors, and show more debug if it (by chance) hits the defualt case
This commit is contained in:
parent
3360fe95eb
commit
b9d8a9c8c5
@ -215,7 +215,7 @@ function account_add_role($accounts_id, $roles_id, $conferences_id, $password =
|
||||
return "invalidaccount";
|
||||
}
|
||||
if(mysql_result(mysql_query("SELECT COUNT(*) FROM roles WHERE id = $roles_id"), 0) != 1){
|
||||
return "invalidrole($roles_id)";
|
||||
return "invalidrole";
|
||||
}
|
||||
if(mysql_result(mysql_query("SELECT COUNT(*) FROM conferences WHERE id = $conferences_id"), 0) != 1){
|
||||
return "invalidconference";
|
||||
@ -303,7 +303,7 @@ function account_add_role($accounts_id, $roles_id, $conferences_id, $password =
|
||||
$error = '';
|
||||
}
|
||||
else {
|
||||
$error = 'invalidrole(invite only)';
|
||||
$error = 'invalidrole(invite_only)';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
4
api.php
4
api.php
@ -792,10 +792,12 @@ switch($request[0]) {
|
||||
updateSessionRoles();
|
||||
break;
|
||||
case "invalidrole": $ret['status']="error"; $ret['error']="Invalid role"; break;
|
||||
case "invalidrole(invite only)": $ret['status']="error"; $ret['error']="Invalid role - registation by invite only"; break;
|
||||
case "invalidrole(account_add_role_allowed)": $ret['status']="error"; $ret['error']="Invalid role - account_add_role_allowed said no"; break;
|
||||
case "invalidaccount": $ret['status']="error"; $ret['error']="Invalid account"; break;
|
||||
case "invalidconference": $ret['status']="error"; $ret['error']="Invalid conference"; break;
|
||||
case "invalidpassword": $ret['status']="error"; $ret['error']="Invalid password for role"; break;
|
||||
default: $ret['status']="error"; $ret['error']="unknown role add error";
|
||||
default: $ret['status']="error"; $ret['error']="unknown role add error. addstatus=[$addstatus]";
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user