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


PHP Employee::authenticate方法代码示例

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


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

示例1: employee_login

 public static function employee_login()
 {
     $params = $_POST;
     $employee = Employee::authenticate($params['username'], $params['password']);
     if (!$employee) {
         View::make('login/index.html', array('error' => 'Väärä käyttäjätunnus tai salasana!', 'username' => $params['username']));
     } else {
         $_SESSION['employee'] = $employee->id;
         Redirect::to("/employee/login");
     }
 }
开发者ID:Zonsu,项目名称:Tsoha-Bootstrap,代码行数:11,代码来源:employee_controller.php

示例2: runEmployee

 public function runEmployee($username, $password)
 {
     global $session;
     $userReg = Employee::authenticate($username, $password);
     if ($userReg) {
         $session->Employeelogin($userReg);
         return true;
     } else {
         return false;
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:11,代码来源:login_model.php

示例3: array

<?php

$_SESSION['direct_to'] = BASE_URL . "account/change_password/";
include_once 'sessioninc.php';
$username = $session->get_username();
if (isset($_POST['bt_submit'])) {
    $error = array();
    $old_pass = $_POST['txt_old_pass'];
    $new_pass = $_POST['txt_new_pass'];
    $new_pass_try = $_POST['txt_new_pass_retry'];
    $correct_user = Employee::authenticate($username, $old_pass);
    /* check old password**/
    if (!$correct_user) {
        $error[] = format_lang('errormsg', 44);
    }
    /**new password*/
    if (strlen($new_pass) != strlen($new_pass_try)) {
        $error[] = format_lang('errormsg', 45);
    }
    if (strlen($new_pass) < 6 || strlen($new_pass) > 20) {
        $error[] = format_lang('errormsg', 46);
    }
    if (sizeof($error) == 0) {
        //if everything ok
        $pass_change = Employee::change_password($username, $new_pass);
        if ($pass_change) {
            $session->message("<div class='success'>" . format_lang('success', 'pass_chg_success') . "</div>");
        } else {
            $session->message("<div class='error'>" . format_lang('errormsg', 47) . "</div>");
        }
    } else {
开发者ID:nim94sha,项目名称:Online-Job-Portal,代码行数:31,代码来源:change_pass_page.php

示例4: trim

/** login */
if (isset($_POST['bt_login'])) {
    $username = trim($_POST['useranme_txt']);
    $pass = trim($_POST['pass_txt']);
    $smarty->assign('username', $username);
    $errors = array();
    if ($username == "" || $pass == "") {
        $errors[] = format_lang('error', 'empty_user_pass');
    }
    if (ENABLE_SPAM_LOGIN && ENABLE_SPAM_LOGIN == 'Y') {
        if (strtolower($_POST['spam_code']) != strtolower($_SESSION['spam_code']) || (!isset($_SESSION['spam_code']) || $_SESSION['spam_code'] == NULL)) {
            $errors[] = format_lang('error', 'spam_wrong_word');
        }
    }
    if (sizeof($errors) == 0) {
        $user_found = Employee::authenticate($username, $pass);
        if ($user_found) {
            //check employee status
            if ($user_found->employee_status == 'pending') {
                $message = "<div class='error'>" . format_lang('error', 'approve_account') . "</div>";
            } elseif ($user_found->employee_status == 'deleted') {
                $message = "<div class='error'>" . format_lang('error', 'status_deleted_account') . "</div>";
            } elseif ($user_found->employee_status == 'suspended') {
                $message = "<div class='error'>" . format_lang('error', 'status_suspended_account') . "</div>";
            } elseif ($user_found->employee_status == 'declined') {
                $message = "<div class='error'>" . format_lang('error', 'status_declined_account') . "</div>";
            } else {
                $access = "User";
                $session->login($user_found, $access);
                if (isset($_SESSION['direct_to'])) {
                    $page = $_SESSION['direct_to'];
开发者ID:nim94sha,项目名称:Online-Job-Portal,代码行数:31,代码来源:login_page.php


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