コード例 #1
0
ファイル: index.php プロジェクト: TPhillip/walkntrade
     }
     break;
 case "getUserProfile":
     //left off here
     require_once "../framework2/UserMgmt.php";
     $um = new UserMgmt();
     $uid = isset($_POST["uid"]) ? filter_var($_POST["uid"], FILTER_SANITIZE_NUMBER_INT) : null;
     $userName = isset($_POST["userName"]) ? filter_var($_POST["userName"], FILTER_SANITIZE_STRING) : null;
     header("Content-Type:text/xml");
     $um->getUserProfile($uid, $userName);
     break;
 case "setEmailPref":
     require_once "../framework/UserMgmt.php";
     $um = new UserMgmt();
     $pref = isset($_POST["pref"]) ? htmlspecialchars($_POST["pref"], FILTER_SANITIZE_NUMBER_INT) : null;
     echo $um->setEmailPref($pref);
     break;
 case "getEmailPref":
     require_once "../framework/UserMgmt.php";
     $um = new UserMgmt();
     echo $um->getEmailPref();
     break;
 case "login":
     require_once "../framework/UserMgmt.php";
     $um = new UserMgmt();
     if (isset($_POST["email"], $_POST["password"])) {
         $email = filter_var($_POST["email"], FILTER_SANITIZE_EMAIL);
         $password = filter_var($_POST["password"], FILTER_SANITIZE_STRING);
         $rememberMe = isset($_POST["rememberMe"]) && $_POST["rememberMe"] == "true" ? true : false;
         $r = $um->login($email, $password, $rememberMe);
         switch ($r) {