本文整理汇总了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;
}
示例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;
}
示例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);