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