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


PHP UserDAO::getUser方法代碼示例

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


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

示例1: executeNew

 public function executeNew(sfWebRequest $request)
 {
     if ($request->getMethod() != "POST") {
         return;
     }
     $this->username = $request->getPostParameter("username");
     if (!$this->username) {
         return $this->setErrorMsg("Username is a required field!");
     }
     $this->user = UserDAO::getUser($this->username);
     if ($this->user) {
         return $this->setErrorMsg("That username is already in use!");
     }
     $this->password1 = $request->getPostParameter("password1");
     $this->password2 = $request->getPostParameter("password2");
     if (!$this->password1 || !$this->password2) {
         return $this->setErrorMsg("Password is a required field");
     }
     if ($this->password1 != $this->password2) {
         return $this->setErrorMsg("Password and password confirm must match!");
     }
     $this->email = $request->getPostParameter("email");
     $this->user = UserDAO::createUser($this->username, $this->password1, $this->email);
     $this->login($this->user);
     $this->redirect("dashboard/index");
 }
開發者ID:rmillsap,項目名稱:missionsolutions,代碼行數:26,代碼來源:actions.class.php

示例2: UserDAO

 function __construct()
 {
     session_start();
     if (isset($_SESSION[AppConstants::SESSION_USER]) === false) {
         $_SESSION[AppConstants::SESSION_USER] = '';
         $_SESSION[AppConstants::SESSION_PASSWORD] = '';
     }
     $user = $_SESSION[AppConstants::SESSION_USER];
     $pass = $_SESSION[AppConstants::SESSION_PASSWORD];
     $userDao = new UserDAO();
     $this->_user_USR = $userDao->getUser($user, $pass);
 }
開發者ID:ithinkisam,項目名稱:wishlist,代碼行數:12,代碼來源:session.class.php

示例3: redirect_to

    if (isset($_GET["status"])) {
        $status = $_GET["status"];
        if ($status == 0) {
            $message = "password changed successfully";
        } else {
            if ($status == 1) {
                $message = "password updation failed";
            } else {
                $message = "password cannot be more than 15char(s).";
            }
        }
    }
    if (!checkSession()) {
        redirect_to("index.php");
    }
    $user = UserDAO::getUser($_SESSION["username"]);
    if (isset($_POST["newPassword"])) {
        if (strlen($newPassword) > 15) {
            redirect_to("admin.php?status=2");
        } else {
            $user->password = $_POST["newPassword"];
            UserDAO::changePassword($user);
            redirect_to("admin.php?status=0");
        }
    }
} catch (Exception $exception) {
    echo $exception->getMessage();
    die;
}
include "partials/header.php";
?>
開發者ID:rvbugs0,項目名稱:FullyFunctionalPersonalWebsite,代碼行數:31,代碼來源:admin.php

示例4: loginUser

 public static function loginUser($email, $password)
 {
     $user = UserDAO::getUser($email);
     if ($user && password_verify($password, $user->getPassword())) {
         return $user;
     } else {
         return false;
     }
 }
開發者ID:rochester-rcl,項目名稱:rcl-video-annotation,代碼行數:9,代碼來源:user.php


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