Class: I2CE User (Development): Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
This article describes the class ''I2CE_User'' . | This article describes the class ''I2CE_User'' . | ||
*Extends the class: [[Class: I2CE_Fuzzy (Development) | I2CE_Fuzzy]]. | *Extends the class: [[Class: I2CE_Fuzzy (Development) | I2CE_Fuzzy]]. | ||
*Location: Part of the module [[I2CE Module List (Development)#user|user]] in the package [https://launchpad.net/i2ce I2CE] 4. | *Location: Part of the module [[I2CE Module List (Development)#user|user]] in the package [https://launchpad.net/i2ce I2CE] 4.1-dev | ||
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L34 modules/User/lib/I2CE_User.php] on line 34 | ||
==Variables== | ==Variables== | ||
===$role=== | ===$role=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L40 i2ce/modules/User/lib/I2CE_User.php] on line 40 | ||
*Type: public [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $role | *Type: public [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $role | ||
===$username=== | ===$username=== | ||
the username | the username | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L45 i2ce/modules/User/lib/I2CE_User.php] on line 45 | ||
*Type: public [http://www.php.net/manual/en/language.types.string.php string ] $username | *Type: public [http://www.php.net/manual/en/language.types.string.php string ] $username | ||
===$details=== | ===$details=== | ||
@var public string $role the role associated to the user . An array of user details | @var public string $role the role associated to the user . An array of user details | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L52 i2ce/modules/User/lib/I2CE_User.php] on line 52 | ||
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $details | *Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $details | ||
===$logged_in=== | ===$logged_in=== | ||
flags the user as logged in | flags the user as logged in | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L57 i2ce/modules/User/lib/I2CE_User.php] on line 57 | ||
*Type: protected [http://www.php.net/manual/en/language.types.boolean.php boolean ] $logged_in | *Type: protected [http://www.php.net/manual/en/language.types.boolean.php boolean ] $logged_in | ||
===$locale=== | ===$locale=== | ||
@var protected string $localeThe preferred locale for the user | @var protected string $localeThe preferred locale for the user | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L172 i2ce/modules/User/lib/I2CE_User.php] on line 172 | ||
*Type: protected $locale | *Type: protected $locale | ||
===$id=== | ===$id=== | ||
. False or int, the id for this user. | . False or int, the id for this user. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L247 i2ce/modules/User/lib/I2CE_User.php] on line 247 | ||
*Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $id | *Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $id | ||
===$ip_address=== | |||
. The IP Address from which this user is accessing the system. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L253 i2ce/modules/User/lib/I2CE_User.php] on line 253 | |||
*Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ip_address | |||
==Methods== | ==Methods== | ||
===__construct()=== | ===__construct()=== | ||
Create a new instance of a user. If the username isn't given then it will be determined from the session array. | Create a new instance of a user. If the username isn't given then it will be determined from the session array. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L316 i2ce/modules/User/lib/I2CE_User.php] on line 316 | ||
*Signature: public function __construct($username,$populate,$checkSession,$log) | *Signature: public function __construct($username,$populate,$checkSession,$log) | ||
*Parameters: | *Parameters: | ||
Line 47: | Line 52: | ||
***Default Value: true | ***Default Value: true | ||
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $log <br/>Defaults to true which means we log the activity | ** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $log <br/>Defaults to true which means we log the activity | ||
***Default Value: | ***Default Value: true | ||
===__get()=== | ===__get()=== | ||
Magic method to get user details | Magic method to get user details | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L541 i2ce/modules/User/lib/I2CE_User.php] on line 541 | ||
*Signature: public function __get($detail) | *Signature: public function __get($detail) | ||
*Parameters: | *Parameters: | ||
Line 57: | Line 62: | ||
===__set()=== | ===__set()=== | ||
Magic method to set user details | Magic method to set user details | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L517 i2ce/modules/User/lib/I2CE_User.php] on line 517 | ||
*Signature: public function __set($detail,$value) | *Signature: public function __set($detail,$value) | ||
*Parameters: | *Parameters: | ||
Line 64: | Line 69: | ||
===__unset()=== | ===__unset()=== | ||
Magic method to unset user details | Magic method to unset user details | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L532 i2ce/modules/User/lib/I2CE_User.php] on line 532 | ||
*Signature: public function __unset($detail) | *Signature: public function __unset($detail) | ||
*Parameters: | *Parameters: | ||
Line 70: | Line 75: | ||
===changePassword()=== | ===changePassword()=== | ||
Change the password for this user. This will update a user's record to change the password in the database. It checks to make sure the new password matches the confirmation. | Change the password for this user. This will update a user's record to change the password in the database. It checks to make sure the new password matches the confirmation. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L99 i2ce/modules/User/lib/I2CE_User.php] on line 99 | ||
*Signature: public function changePassword($old_password,$new_password) | *Signature: public function changePassword($old_password,$new_password) | ||
*Parameters: | *Parameters: | ||
Line 77: | Line 82: | ||
*Returns: boolean.<br/>true on success | *Returns: boolean.<br/>true on success | ||
===displayName()=== | ===displayName()=== | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L603 i2ce/modules/User/lib/I2CE_User.php] on line 603 | ||
*Signature: public function displayName() | *Signature: public function displayName() | ||
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>The display name of this user. | *Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>The display name of this user. | ||
===findUsersByInfo()=== | ===findUsersByInfo()=== | ||
Gets the userss by the indicated details as well as the role. @oaram boolean $role Defaults to false | Gets the userss by the indicated details as well as the role. @oaram boolean $role Defaults to false | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L622 i2ce/modules/User/lib/I2CE_User.php] on line 622 | ||
*Signature: static public function findUsersByInfo($role,$details,$include_internal) | *Signature: static public function findUsersByInfo($role,$details,$include_internal) | ||
*Parameters: | *Parameters: | ||
Line 94: | Line 99: | ||
===generatePassword()=== | ===generatePassword()=== | ||
Generate a password | Generate a password | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L80 i2ce/modules/User/lib/I2CE_User.php] on line 80 | ||
*Signature: static public function generatePassword() | *Signature: static public function generatePassword() | ||
*Returns: [http://www.php.net/manual/en/language.types.string.php string ] | *Returns: [http://www.php.net/manual/en/language.types.string.php string ] | ||
===getAutoLoginUser()=== | |||
Gets the auto login user, if any | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L298 i2ce/modules/User/lib/I2CE_User.php] on line 298 | |||
*Signature: static public function getAutoLoginUser() | |||
*Returns: mixed.<br/>false on failure the username if a autologin user has been set | |||
===getDetailName()=== | ===getDetailName()=== | ||
Returns the display name of the given detail | Returns the display name of the given detail | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L142 i2ce/modules/User/lib/I2CE_User.php] on line 142 | ||
*Signature: static public function getDetailName($detail) | *Signature: static public function getDetailName($detail) | ||
*Parameters: | *Parameters: | ||
Line 106: | Line 116: | ||
===getId()=== | ===getId()=== | ||
Gets the user id from the username | Gets the user id from the username | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L260 i2ce/modules/User/lib/I2CE_User.php] on line 260 | ||
*Signature: public function getId() | *Signature: public function getId() | ||
*Returns: [http://www.php.net/manual/en/language.types.integer.php int ]<br/>or false on failure | *Returns: [http://www.php.net/manual/en/language.types.integer.php int ]<br/>or false on failure | ||
===getPreferredLocale()=== | ===getPreferredLocale()=== | ||
Gets the prefered locales for the user | Gets the prefered locales for the user | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L178 i2ce/modules/User/lib/I2CE_User.php] on line 178 | ||
*Signature: public function getPreferredLocale() | *Signature: public function getPreferredLocale() | ||
*Returns: $string | *Returns: $string | ||
===getRole()=== | ===getRole()=== | ||
Get's the role associated with a user. | Get's the role associated with a user. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L559 i2ce/modules/User/lib/I2CE_User.php] on line 559 | ||
*Signature: public function getRole() | *Signature: public function getRole() | ||
*Returns: [http://www.php.net/manual/en/language.types.string.php string ] | *Returns: [http://www.php.net/manual/en/language.types.string.php string ] | ||
===hasDetail()=== | ===hasDetail()=== | ||
check if the specified detail can be set @params string $detail | check if the specified detail can be set @params string $detail | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L64 i2ce/modules/User/lib/I2CE_User.php] on line 64 | ||
*Signature: static public function hasDetail($detail) | *Signature: static public function hasDetail($detail) | ||
*Parameters: | *Parameters: | ||
Line 128: | Line 138: | ||
===hasPreferredLocale()=== | ===hasPreferredLocale()=== | ||
Checks if the prefered locale for the user has been saved | Checks if the prefered locale for the user has been saved | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L199 i2ce/modules/User/lib/I2CE_User.php] on line 199 | ||
*Signature: public function hasPreferredLocale() | *Signature: public function hasPreferredLocale() | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
===isRequired()=== | ===isRequired()=== | ||
Checks to see if the indicated detail is required $param string $detail returns boolean | Checks to see if the indicated detail is required $param string $detail returns boolean | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L156 i2ce/modules/User/lib/I2CE_User.php] on line 156 | ||
*Signature: static public function isRequired($detail) | *Signature: static public function isRequired($detail) | ||
*Parameters: | *Parameters: | ||
Line 139: | Line 149: | ||
===logged_in()=== | ===logged_in()=== | ||
Checks to see if this user has been logged in | Checks to see if this user has been logged in | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L397 i2ce/modules/User/lib/I2CE_User.php] on line 397 | ||
*Signature: public function logged_in() | *Signature: public function logged_in() | ||
===login()=== | ===login()=== | ||
Login the user and populate their details then an error message will be set on the [[Class: I2CE_Template (Development) | template]]. | Login the user and populate their details then an error message will be set on the [[Class: I2CE_Template (Development) | template]]. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L411 i2ce/modules/User/lib/I2CE_User.php] on line 411 | ||
*Signature: public function login($username,$password) | *Signature: public function login($username,$password) | ||
*Parameters: | *Parameters: | ||
Line 151: | Line 161: | ||
===logout()=== | ===logout()=== | ||
Log the user out of the system. @global array | Log the user out of the system. @global array | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L577 i2ce/modules/User/lib/I2CE_User.php] on line 577 | ||
*Signature: public function logout() | *Signature: public function logout() | ||
===passwordlessLogin()=== | |||
Login the user and populate their details then an error message will be set on the [[Class: I2CE_Template (Development) | template]]. | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L451 i2ce/modules/User/lib/I2CE_User.php] on line 451 | |||
*Signature: public function passwordlessLogin($username) | |||
*Parameters: | |||
** [http://www.php.net/manual/en/language.types.string.php string ] $username | |||
*Returns: boolean.<br/>True on success, error message of failure | |||
===populate()=== | ===populate()=== | ||
Populate the member variables of this object. This will also update the user log to show the latest activity for this login. | Populate the member variables of this object. This will also update the user log to show the latest activity for this login. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L480 i2ce/modules/User/lib/I2CE_User.php] on line 480 | ||
*Signature: public function populate($details,$role,$id) | *Signature: public function populate($details,$role,$id) | ||
*Parameters: | *Parameters: | ||
Line 167: | Line 184: | ||
===save()=== | ===save()=== | ||
Saves the user to the database. This method saves all the user data and updates the access the user has for this system. | Saves the user to the database. This method saves all the user data and updates the access the user has for this system. | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L638 i2ce/modules/User/lib/I2CE_User.php] on line 638 | ||
*Signature: public function save($password) | *Signature: public function save($password) | ||
*Parameters: | *Parameters: | ||
Line 174: | Line 191: | ||
===setPassword()=== | ===setPassword()=== | ||
Set the password for the user | Set the password for the user | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L117 i2ce/modules/User/lib/I2CE_User.php] on line 117 | ||
*Signature: public function setPassword($password) | *Signature: public function setPassword($password) | ||
*Parameters: | *Parameters: | ||
Line 181: | Line 198: | ||
===setPreferredLocale()=== | ===setPreferredLocale()=== | ||
Sets the prefered locales for the user | Sets the prefered locales for the user | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L219 i2ce/modules/User/lib/I2CE_User.php] on line 219 | ||
*Signature: public function setPreferredLocale($locale,$save) | *Signature: public function setPreferredLocale($locale,$save) | ||
*Parameters: | *Parameters: | ||
Line 190: | Line 207: | ||
===setRole()=== | ===setRole()=== | ||
Get's the role associated with a user. @param string $ole | Get's the role associated with a user. @param string $ole | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L568 i2ce/modules/User/lib/I2CE_User.php] on line 568 | ||
*Signature: public function setRole($role) | *Signature: public function setRole($role) | ||
*Parameters: | *Parameters: | ||
Line 196: | Line 213: | ||
===userExists()=== | ===userExists()=== | ||
See if a user is in the system | See if a user is in the system | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L128 i2ce/modules/User/lib/I2CE_User.php] on line 128 | ||
*Signature: static public function userExists($username,$has_role) | *Signature: static public function userExists($username,$has_role) | ||
*Parameters: | *Parameters: | ||
Line 202: | Line 219: | ||
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $has_role <br/>If true we verify that they have a role set. | ** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $has_role <br/>If true we verify that they have a role set. | ||
*Returns: boolean. | *Returns: boolean. | ||
===userHasDefaultPassword()=== | |||
Checks to see if the specified user has a default password | |||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L270 i2ce/modules/User/lib/I2CE_User.php] on line 270 | |||
*Signature: static public function userHasDefaultPassword($username) | |||
*Parameters: | |||
** [http://www.php.net/manual/en/language.types.string.php string ] $username | |||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | |||
===userHasPassword()=== | ===userHasPassword()=== | ||
Checks to see if the specified user has the given password | Checks to see if the specified user has the given password | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L285 i2ce/modules/User/lib/I2CE_User.php] on line 285 | ||
*Signature: static public function userHasPassword($username,$password) | *Signature: static public function userHasPassword($username,$password) | ||
*Parameters: | *Parameters: | ||
Line 212: | Line 236: | ||
===username()=== | ===username()=== | ||
Get the username | Get the username | ||
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4. | *Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/User/lib/I2CE_User.php#L596 i2ce/modules/User/lib/I2CE_User.php] on line 596 | ||
*Signature: public function username() | *Signature: public function username() | ||
==Inherited Methods== | ==Inherited Methods== |
Latest revision as of 08:20, 6 May 2015
This article describes the class I2CE_User .
- Extends the class: I2CE_Fuzzy.
- Location: Part of the module user in the package I2CE 4.1-dev
- Source: Defined in the file modules/User/lib/I2CE_User.php on line 34
Variables
$role
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 40
- Type: public mixed $role
$username
the username
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 45
- Type: public string $username
$details
@var public string $role the role associated to the user . An array of user details
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 52
- Type: protected array $details
$logged_in
flags the user as logged in
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 57
- Type: protected boolean $logged_in
$locale
@var protected string $localeThe preferred locale for the user
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 172
- Type: protected $locale
$id
. False or int, the id for this user.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 247
- Type: protected mixed $id
$ip_address
. The IP Address from which this user is accessing the system.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 253
- Type: protected mixed $ip_address
Methods
__construct()
Create a new instance of a user. If the username isn't given then it will be determined from the session array.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 316
- Signature: public function __construct($username,$populate,$checkSession,$log)
- Parameters:
- integer $username
The id of the user in the database. or '0' (the detauls) to get it from the session- Default Value: '0'
- boolean $populate
A flag to determine if the user should be automatically populated at creation. Defaults to true- Default Value: true
- boolean $checkSession
A flag to determine if we should check the $_SESSION for user information Defaults to true- Default Value: true
- boolean $log
Defaults to true which means we log the activity- Default Value: true
- integer $username
__get()
Magic method to get user details
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 541
- Signature: public function __get($detail)
- Parameters:
- string $detail
- Returns: mixed.
false on failure
__set()
Magic method to set user details
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 517
- Signature: public function __set($detail,$value)
- Parameters:
__unset()
Magic method to unset user details
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 532
- Signature: public function __unset($detail)
- Parameters:
- string $detail
changePassword()
Change the password for this user. This will update a user's record to change the password in the database. It checks to make sure the new password matches the confirmation.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 99
- Signature: public function changePassword($old_password,$new_password)
- Parameters:
- Returns: boolean.
true on success
displayName()
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 603
- Signature: public function displayName()
- Returns: string
The display name of this user.
findUsersByInfo()
Gets the userss by the indicated details as well as the role. @oaram boolean $role Defaults to false
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 622
- Signature: static public function findUsersByInfo($role,$details,$include_internal)
- Parameters:
- Returns: mixed.
I2CE_User on success, false on failure.
generatePassword()
Generate a password
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 80
- Signature: static public function generatePassword()
- Returns: string
getAutoLoginUser()
Gets the auto login user, if any
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 298
- Signature: static public function getAutoLoginUser()
- Returns: mixed.
false on failure the username if a autologin user has been set
getDetailName()
Returns the display name of the given detail
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 142
- Signature: static public function getDetailName($detail)
- Parameters:
- string $detail
- Returns: string
getId()
Gets the user id from the username
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 260
- Signature: public function getId()
- Returns: int
or false on failure
getPreferredLocale()
Gets the prefered locales for the user
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 178
- Signature: public function getPreferredLocale()
- Returns: $string
getRole()
Get's the role associated with a user.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 559
- Signature: public function getRole()
- Returns: string
hasDetail()
check if the specified detail can be set @params string $detail
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 64
- Signature: static public function hasDetail($detail)
- Parameters:
- $detail
- Returns: boolean
hasPreferredLocale()
Checks if the prefered locale for the user has been saved
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 199
- Signature: public function hasPreferredLocale()
- Returns: boolean
isRequired()
Checks to see if the indicated detail is required $param string $detail returns boolean
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 156
- Signature: static public function isRequired($detail)
- Parameters:
- $detail
logged_in()
Checks to see if this user has been logged in
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 397
- Signature: public function logged_in()
login()
Login the user and populate their details then an error message will be set on the template.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 411
- Signature: public function login($username,$password)
- Parameters:
- Returns: boolean.
True on success, error message of failure
logout()
Log the user out of the system. @global array
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 577
- Signature: public function logout()
passwordlessLogin()
Login the user and populate their details then an error message will be set on the template.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 451
- Signature: public function passwordlessLogin($username)
- Parameters:
- string $username
- Returns: boolean.
True on success, error message of failure
populate()
Populate the member variables of this object. This will also update the user log to show the latest activity for this login.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 480
- Signature: public function populate($details,$role,$id)
- Parameters:
- mixed $details
If null, we try to get the details and rolefrom the access mechanism if an array, it is the array of details with key the name of details. Defaults to null. @param mixed role. Default to null otherwise it should be a string, the role.- Default Value: null
- $role
- Default Value: null
- mixed $id
Defaults to false otherwise it should be an int the id.- Default Value: false
- mixed $details
- Returns: true
on success
save()
Saves the user to the database. This method saves all the user data and updates the access the user has for this system.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 638
- Signature: public function save($password)
- Parameters:
- mixed $password
If it is a string, it is the password to set for the user. detaulst to false in which case we do not set the password- Default Value: false
- mixed $password
setPassword()
Set the password for the user
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 117
- Signature: public function setPassword($password)
- Parameters:
- string $password
- Returns: mixed.
true on success. on failure it is false or a the message to display back to the user signifying why it failed.
setPreferredLocale()
Sets the prefered locales for the user
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 219
- Signature: public function setPreferredLocale($locale,$save)
- Parameters:
- Returns: string
$locales. false on failure string or array of strings, the locales on success
setRole()
Get's the role associated with a user. @param string $ole
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 568
- Signature: public function setRole($role)
- Parameters:
- $role
userExists()
See if a user is in the system
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 128
- Signature: static public function userExists($username,$has_role)
- Parameters:
- Returns: boolean.
userHasDefaultPassword()
Checks to see if the specified user has a default password
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 270
- Signature: static public function userHasDefaultPassword($username)
- Parameters:
- string $username
- Returns: boolean
userHasPassword()
Checks to see if the specified user has the given password
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 285
- Signature: static public function userHasPassword($username,$password)
- Parameters:
- Returns: boolean
username()
Get the username
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 596
- Signature: public function username()
Inherited Methods
_hasMethod()
This public method is inherited from I2CE_Fuzzy->_hasMethod()
Inherited Fuzzy Methods
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()