Exemple #1
0
         $values = explode("=", $step_1);
         // get the first value
         if ($values[0] == "u") {
             // Do checks here.
             $facepunch = new facepunch();
             // Set the userid
             $facepunch->setUserID($values[1]);
             // Check to see if they have their messages disbabled.
             if ($facepunch->messagesDisabled()) {
                 $response["error"] = "visitor messages are disabled";
             } else {
                 // if the user valid?
                 if (!$facepunch->isUserValid()) {
                     $response["error"] = "user is invalid";
                 } else {
                     if ($facepunch->isGold() || $facepunch->isDeveloper() || $facepunch->isMod()) {
                         $response["username"] = $facepunch->getUsername();
                         $response["avatar"] = $facepunch->getAvatar();
                         $response["userid"] = $facepunch->currentUserID();
                         $response["membership"] = $facepunch->getUserInformation()["membership"];
                         // Assuming the player is valid, we will now give him a key.
                         $response["authenticationkey"] = $db->addAuthenticationKey($facepunch->currentUserID());
                     } else {
                         $response["error"] = "not gold";
                     }
                 }
             }
         }
     }
 }
 die(json_encode($response));