summaryrefslogtreecommitdiff
path: root/framework/gii/components/UserIdentity.php
diff options
context:
space:
mode:
authorPatrick Seeger <pseeger@ccwn.org>2012-04-13 23:11:05 +0200
committerPatrick Seeger <pseeger@ccwn.org>2012-04-13 23:11:05 +0200
commit341cc4dd9c53ffbfb863e026dd58549c1082c7a7 (patch)
tree1bbbed20313bafb9b063b6b4d894fe580d8b000f /framework/gii/components/UserIdentity.php
yii-framework 1.1.10 hinzugefügtHEADmaster
Diffstat (limited to 'framework/gii/components/UserIdentity.php')
-rw-r--r--framework/gii/components/UserIdentity.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/framework/gii/components/UserIdentity.php b/framework/gii/components/UserIdentity.php
new file mode 100644
index 0000000..9de480e
--- /dev/null
+++ b/framework/gii/components/UserIdentity.php
@@ -0,0 +1,20 @@
+<?php
+
+class UserIdentity extends CUserIdentity
+{
+ /**
+ * Authenticates a user.
+ * @return boolean whether authentication succeeds.
+ */
+ public function authenticate()
+ {
+ $password=Yii::app()->getModule('gii')->password;
+ if($password===null)
+ throw new CException('Please configure the "password" property of the "gii" module.');
+ else if($password===false || $password===$this->password)
+ $this->errorCode=self::ERROR_NONE;
+ else
+ $this->errorCode=self::ERROR_UNKNOWN_IDENTITY;
+ return !$this->errorCode;
+ }
+} \ No newline at end of file