本文整理汇总了PHP中UserDao::getRow方法的典型用法代码示例。如果您正苦于以下问题:PHP UserDao::getRow方法的具体用法?PHP UserDao::getRow怎么用?PHP UserDao::getRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserDao
的用法示例。
在下文中一共展示了UserDao::getRow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
public function login($username, $password)
{
//valider login
//valider password
//pour éviter sql injection
//$userdao = new UserDao(new User());
//$userdao->test();
// $dao = new DAO(array('username' =>$username, 'password' =>$password), $this->table );
//$user = $dao->select();
$userDao = new UserDao(new User());
//$where = array('email'=>"$email");
$user = $userDao->getRow(array('username' => $username, 'password' => $password));
if (isset($user)) {
require_once WEBAPPROOT . 'security/UserSession.php';
$session = new UserSession();
$session->start();
$session->set($user);
//var_dump($session->get());
return $user;
}
}
示例2: index
function index()
{
$success = array('success' => '1');
if (isset($_POST['email'])) {
$email = trim($_POST['email']);
$userDao = new UserDao(new User());
$where = array("email" => $email);
$user = $userDao->getRow($where);
if ($user) {
$id = $user->getId();
$user->setIs_admin(1);
$userDao = new UserDao($user);
$userDao->update($id);
} else {
$success = array('success' => '0');
}
}
$userDao = new UserDao(new User());
$where = array("is_admin" => '1');
$list = $userDao->getAllDataActive($where);
$this->set(array("membres" => $list, "success" => $success));
$this->render("administrateur");
}
示例3: userExist
function userExist($where)
{
$userDao = new UserDao(new User());
//$where = array('email'=>"$email");
return $userDao->getRow($where);
}