Exemple #1
0
             $response->message = $result;
         }
     } else {
         $response->status = BAD;
         $response->message = "Please enter a username and a password.";
     }
 } else {
     if ($action == "login2") {
         if (isset($_GET['username']) && isset($_GET['password']) && $_GET['username'] != "" && $_GET['password'] != "") {
             $snapchat = new Snapchat($_GET['username'], $_GET['password']);
             $result = $snapchat->login($_GET['username'], $_GET['password']);
             if ($snapchat->username == FALSE || $snapchat->auth_token == FALSE) {
                 $response->status = BAD;
                 $response->message = $result;
             } else {
                 $result = $snapchat->getUpdates2();
                 formatSnaps($result, $snapchat);
                 $response->status = OKAY;
                 $response->message = $result;
             }
         } else {
             $response->status = BAD;
             $response->message = "Please enter a username and a password.";
         }
     } else {
         if ($action == "register") {
             if (isset($_GET['username']) && isset($_GET['password']) && isset($_GET['email']) && isset($_GET['birthday']) && $_GET['username'] != "" && $_GET['password'] != "" && $_GET['email'] != "" && $_GET['birthday'] != "") {
                 $snapchat = new Snapchat();
                 $result = $snapchat->register($_GET['username'], $_GET['password'], $_GET['email'], $_GET['birthday']);
                 if ($snapchat->auth_token != "") {
                     $response->status = OKAY;