本文整理匯總了PHP中UserHelper::getUserRow方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserHelper::getUserRow方法的具體用法?PHP UserHelper::getUserRow怎麽用?PHP UserHelper::getUserRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserHelper
的用法示例。
在下文中一共展示了UserHelper::getUserRow方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$success = true;
require_once "classes/validationhelper.class.php";
$required = array();
$required[] = array("key" => "email", "msg" => "Please enter: email");
$required[] = array("key" => "password", "msg" => "Please enter: Password");
foreach ($required as $value) {
if (!ValidationHelper::required($value["key"], $_POST)) {
$message = "<span class=\"feedbackNegative\">" . $value["msg"] . "</span>";
$focusId = $value["key"];
$success = false;
break;
}
}
// connect to db
if ($success) {
$row = UserHelper::getUserRow($db, $_POST["email"], md5($_POST["password"]));
if ($row === false) {
$success = false;
$message = "<span class=\"feedbackNegative\">Invalid login details</span>";
} else {
// restart the session, so there can never be an overlap on one machine.
// all operations are checked atomically
session_unset();
session_destroy();
session_start();
// $sessionid = session_id();
SessionHelper::setSession($row);
CookieHelper::setLoginUser($_POST["email"]);
CookieHelper::setLoginPass(md5($_POST["password"]));
}
}