本文整理汇总了PHP中DBAccess::verifyUser方法的典型用法代码示例。如果您正苦于以下问题:PHP DBAccess::verifyUser方法的具体用法?PHP DBAccess::verifyUser怎么用?PHP DBAccess::verifyUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBAccess
的用法示例。
在下文中一共展示了DBAccess::verifyUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$current = "";
$new = "";
$confirm = "";
$error = false;
$userID = $_SESSION['userID'];
/*
* Checking by the page itself to make submitted values are valid
*/
if ($_POST['Submitted'] != null) {
$current = $_POST['current'];
$new = $_POST['new'];
$confirm = $_POST['confirm'];
$IP = $_SERVER['REMOTE_ADDR'];
$browser = $_SERVER['HTTP_USER_AGENT'];
$details = DBAccess::getUserByUserID($userID);
$response = DBAccess::verifyUser($details[0]['LoginName'], $current, $IP, $browser);
if (strlen($current) == 0) {
$errorTextCurrent = "Please enter your current password";
$errorStyleCurrent = "background-color:#F99;";
$error = true;
} elseif ($response <= 0) {
$error = true;
$errorTextCurrent = "Invalid Password";
$errorStyleCurrent = "background-color:#F99;";
}
if (strlen($new) == 0) {
$errorTextNew = "Please enter a new password";
$errorStyleNew = "background-color:#F99;";
$error = true;
} else {
if ($new != $confirm) {
示例2: header
if (strlen($userName) == 0) {
$errorTextUserName = "Enter a username";
$errorStyleUserName = "background-color:#F99;";
$error = true;
}
if (strlen($password) == 0) {
$errorTextPassword = "Enter a password";
$errorStylePassword = "background-color:#F99;";
$error = true;
}
/*
* Verify Details
*/
$IP = $_SERVER['REMOTE_ADDR'];
$browser = $_SERVER['HTTP_USER_AGENT'];
$response = DBAccess::verifyUser($userName, $password, $IP, $browser);
if ($response == -1) {
$feedBack = "YOUR ACCOUNT HAS BEEN DISABLED";
} else {
if ($response > 0) {
$details = DBAccess::getUserByUserID($response);
// store session data
$_SESSION['userID'] = $response;
$IP = $_SERVER['REMOTE_ADDR'];
$browser = $_SERVER['HTTP_USER_AGENT'];
//record login
DBAccess::recordLogin($response, $IP, $browser);
//redirect based on permission
if ($details[0]['Position'] == 1) {
header('Location: /admin/');
} elseif ($details[0]['Position'] == 2) {