Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CAccessControlFilter
  • CAccessRule
  • CAuthAssignment
  • CAuthItem
  • CAuthManager
  • CBaseUserIdentity
  • CDbAuthManager
  • CPhpAuthManager
  • CUserIdentity
  • CWebUser
  • X2WebUser
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * CUserIdentity class file
 4:  *
 5:  * @author Qiang Xue <qiang.xue@gmail.com>
 6:  * @link http://www.yiiframework.com/
 7:  * @copyright 2008-2013 Yii Software LLC
 8:  * @license http://www.yiiframework.com/license/
 9:  */
10: 
11: /**
12:  * CUserIdentity is a base class for representing identities that are authenticated based on a username and a password.
13:  *
14:  * Derived classes should implement {@link authenticate} with the actual
15:  * authentication scheme (e.g. checking username and password against a DB table).
16:  *
17:  * By default, CUserIdentity assumes the {@link username} is a unique identifier
18:  * and thus use it as the {@link id ID} of the identity.
19:  *
20:  * @property string $id The unique identifier for the identity.
21:  * @property string $name The display name for the identity.
22:  *
23:  * @author Qiang Xue <qiang.xue@gmail.com>
24:  * @package system.web.auth
25:  * @since 1.0
26:  */
27: class CUserIdentity extends CBaseUserIdentity
28: {
29:     /**
30:      * @var string username
31:      */
32:     public $username;
33:     /**
34:      * @var string password
35:      */
36:     public $password;
37: 
38:     /**
39:      * Constructor.
40:      * @param string $username username
41:      * @param string $password password
42:      */
43:     public function __construct($username,$password)
44:     {
45:         $this->username=$username;
46:         $this->password=$password;
47:     }
48: 
49:     /**
50:      * Authenticates a user based on {@link username} and {@link password}.
51:      * Derived classes should override this method, or an exception will be thrown.
52:      * This method is required by {@link IUserIdentity}.
53:      * @return boolean whether authentication succeeds.
54:      */
55:     public function authenticate()
56:     {
57:         throw new CException(Yii::t('yii','{class}::authenticate() must be implemented.',array('{class}'=>get_class($this))));
58:     }
59: 
60:     /**
61:      * Returns the unique identifier for the identity.
62:      * The default implementation simply returns {@link username}.
63:      * This method is required by {@link IUserIdentity}.
64:      * @return string the unique identifier for the identity.
65:      */
66:     public function getId()
67:     {
68:         return $this->username;
69:     }
70: 
71:     /**
72:      * Returns the display name for the identity.
73:      * The default implementation simply returns {@link username}.
74:      * This method is required by {@link IUserIdentity}.
75:      * @return string the display name for the identity.
76:      */
77:     public function getName()
78:     {
79:         return $this->username;
80:     }
81: }
82: 
API documentation generated by ApiGen 2.8.0