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


PHP Authenticate::AuthUser方法代碼示例

本文整理匯總了PHP中Authenticate::AuthUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP Authenticate::AuthUser方法的具體用法?PHP Authenticate::AuthUser怎麽用?PHP Authenticate::AuthUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Authenticate的用法示例。


在下文中一共展示了Authenticate::AuthUser方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: CreateNav

 function CreateNav($token, $skin)
 {
     global $defined;
     $auth = new Authenticate();
     $level = new AccessLevels();
     if (empty($token)) {
         $data->menu = 'menu.default.tpl';
     } else {
         if ($auth->AuthUser(NULL, NULL, $token) === -1 || $auth->AuthUser(NULL, NULL, $token) === -2) {
             //    $data->menu = $msg;
             $data->menu = 'menu.default.tpl';
         } else {
             if ($level->ChkLevel($token) === "admin") {
                 $data->menu = 'menu.admin.tpl';
             } elseif ($level->ChkLevel($token) === "user") {
                 $data->menu = 'menu.user.tpl';
             } elseif ($level->ChkLevel($token) === "view") {
                 $data->menu = 'menu.view.tpl';
             } else {
                 $data->menu = 'menu.default.tpl';
             }
         }
     }
     return $data->menu;
 }
開發者ID:brahimmachkouri,項目名稱:phpDHCPAdmin,代碼行數:25,代碼來源:class.menu.php

示例2: elseif

 if ($val->ValidateString($_GET['skin']) === -1 || empty($_GET['skin'])) {
     $style = $defined['templates'] . "/black";
     if (!empty($_GET['skin'])) {
         $skin_err = $err->GenerateErrorLink("help/help.php", "#val_xss", $defined['error_small'], $errors['val_xss'], NULL, NULL);
     }
 } else {
     $style = $skin->SelectSkin($defined['templates'], $_GET['skin'], $_COOKIE['skin']);
 }
 // call our header file and pass it some variables
 $tpl->assign('TITLE', $defined['title'], NULL, NULL);
 $tpl->assign('DESCRIPTION', "Manage Pools", NULL, NULL);
 $tpl->assign('STYLE', $style, NULL, NULL);
 // authentication template
 $FILE = "auth.tpl";
 // default is no error just diplay login form
 if ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -1) {
     // well looks like at least one login attempt has been processed, show empty field error
     if ($_SESSION['x']++ >= 1) {
         $ERROR = $err->GenerateErrorLink("help/help.html", "#missing", $defined['error'], $errors['auth_e'], NULL, NULL);
     }
     // timeout with authentication token
 } elseif ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -2) {
     $ERROR = $err->GenerateErrorLink("help/help.html", "#timeout", $defined['error'], $errors['auth_to'], NULL, NULL);
     $misc->ExitApplication($_SESSION['token']);
     // error in validation of authentication data
 } elseif ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -3) {
     $ERROR = $err->GenerateErrorLink("help/help.html", "#alphanum", $defined['error'], $errors['val_alp'], NULL, NULL);
     // authentication data not found in database
 } elseif ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -4) {
     $ERROR = $err->GenerateErrorLink("help/help.html", "#user", $defined['error'], $errors['auth_n'], NULL, NULL);
     // error in database query
開發者ID:brahimmachkouri,項目名稱:phpDHCPAdmin,代碼行數:31,代碼來源:manage.pools.php


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