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