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


PHP UserDao::get方法代碼示例

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


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

示例1: login

 /**     
  * @param <type> $username
  * @param <type> $password
  * @return boolean
  */
 public function login($username, $password)
 {
     $user = new User(null, $username, $password);
     $user = $this->userDao->get($user);
     if ($user != null) {
         Session::login($user);
         setcookie('Bureau_PosicaoApps', '', time() - 3600);
         //setcookie('Bureau_PosicaoApps', "publicacoes|noticias|videoteca", time() + 3600);
         setcookie('Bureau_PosicaoApps', $user->getPositions(), time() + 3600);
         setcookie('Bureau_AppsMinimizados', "0", Config::get('tempo_vida_cookie'));
         setcookie('logged', '1', time() + 10);
         return true;
     }
     return false;
 }
開發者ID:raigons,項目名稱:bureauinteligencia,代碼行數:20,代碼來源:LoginController.php

示例2: authenticate

 /**
  * Authenticates the given username and password against the database,
  * Logs the user in and returns a user object on success, otherwise returns false
  * @param <type> $username
  * @param <type> $password
  * @return <type>
  */
 public function authenticate($username, $password)
 {
     // Find the user in the db
     $dao = UserDao::get();
     $user = $dao->findByUsername($username);
     // Perform validation
     if ($user == NULL || self::getHash($password, $user->Password) !== $user->Password) {
         return false;
     } else {
         // update information, such as login count and last login
         $dao->updateLoginInfo($user->UserId);
         $this->_user = $user;
         // complete the login
         $this->_login();
         return $user;
     }
 }
開發者ID:BGCX067,項目名稱:ez-library-svn-to-git,代碼行數:24,代碼來源:auth.class.php

示例3: header

if (!isset($_SESSION)) {
    session_start();
}
if (isset($_SESSION['connected'])) {
    header("Location: index.php");
    exit;
}
$courrier = "Courriel";
$message = "";
if (isset($_REQUEST['courriel'])) {
    $courriel = $_REQUEST['courriel'];
    $motDePasse = $_REQUEST['motDePasse'];
    require_once '/code/classes/UserDao.php';
    require_once '/code/classes/User.php';
    $dao = new UserDao();
    $u = $dao->get($courriel);
    if ($u == NULL) {
        $message = $courriel . ' introuvable';
    } else {
        if ($u->getMotDePasse() != $_REQUEST['motDePasse']) {
            $message = "Mot de passe &eacute;rron&eacute;";
        } else {
            $_SESSION['connected'] = $u->getNom();
            header("Location: admin.php");
            exit;
        }
    }
}
?>
<!DOCTYPE html>
<html lang="en"><head>
開發者ID:sisowath,項目名稱:TP_PHP,代碼行數:31,代碼來源:login2.php


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