本文整理汇总了PHP中Authentication::checkIdentity方法的典型用法代码示例。如果您正苦于以下问题:PHP Authentication::checkIdentity方法的具体用法?PHP Authentication::checkIdentity怎么用?PHP Authentication::checkIdentity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Authentication
的用法示例。
在下文中一共展示了Authentication::checkIdentity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public static function add($fname, $lname, $identity, $pass, $roleid){
$okay = Authentication::checkIdentity($identity);
if( $okay === 0 ){
$user = new User(null, $fname, $lname, null);
$res = $user->save();
if( $res ){
$auth = Authentication::addForUser($res->userid, $identity, $pass, $roleid);
$cont = Contact::addForUserID($res->userid, $identity);
if( $auth && $cont ){
return $res;
}
else{
if( User::deleteByID($res->userid) ){
return false;
}
else{
//you are just totally screwed
}
}
}
}
else{
return false;
}
}
示例2: add
public static function add($fname, $lname, $ident, $pass, $roleid)
{
$okay = Authentication::checkIdentity($ident);
if( $okay === 0 )
{
$user = new User(null, $fname, $lname);
$res = $user->save();
if( $res )
{
$auth = Authentication::addForUser($res->userid, $ident, $pass, $roleid);
if( $auth )
{
return $res;
}
else
{
$status = User::delete($res->userid);
if( $status )
{
return false;
}
else
{
//you are just totally screwed
}
}
}
}
else
{
return false;
}
}
示例3: isset
require_once('Authentication.php');
require_once('User.php');
require_once('Session.php');
require_once('Quick_Login.php');
require_once('Mail.php');
setSession(0, '/');
$password = isset($_POST['password']) ? $_POST['password'] : null;
$vp = isset($_POST['vpass']) ? $_POST['vpass'] : null;
$data['email'] = isset($_POST['email']) ? $_POST['email'] : null;
$data['vemail'] = isset($_POST['vemail']) ? $_POST['vemail'] : null;
$data['fname'] = isset($_POST['fname']) ? $_POST['fname'] : null;
$data['lname'] = isset($_POST['lname']) ? $_POST['lname'] : null;
if( ($password == $vp) && ($data['email'] == $data['vemail']) && ($password != null) && ($data['email'] != null) ){
if( Authentication::checkIdentity($data['email']) == 0 ){
//create user
$user = User::add($data['fname'],$data['lname'],$data['email'],$password,3);
if( $user ){
$auth = $user->authentication;
$auth->resetPassword = 0;
$auth->disabled = 1;
$auth->save();
//create login hash
$hash = hash('whirlpool', $user->authentication->identity . time() . (time() / 64));
if( !Quick_Login::add($hash, $user->userid, time() + 3600, 0) ){
// die
}
//load email template