/** * 登录 * @param unknown $param */ public function Login($param) { import('SC.User.Login'); //导入相应的类库 $userLogin = new Login($param); $result = $userLogin->run(); echo $result; }
header("Location:/signup/?error=401"); exit; } } //If the passwords don't match... if ($_POST["pword"] != $_POST["rpword"]) { //Throw an error header("Location:/signup/?error=105"); exit; } //If everything is going as planned, used the API to create a new user $new_user = new User(array("action" => "create", "fields" => array("fname" => $_POST["fname"], "lname" => $_POST["lname"], "email" => $_POST["eaddr"], "password" => $_POST["pword"]))); //Get the response from the server $response = $new_user->run(true); //If the signup STILL wasn't successful... if ($response != 200) { //Throw a custom error header("Location:/signup/?error=" . $response); } else { //...log them in with their new credentials $login = new Login(array("action" => "login", "email" => $_POST["eaddr"], "password" => $_POST["pword"])); $login->run(); //Navigate to the email validator header("Location:/signup/email_sent.php"); exit; //Exit } /* * * * * * * * * * * * * * * * * * Available for debugging: * * echo $response; * * * * * * * * * * * * * * * * * */
<?php include_once $_SERVER["DOC_ROOT"] . "/scripts/php/core.php"; if (isset($_SESSION["userid"]) && isset($_POST["confirm"]) && $_POST["confirm"] == "del") { $item_call = new Item(array("action" => "get", "filter" => array("usr" => $_SESSION["userid"]))); $user_items = $item_call->run(true); $continue = true; foreach ($user_items as $item) { if ($item["status"] != 1) { $continue = false; } } if ($continue) { $this_user = new User(); $result = $this_user->delete(); if ($result == 200) { $logout = new Login(array("action" => "logout")); $logout->run(); header("Location:/"); exit; } } else { header("Location:/"); exit; } }
include_once $_SERVER["DOC_ROOT"] . "/api/api_lib/call.php"; $lib = strtolower(trim($_GET["lib"])); $library; $return; switch ($lib) { case "item": $library = new Item($_GET); $return = $library->run(); break; case "user": $library = new User($_GET); $return = $library->run(false); break; case "login": $library = new Login($_GET); $return = $library->run(); break; case "listener": $library = new Listener($_GET); $return = $library->listen(); break; case "messenger": $library = new Messenger($_GET); $return = $library->run(); break; case "exchange": $library = new Exchange($_GET); $return = $library->run(); break; case "feed": $library = new Feed($_GET);