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


PHP Authentication::checkIdentity方法代码示例

本文整理汇总了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;
			}
		}
开发者ID:rockerest,项目名称:Afterthought,代码行数:28,代码来源:User.php

示例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;
			}
		}
开发者ID:rockerest,项目名称:capstone,代码行数:36,代码来源:User.php

示例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
开发者ID:rockerest,项目名称:Afterthought,代码行数:31,代码来源:create.php


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