Exemplo n.º 1
0
     $wt->getPostByIdentifier($identifier, $school);
     break;
 case "getSchools":
     require_once "../framework2/Walkntrade.php";
     $wt = new Walkntrade();
     header("Content-Type:text/xml");
     $query = htmlspecialchars($_POST["query"]);
     $wt->getSchools($query);
     break;
 case "controlPanel":
     require_once "../framework2/UserMgmt.php";
     $um = new UserMgmt();
     if (isset($_POST["oldPw"]) && $um->checkPassword($_POST["oldPw"])) {
         if (isset($_POST["email"]) && $_POST["email"] != "") {
             $email = filter_var($_POST["email"], FILTER_SANITIZE_EMAIL);
             switch ($um->modifyAccount($_POST["oldPw"], $email, "", "")) {
                 case 1:
                     return $um->statusDump(999, "This email addres is already used", null);
                     break;
                 case 2:
                     return $um->statusDump(500, "An error has occured (1)", null);
                     break;
             }
         }
         if (isset($_POST["phone"]) && $_POST["phone"] != "") {
             $phone = filter_var($_POST["phone"], FILTER_SANITIZE_NUMBER_INT);
             $um->modifyAccount($_POST["oldPw"], "", "", $phone);
         }
         if (isset($_POST["newPw"]) && $_POST["newPw"] != "") {
             $newPw = filter_var($_POST["newPw"], FILTER_SANITIZE_STRING);
             switch ($um->modifyAccount($_POST["oldPw"], "", $newPw, "")) {