当前位置: 首页>>代码示例>>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;未经允许,请勿转载。