X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=authserver%2Fauthd%2Fauthd.php;h=fb6d895b14b467e6bd4cc15801d51d9e155096fe;hp=616eab717631788ab55e494978c27a992b98fc25;hb=d1eae3d523f459b4cdd5e1bfc776690d0ad96069;hpb=ae879118f79612ed5ded5c52fa695f7074b4c461 diff --git a/authserver/authd/authd.php b/authserver/authd/authd.php index 616eab7..fb6d895 100644 --- a/authserver/authd/authd.php +++ b/authserver/authd/authd.php @@ -40,29 +40,30 @@ if($pid == -1) { while(true) { msg_receive($sr_queue, 0, $msg_type, 16384, $msg); - echo "Got message $msg_type\n"; print_r($msg); switch($msg_type) { case MSG_AUTH_USER: - echo "got auth message, $msg\n"; + // minimal checking, we leav it up to authenticateUser to do the real + // checking + if(!isset($msg["user"])) $msg["user"] = ""; + if(!isset($msg["passcode"])) $msg["passcode"] = ""; $username = $msg["user"]; $passcode = $msg["passcode"]; global $myga; msg_send($cl_queue, MSG_AUTH_USER, $myga->authenticateUser($username, $passcode)); break; case MSG_ADD_USER: - echo "add user\n"; - $username = $msg["username"]; - global $myga; - msg_send($cl_queue, MSG_ADD_USER, $myga->setUser($username)); + if(!isset($msg["username"])) { + msg_send($cl_queue, MSG_ADD_USER, false); + } else { + $username = $msg["username"]; + global $myga; + msg_send($cl_queue, MSG_ADD_USER, $myga->setUser($username)); + } break; case MSG_DELETE_USER: break; - default: - echo "um??\n"; - } - echo "Back to wait\n"; } }