Class: I2CE User
This article describes the class I2CE_User.
- Extends the class: I2CE_Fuzzy.
- Location: Part of the module user in the package I2CE
- Source: Defined in the file modules/User/lib/I2CE_User.php on line 34
Variables
$userDB
The user database -- may be empty to use the database that is currently being used set base on the value of I2CE::getConfig()->database->user
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 114
- Type: protected string $userDB
$id
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 347
- Type: public $id
$username
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 348
- Type: public $username
$password
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 349
- Type: public $password
$firstname
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 350
- Type: public $firstname
$lastname
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 351
- Type: public $lastname
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 352
- Type: public $email
$role
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 353
- Type: public $role
$creator
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 354
- Type: public $creator
$md5password
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 355
- Type: public $md5password
Methods
__construct()
Create a new instance of a user. If the id isn't given then it will be determined from the session array.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 147
- Signature: public function __construct($id,$populate,$checkSession,$log)
- Parameters:
- integer $id
The id of the user in the database.- 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['userid'] for a user id. Defaults to true- Default Value: true
- boolean $log
Defaults to true which means we dot record this in the login table- Default Value: true
- integer $id
addUserLog()
Add a new record to the user log for this user showing they have logged in. @global array
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 245
- Signature: private function addUserLog()
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 48
- Signature: public function changePassword($old_password,$new_password)
- Parameters:
- Returns: array
keys are 'sucess' and 'message' the message to display back to the user signifying success or failure. @global array
displayName()
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 269
- Signature: public function displayName()
- Returns: string
The first initial and last name of this user.
findUser()
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 361
- Signature: static public function findUser($field,$value,$log)
- Parameters:
- $field
- $value
- boolean $log
Defaults to false whch means we do not record this in the login table- Default Value: false
getId()
Get the ID of the user
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 222
- Signature: public function getId()
- Returns: integer
getPreferredLocale()
Gets the prefered locales for the user
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 68
- 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 178
- Signature: public function getRole()
- Returns: string
getUserDB()
Returns the database where the user table can be found. This will add the trailing period if it isn't already there.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 123
- Signature: static public function getUserDB()
- Returns: string
logged_in()
Checks to see if the user is logged in.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 314
- Signature: public function logged_in()
- Returns: boolean
login()
Login the user. Check the login and password of the user and log them in. If the password is incorrect then an error message will be set on the template.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 283
- Signature: public function login($username,$password,$template)
- Parameters:
- string $username
- string $password
- I2CE_Template $template @global array
logout()
Log the user out of the system. @global array
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 230
- Signature: public function logout()
mailPassword()
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 378
- Signature: protected function mailPassword()
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 191
- Signature: public function populate($update_log)
- Parameters:
- boolean $update_log @global array
- Default Value: true
- boolean $update_log @global array
save()
Saves the user to the database. This method saves all the user data and updates the access the user has for this system. @global array
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 394
- Signature: public function save($transact)
- Parameters:
- boolean $transact
Defaults to true meaning to wrap the save in a transaction.- Default Value: true
- boolean $transact
setCreator()
Set the creator id of this user.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 322
- Signature: public function setCreator($creator)
- Parameters:
- integer $creator
setId()
Sets the id of the user if not known at creation.
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 169
- Signature: public function setId($id)
- Parameters:
- integer $id
setPassword()
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 326
- Signature: public function setPassword($password,$do_email)
- Parameters:
- $password
- $do_email
- Default Value: true
setPreferredLocale()
Sets the prefered locales for the user
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 93
- Signature: public function setPreferredLocale($locale)
- Parameters:
- string $locale
- Returns: string
$locales. false on failure string or array of strings, the locales on success
username()
Get the username
- Defined in i2ce/modules/User/lib/I2CE_User.php on line 262
- 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()