catch a few more role/add errors, and show more debug if it (by chance) hits the defualt case

This commit is contained in:
james 2011-03-03 22:17:05 +00:00
parent 3360fe95eb
commit b9d8a9c8c5
2 changed files with 5 additions and 3 deletions

View File

@ -215,7 +215,7 @@ function account_add_role($accounts_id, $roles_id, $conferences_id, $password =
return "invalidaccount"; return "invalidaccount";
} }
if(mysql_result(mysql_query("SELECT COUNT(*) FROM roles WHERE id = $roles_id"), 0) != 1){ 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){ if(mysql_result(mysql_query("SELECT COUNT(*) FROM conferences WHERE id = $conferences_id"), 0) != 1){
return "invalidconference"; return "invalidconference";
@ -303,7 +303,7 @@ function account_add_role($accounts_id, $roles_id, $conferences_id, $password =
$error = ''; $error = '';
} }
else { else {
$error = 'invalidrole(invite only)'; $error = 'invalidrole(invite_only)';
} }
break; break;
} }

View File

@ -792,10 +792,12 @@ switch($request[0]) {
updateSessionRoles(); updateSessionRoles();
break; break;
case "invalidrole": $ret['status']="error"; $ret['error']="Invalid role"; 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 "invalidaccount": $ret['status']="error"; $ret['error']="Invalid account"; break;
case "invalidconference": $ret['status']="error"; $ret['error']="Invalid conference"; break; case "invalidconference": $ret['status']="error"; $ret['error']="Invalid conference"; break;
case "invalidpassword": $ret['status']="error"; $ret['error']="Invalid password for role"; 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; break;