當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBAccess::verifyUser方法代碼示例

本文整理匯總了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) {
開發者ID:astrix37,項目名稱:seqas,代碼行數:31,代碼來源:changePassword.php

示例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) {
開發者ID:astrix37,項目名稱:seqas,代碼行數:31,代碼來源:login.php


注:本文中的DBAccess::verifyUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。