CBaseUserIdentity
鍖 | system.web.auth |
---|---|
缁ф壙 | abstract class CBaseUserIdentity » CComponent |
瀹炵幇 | IUserIdentity |
瀛愮被 | CUserIdentity |
婧愯嚜 | 1.0 |
鐗堟湰 | $Id: CBaseUserIdentity.php 3515 2011-12-28 12:29:24Z mdomba $ |
婧愮爜 | framework/web/auth/CBaseUserIdentity.php |
CBaseUserIdentity鏄IUserIdentity鍩虹被鐨勫疄鐜般
CBaseUserIdentity瀹炵幇浜嗛偅浜涢渶瑕佽鎸佷箙鍖栫殑璇嗗埆 淇℃伅鐨勭粨鏋勩傚畠鍚屾椂鎻愪緵琛ㄧず 楠岃瘉閿欒鐨勬柟娉曘
娲剧敓绫诲簲璇ュ疄鐜IUserIdentity::authenticate 鍜IUserIdentity::getId锛屽洜涓鸿繖涓や釜鏄IUserIdentity 鎺ュ彛鎵瀹氫箟鐨勩
CBaseUserIdentity瀹炵幇浜嗛偅浜涢渶瑕佽鎸佷箙鍖栫殑璇嗗埆 淇℃伅鐨勭粨鏋勩傚畠鍚屾椂鎻愪緵琛ㄧず 楠岃瘉閿欒鐨勬柟娉曘
娲剧敓绫诲簲璇ュ疄鐜IUserIdentity::authenticate 鍜IUserIdentity::getId锛屽洜涓鸿繖涓や釜鏄IUserIdentity 鎺ュ彛鎵瀹氫箟鐨勩
鍏叡灞炴
灞炴 | 绫诲瀷 | 鎻忚堪 | 瀹氫箟鍦 |
---|---|---|---|
errorCode | integer | 楠岃瘉閿欒浠g爜銆傚鏋滄槸鏈夐敊璇彂鐢燂紝閭d箞閿欒浠g爜涓嶄細涓0銆 榛樿鏄100锛屾剰鍛崇潃鏈煡鐨勮韩浠姐傝皟鐢authenticate鍙互鏀瑰彉杩欎釜鍊笺 | CBaseUserIdentity |
errorMessage | string | 楠岃瘉閿欒淇℃伅銆傞粯璁や负绌恒 | CBaseUserIdentity |
id | mixed | 杩斿洖鍞竴鐨勮韩浣撴爣璇嗐 | CBaseUserIdentity |
isAuthenticated | 楠岃瘉鏄惁鎴愬姛銆 | 杩斿洖鍊艰鏄庤韩浠芥槸鍚﹂氳繃楠岃瘉銆 | CBaseUserIdentity |
name | string | 杩斿洖韬唤鐨勬樉绀哄悕瀛椼 | CBaseUserIdentity |
persistentStates | array | 杩斿洖闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併 | CBaseUserIdentity |
鍏叡鏂规硶
鏂规硶 | 鎻忚堪 | 瀹氫箟鍦 |
---|---|---|
__call() | 濡傛灉绫讳腑娌℃湁璋冪殑鏂规硶鍚嶏紝鍒欒皟鐢ㄨ繖涓柟娉曘 | CComponent |
__get() | 杩斿洖涓涓睘鎬у笺佷竴涓簨浠跺鐞嗙▼搴忓垪琛ㄦ垨涓涓涓哄悕绉般 | CComponent |
__isset() | 妫鏌ヤ竴涓睘鎬ф槸鍚︿负null銆 | CComponent |
__set() | 璁剧疆涓涓粍浠剁殑灞炴у笺 | CComponent |
__unset() | 璁剧疆涓涓粍浠剁殑灞炴т负null銆 | CComponent |
asa() | 杩斿洖杩欎釜鍚嶅瓧鐨勮涓哄璞° | CComponent |
attachBehavior() | 闄勫姞涓涓涓哄埌缁勪欢銆 | CComponent |
attachBehaviors() | 闄勫姞涓涓涓哄垪琛ㄥ埌缁勪欢銆 | CComponent |
attachEventHandler() | 涓轰簨浠堕檮鍔犱竴涓簨浠跺鐞嗙▼搴忋 | CComponent |
authenticate() | 楠岃瘉鐢ㄦ埛韬唤銆 | IUserIdentity |
canGetProperty() | 纭畾灞炴ф槸鍚﹀彲璇汇 | CComponent |
canSetProperty() | 纭畾灞炴ф槸鍚﹀彲鍐欍 | CComponent |
clearState() | 绉婚櫎鎸囧畾鐨勭姸鎬併 | CBaseUserIdentity |
detachBehavior() | 浠庣粍浠朵腑鍒嗙涓涓涓恒 | CComponent |
detachBehaviors() | 浠庣粍浠朵腑鍒嗙鎵鏈夎涓恒 | CComponent |
detachEventHandler() | 鍒嗙涓涓瓨鍦ㄧ殑浜嬩欢澶勭悊绋嬪簭銆 | CComponent |
disableBehavior() | 绂佺敤涓涓檮鍔犺涓恒 | CComponent |
disableBehaviors() | 绂佺敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 | CComponent |
enableBehavior() | 鍚敤涓涓檮鍔犺涓恒 | CComponent |
enableBehaviors() | 鍚敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 | CComponent |
evaluateExpression() | 璁$畻涓涓狿HP琛ㄨ揪寮忥紝鎴栨牴鎹粍浠朵笂涓嬫枃鎵ц鍥炶皟銆 | CComponent |
getEventHandlers() | 杩斿洖涓涓簨浠剁殑闄勫姞澶勭悊绋嬪簭鍒楄〃銆 | CComponent |
getId() | 杩斿洖鍞竴鐨勮韩浣撴爣璇嗐 | CBaseUserIdentity |
getIsAuthenticated() | 杩斿洖鍊艰鏄庤韩浠芥槸鍚﹂氳繃楠岃瘉銆 | CBaseUserIdentity |
getName() | 杩斿洖韬唤鐨勬樉绀哄悕瀛椼 | CBaseUserIdentity |
getPersistentStates() | 杩斿洖闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併 | CBaseUserIdentity |
getState() | 鑾峰彇鎸囧畾鍚嶅瓧鐨勬寔涔呭寲鐘舵併 | CBaseUserIdentity |
hasEvent() | 纭畾涓涓簨浠舵槸鍚﹀畾涔夈 | CComponent |
hasEventHandler() | 妫鏌ヤ簨浠舵槸鍚︽湁闄勫姞鐨勫鐞嗙▼搴忋 | CComponent |
hasProperty() | 纭畾灞炴ф槸鍚﹁瀹氫箟銆 | CComponent |
raiseEvent() | 鍙戣捣涓涓簨浠躲 | CComponent |
setPersistentStates() | 璁剧疆鎸佷箙鍖栫姸鎬佹暟缁勩 | CBaseUserIdentity |
setState() | 璁剧疆鎸囧畾鐘舵佺殑鍊笺 | CBaseUserIdentity |
灞炴ц缁
errorCode
灞炴
public integer $errorCode;
楠岃瘉閿欒浠g爜銆傚鏋滄槸鏈夐敊璇彂鐢燂紝閭d箞閿欒浠g爜涓嶄細涓0銆 榛樿鏄100锛屾剰鍛崇潃鏈煡鐨勮韩浠姐傝皟鐢authenticate鍙互鏀瑰彉杩欎釜鍊笺
errorMessage
灞炴
public string $errorMessage;
楠岃瘉閿欒淇℃伅銆傞粯璁や负绌恒
id
灞炴
鍙
public mixed getId()
杩斿洖鍞竴鐨勮韩浣撴爣璇嗐
isAuthenticated
灞炴
鍙
public 楠岃瘉鏄惁鎴愬姛銆 getIsAuthenticated()
杩斿洖鍊艰鏄庤韩浠芥槸鍚﹂氳繃楠岃瘉銆 姝ゆ柟娉曚负鎺ュ彛IUserIdentity寮哄埗瑕佹眰瀹炵幇銆
name
灞炴
鍙
public string getName()
杩斿洖韬唤鐨勬樉绀哄悕瀛椼
persistentStates
灞炴
杩斿洖闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併 姝ゆ柟娉曚负鎺ュ彛IUserIdentity寮哄埗瑕佹眰瀹炵幇銆
鏂规硶璇︾粏
clearState()
鏂规硶
public void clearState(string $name)
| ||
$name | string | 鐘舵佸悕瀛 |
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#128 (鏄剧ず)
public function clearState($name)
{
unset($this->_state[$name]);
}
绉婚櫎鎸囧畾鐨勭姸鎬併
getId()
鏂规硶
public mixed getId()
| ||
{return} | mixed | 杩斿洖鍞竴鐨勮韩浣撴爣璇嗭紙濡傦紝涓婚敭鍊硷級銆 榛樿瀹炵幇鐨勬槸锛岃繑鍥name銆 |
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#58 (鏄剧ず)
public function getId()
{
return $this->getName();
}
杩斿洖鍞竴鐨勮韩浣撴爣璇嗐
getIsAuthenticated()
鏂规硶
public 楠岃瘉鏄惁鎴愬姛銆 getIsAuthenticated()
| ||
{return} | 楠岃瘉鏄惁鎴愬姛銆 |
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#98 (鏄剧ず)
public function getIsAuthenticated()
{
return $this->errorCode==self::ERROR_NONE;
}
杩斿洖鍊艰鏄庤韩浠芥槸鍚﹂氳繃楠岃瘉銆 姝ゆ柟娉曚负鎺ュ彛IUserIdentity寮哄埗瑕佹眰瀹炵幇銆
getName()
鏂规硶
public string getName()
| ||
{return} | string | 杩斿洖韬唤鐨勬樉绀哄悕瀛椼 榛樿瀹炵幇鐨勬槸锛岃繑鍥炵┖瀛楃涓层 |
杩斿洖韬唤鐨勬樉绀哄悕瀛椼
getPersistentStates()
鏂规硶
public array getPersistentStates()
| ||
{return} | array | 闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併 |
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#78 (鏄剧ず)
public function getPersistentStates()
{
return $this->_state;
}
杩斿洖闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併 姝ゆ柟娉曚负鎺ュ彛IUserIdentity寮哄埗瑕佹眰瀹炵幇銆
getState()
鏂规硶
public mixed getState(string $name, mixed $defaultValue=NULL)
| ||
$name | string | 鐘舵佸悕瀛 |
$defaultValue | mixed | 濡傛灉涓嶅瓨鍦ㄧ殑榛樿杩斿洖鍊 |
{return} | mixed | 鎸囧畾鍚嶅瓧鐨勭姸鎬佸笺 |
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#109 (鏄剧ず)
public function getState($name,$defaultValue=null)
{
return isset($this->_state[$name])?$this->_state[$name]:$defaultValue;
}
鑾峰彇鎸囧畾鍚嶅瓧鐨勬寔涔呭寲鐘舵併
setPersistentStates()
鏂规硶
public void setPersistentStates(array $states)
| ||
$states | array | 闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併 |
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#88 (鏄剧ず)
public function setPersistentStates($states)
{
$this->_state = $states;
}
璁剧疆鎸佷箙鍖栫姸鎬佹暟缁勩
setState()
鏂规硶
public void setState(string $name, mixed $value)
| ||
$name | string | 鐘舵佸悕瀛 |
$value | mixed | 鎸囧畾鍚嶅瓧鐨勭姸鎬佸 |
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#119 (鏄剧ず)
public function setState($name,$value)
{
$this->_state[$name]=$value;
}
璁剧疆鎸囧畾鐘舵佺殑鍊笺