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


PHP UserDAO::getByUsername方法代码示例

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


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

示例1: getAll

 public function getAll()
 {
     $sql = "SELECT viewerID, username, viewer FROM viewers";
     $dbh = new PDO(DBConfig::$DB_CONNSTRING, DBConfig::$DB_USERNAME, DBConfig::$DB_PASSWORD);
     $resultSet = $dbh->query($sql);
     $lijst = array();
     foreach ($resultSet as $rij) {
         $userDAO = new UserDAO();
         $user = $userDAO->getByUsername($rij["username"]);
         //            var_dump($user);
         $viewer = $userDAO->getByUsername($rij["viewer"]);
         //            var_dump($viewer);
         $viewerLijst = Viewer::create($rij["viewerID"], $user, $viewer);
         array_push($lijst, $viewerLijst);
     }
     $dbh = null;
     return $lijst;
 }
开发者ID:liesenborghspuntkristof,项目名称:php_oefeningen,代码行数:18,代码来源:ViewerDAO.php

示例2: checkLogin

 public function checkLogin($username, $password)
 {
     $check = "access denied";
     if (check_valid_input($username, 6) && check_valid_input($password, 6)) {
         $userDAO = new UserDAO();
         $user = $userDAO->getByUsername($username);
         //            var_dump($user);
         if ($user->getUsername() == NULL) {
             throw new FalseLoginException("Username does not exist");
         }
         if ($username === $user->getUsername() && passwordEncrypt($username, $password) === $user->getPassword()) {
             $check = "access granted";
         } else {
             throw new FalseLoginException("Password doesn't match Username");
         }
     } else {
         throw new InvalidInputException("false Input = input needs to be minimum 6 long, only numbers, letters, capital letters and # @ . - or _");
     }
     return $check;
 }
开发者ID:liesenborghspuntkristof,项目名称:php_oefeningen,代码行数:20,代码来源:UserService.php

示例3: gethostbyaddr

}
print "<pre>";
print_r($viewerLijst);
print "</pre>";
?>

        <?php 
$string = "foxbarrelinc";
$ascii = string_to_ascii($string);
echo $string . "</br>";
var_dump($ascii);
var_dump(string_to_ascii("!liesenborghs"));
$check = check_valid_input($string, 6);
var_dump($check);
var_dump(check_valid_input($string, 6));
$fox = $userDAO->getByUsername("foxbarrelinc");
var_dump($fox);
//        $userSvc = new UserService();
//        $service = $userSvc->checkLogin("foxbarrelinc", "adminpwd");
//        var_dump($service);
$par1 = $_SERVER['REMOTE_ADDR'];
var_dump($par1);
$par2 = gethostbyaddr($par1);
var_dump($par2);
var_dump(redirect_arrayName());
var_dump(redirect_par());
$_SESSION[redirect_arrayName()] = redirect_par();
var_dump($_SESSION[redirect_arrayName()]);
var_dump($_SERVER['HTTP_USER_AGENT']);
$hashValue = passwordEncrypt("fifafo", "schildp@d");
var_dump($hashValue);
开发者ID:liesenborghspuntkristof,项目名称:php_oefeningen,代码行数:31,代码来源:test.php


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