当前位置: 首页>>代码示例>>PHP>>正文


PHP Authentication::Authenticate方法代码示例

本文整理汇总了PHP中Authentication::Authenticate方法的典型用法代码示例。如果您正苦于以下问题:PHP Authentication::Authenticate方法的具体用法?PHP Authentication::Authenticate怎么用?PHP Authentication::Authenticate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Authentication的用法示例。


在下文中一共展示了Authentication::Authenticate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

 public function login($post)
 {
     $email = strip_tags(htmlspecialchars($post['email_input_data']));
     $email = filter_var($email, FILTER_SANITIZE_EMAIL);
     $email = filter_var($email, FILTER_VALIDATE_EMAIL);
     $password = strip_tags(htmlspecialchars($post['password_input_data']));
     $password = filter_var($password, FILTER_SANITIZE_STRING);
     if (!$email) {
         $this->app->redirect($this->app->urlFor('admin-login') . '?attempt=1');
     }
     if (Authentication::Authenticate($email, $password, 1000)) {
         $session = Utilities::getSession();
         $action = '/admin/' . $session['username'];
         $this->app->redirect($action);
     } else {
         $this->app->redirect($this->app->urlFor('admin-login') . '?attempt=2');
     }
 }
开发者ID:CodeSomethingMX,项目名称:barney,代码行数:18,代码来源:EscolaresController.class.php

示例2: login

 public function login(array $post)
 {
     //var_dump($post);
     $email = strip_tags(htmlspecialchars($post['email_input_data']));
     $email = filter_var($post['email_input_data'], FILTER_SANITIZE_EMAIL);
     $email = filter_var($email, FILTER_VALIDATE_EMAIL);
     $password = strip_tags(htmlspecialchars($post['password_input_data']));
     $password = filter_var($password, FILTER_SANITIZE_STRING);
     if (!$email) {
         $this->app->redirect($this->app->urlFor('login') . '?attempt=1');
     }
     if (Authentication::Authenticate($email, $password, 10)) {
         $session = Utilities::getSession();
         //var_dump($_SESSION['proceso']);
         if (isset($_SESSION['proceso'])) {
             $action = '/suscribirme/' . $_SESSION['proceso']['curso'];
             $this->app->redirect($action);
         }
         $this->app->redirect('/' . $session['username']);
     } else {
         $this->app->redirect($this->app->urlFor('login') . '?attempt=2');
     }
 }
开发者ID:CodeSomethingMX,项目名称:barney,代码行数:23,代码来源:AlumnoController.class.php

示例3: ini_set

<?php

include 'cd.php';
ini_set('max_execution_time', '3600');
$CurrentUser = Authentication::Authenticate();
if (!$CurrentUser->hasPermission(RIGHT_VIDEO_ADD) && !$CurrentUser->hasPermission(RIGHT_VIDEO_EDIT)) {
    $e = new Error(RIGHTS_ERR_USERNOTALLOWED);
    Error::AddError($e);
    HTMLstuff::RefererRedirect();
}
$ModelID = Utils::SafeIntFromQS('model_id');
$SetID = Utils::SafeIntFromQS('set_id');
$Models = Model::GetModels(new ModelSearchParameters(is_null($ModelID) ? FALSE : $ModelID));
$Sets = Set::GetSets(new SetSearchParameters(is_null($SetID) ? FALSE : $SetID));
$Videos = Video::GetVideos(new VideoSearchParameters(FALSE, FALSE, is_null($SetID) ? FALSE : $SetID, FALSE, is_null($ModelID) ? FALSE : $ModelID));
$CacheImages = CacheImage::GetCacheImages();
if ($SetID) {
    $Set = $Sets[0];
    $Models = array($Set->getModel());
}
/* @var $Model Model */
for ($i = 0; $i < count($Models); $i++) {
    $Model = $Models[$i];
    $VideoFolder = sprintf('%1$s/%2$s', CANDYPATH, $Model->GetFullName());
    if (!file_exists($VideoFolder)) {
        continue;
    }
    /* @var $it RecursiveIteratorIterator */
    $it = new RecursiveDirectoryIterator($VideoFolder, FileSystemIterator::SKIP_DOTS | FileSystemIterator::CURRENT_AS_FILEINFO);
    $itArray = array();
    foreach ($it as $file) {
开发者ID:laiello,项目名称:candydolldb,代码行数:31,代码来源:import_video.php

示例4: switch

 }
 if (is_null($password)) {
     $error[] = "Password";
     $e_password = true;
 }
 if (is_null($email)) {
     $error[] = "Email";
     $e_email = true;
 }
 if (count($error) > 0) {
     $loadfile = "login/login_error.tpl";
 } else {
     $auth->setEmail($email);
     $auth->setUsername($username);
     $auth->setPassword($password);
     if ($auth->Authenticate()) {
         $loadfile = "login/login_successful.tpl";
         $redirect = "/#1";
     } else {
         $loadfile = "login/login_{$auth->getError()}.tpl";
         switch ($auth->getError()) {
             case "email":
                 $e_email = true;
                 break;
             case "username":
                 $e_username = true;
                 break;
             case "password":
                 $e_password = true;
                 break;
         }
开发者ID:robertkraig,项目名称:mycms,代码行数:31,代码来源:Login.php


注:本文中的Authentication::Authenticate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。