Esempio n. 1
0
     break;
 case "get_badges":
     $value = $api->get_badges();
     exit(json_encode($value));
     break;
 case "register":
     if (isset($_REQUEST["audience_email"]) && isset($_REQUEST["audience_email_confirm"]) && isset($_REQUEST["password"]) && isset($_REQUEST["password_confirm"]) && isset($_REQUEST["project_id"])) {
         $value = $api->register($_REQUEST["audience_email"], $_REQUEST["audience_email_confirm"], $_REQUEST["password"], $_REQUEST["password_confirm"], $_REQUEST["project_id"]);
         exit(json_encode($value));
     } else {
         $value = "Missing argument";
     }
     break;
 case "login":
     if (isset($_REQUEST["audience_email"]) && isset($_REQUEST["password"]) && isset($_REQUEST["project_id"])) {
         $value = $api->login(strtolower($_REQUEST["audience_email"]), $_REQUEST["password"], $_REQUEST["project_id"]);
         exit(json_encode($value));
     } else {
         $value = "Missing argument";
     }
     break;
 case "reset":
     if (isset($_REQUEST["audience_email"]) && isset($_REQUEST["project_id"])) {
         $value = $api->reset($_REQUEST["audience_email"], $_REQUEST["project_id"]);
         exit(json_encode($value));
     } else {
         $value = "Missing argument";
     }
     break;
 case "count_messages":
     if (isset($_REQUEST["type"])) {