本文整理汇总了PHP中Model_User::userExists方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_User::userExists方法的具体用法?PHP Model_User::userExists怎么用?PHP Model_User::userExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_User
的用法示例。
在下文中一共展示了Model_User::userExists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
public static function login($username, $password)
{
Database::setup();
if (!Model_User::userExists($username, $password)) {
throw new NonExistingUserException("User with the given credentials does not exists");
} else {
$user = Model_User::findBy(array("username" => $username, "password" => $password));
$_SESSION['user'] = $user;
}
}
示例2: extract
<?php
/*
*Test link
*http://localhost/~matteo/web-lmul-rangers/api-user-exists.php?username=33windowlicker&password=12345678
*/
require_once './global.php';
extract(GenericHelper::gatherGetData());
if (Model_User::userExists($username, $password)) {
http_response_code(200);
} else {
http_response_code(400);
}
示例3: isValid
/**
* Defined by Zend_Validate_Interface
*
* Returns true if and only if $value doesn't exist already as user name
*
* @param string $value
* @return boolean
*/
public function isValid($value)
{
$value = (string) $value;
$this->_setValue($value);
$mdlUser = new Model_User();
if (!$mdlUser->userExists($value, $this->getExclude())) {
return true;
}
$this->_error(self::EXISTS);
return false;
}
示例4: extract
<?php
require_once './global.php';
require_once './helpers/unsecure.php';
extract(GenericHelper::gatherPostData());
if (isset($username) && isset($password) && Model_User::userExists($username, $password)) {
Model_User::login($username, $password);
$rdr_to = GenericHelper::getRedirectTo();
if (isset($rdr_to)) {
header("Location: {$rdr_to}");
die;
}
header("Location: loginpage.php");
} else {
header("Location: index.php?err=login-unsuccessful#login");
die;
}