Class UsersModelUser

Description

User model.

  • since: 1.6

Located in /administrator/components/com_users/models/user.php (line 19)

JObject
   |
   --JModelLegacy
      |
      --JModelForm
         |
         --JModelAdmin
            |
            --UsersModelUser
Direct descendents
Class Description
 class AdminModelProfile User model.
Method Summary
 UsersModelUser __construct ([array $config = array()])
 boolean activate (array &$pks)
 boolean batch (array $commands, array $pks, array $contexts)
 boolean batchUser (integer $group_id, array $user_ids, string $action)
 boolean block (array &$pks, [integer $value = 1])
 boolean delete (array &$pks)
 array generateOteps (integer $user_id, [integer $count = 10])
 array getAssignedGroups ([integer $userId = null])
 mixed getForm ([array $data = array()], [boolean $loadData = true])
 array getGroups ()
 mixed getItem ([integer $pk = null])
 stdClass getOtpConfig ([integer $user_id = null])
 JTable getTable ([string $type = 'User'], [string $prefix = 'JTable'], [array $config = array()])
 array getTwofactorform ([integer $user_id = null])
 boolean isValidOtep (integer $user_id, string $otep, [object $otpConfig = null])
 boolean isValidSecretKey (integer $user_id, string $secretkey, [array $options = array()])
 mixed loadFormData ()
 void preprocessForm (JForm $form, mixed $data, [string $group = 'user'])
 boolean save (array $data)
 boolean setOtpConfig (integer $user_id, stdClass $otpConfig)
Variables
Methods
Constructor __construct (line 28)

Constructor.

  • since: 3.2
  • access: public
UsersModelUser __construct ([array $config = array()])
  • array $config: An optional associative array of configuration settings.

Redefinition of:
JModelAdmin::__construct()
Constructor.
activate (line 480)

Method to activate user records.

  • return: True on success.
  • since: 1.6
  • access: public
boolean activate (array &$pks)
  • array &$pks: The ids of the items to activate.
batch (line 573)

Method to perform batch operations on an item or a set of items.

  • return: Returns true on success, false on failure.
  • since: 2.5
  • access: public
boolean batch (array $commands, array $pks, array $contexts)
  • array $commands: An array of commands to perform.
  • array $pks: An array of item ids.
  • array $contexts: An array of item contexts.

Redefinition of:
JModelAdmin::batch()
Method to perform batch operations on an item or a set of items.
batchUser (line 630)

Perform batch operations

  • return: True on success, false on failure
  • since: 1.6
  • access: public
boolean batchUser (integer $group_id, array $user_ids, string $action)
  • integer $group_id: The group ID which assignments are being edited
  • array $user_ids: An array of user IDs on which to operate
  • string $action: The action to perform
block (line 364)

Method to block user records.

  • return: True on success.
  • since: 1.6
  • access: public
boolean block (array &$pks, [integer $value = 1])
  • array &$pks: The ids of the items to publish.
  • integer $value: The value of the published state
delete (line 285)

Method to delete rows.

  • return: Returns true on success, false on failure.
  • since: 1.6
  • access: public
boolean delete (array &$pks)
  • array &$pks: An array of item ids.
generateOteps (line 984)

Generates a new set of One Time Emergency Passwords (OTEPs) for a given user.

  • return: The generated OTEPs
  • since: 3.2
  • access: public
array generateOteps (integer $user_id, [integer $count = 10])
  • integer $user_id: The user ID
  • integer $count: How many OTEPs to generate? Default: 10
getAssignedGroups (line 778)

Gets the groups this object is assigned to

  • return: An array of assigned groups
  • since: 1.6
  • access: public
array getAssignedGroups ([integer $userId = null])
  • integer $userId: The user ID to retrieve the groups for
getForm (line 93)

Method to get the record form.

  • return: A JForm object on success, false on failure
  • since: 1.6
  • access: public
mixed getForm ([array $data = array()], [boolean $loadData = true])
  • array $data: An optional array of data for the form to interogate.
  • boolean $loadData: True if the form is to load its own data (default case), false if not.

Redefinition of:
JModelForm::getForm()
Abstract method for getting the form from the model.

Redefined in descendants as:
getGroups (line 753)

Gets the available groups.

  • return: An array of groups
  • since: 1.6
  • access: public
array getGroups ()
getItem (line 66)

Method to get a single record.

  • return: Object on success, false on failure.
  • since: 1.6
  • access: public
mixed getItem ([integer $pk = null])
  • integer $pk: The id of the primary key.

Redefined in descendants as:
getOtpConfig (line 820)

Returns the one time password (OTP) – a.k.a. two factor authentication – configuration for a particular user.

  • return: An object holding the OTP configuration for this user
  • since: 3.2
  • access: public
stdClass getOtpConfig ([integer $user_id = null])
  • integer $user_id: The numeric ID of the user
getOtpConfigEncryptionKey (line 948)

Gets the symmetric encryption key for the OTP configuration data. It currently returns the site's secret.

  • return: The encryption key
  • since: 3.2
  • access: public
string getOtpConfigEncryptionKey ()
getTable (line 50)

Returns a reference to the a Table object, always creating it.

  • return: A database object
  • since: 1.6
  • access: public
JTable getTable ([string $type = 'User'], [string $prefix = 'JTable'], [array $config = array()])
  • string $type: The table type to instantiate
  • string $prefix: A prefix for the table class name. Optional.
  • array $config: Configuration array for model. Optional.

Redefinition of:
JModelLegacy::getTable()
Method to get a table object, load it if necessary.
getTwofactorform (line 963)

Gets the configuration forms for all two-factor authentication methods in an array.

  • since: 3.2
  • access: public
array getTwofactorform ([integer $user_id = null])
  • integer $user_id: The user ID to load the forms for (optional)
isValidOtep (line 1164)

Checks if the supplied string is a valid one time emergency password (OTEP) for this user. If it is it will be automatically removed from the user's list of OTEPs.

  • return: True if it's a valid OTEP or if two factor auth is not enabled in this user's account.
  • since: 3.2
  • access: public
boolean isValidOtep (integer $user_id, string $otep, [object $otpConfig = null])
  • integer $user_id: The user ID against which you are checking
  • string $otep: The string you want to test for validity
  • object $otpConfig: Optional; the two factor authentication configuration (automatically fetched if not set)
isValidSecretKey (line 1054)

Checks if the provided secret key is a valid two factor authentication secret key. If not, it will check it against the list of one time emergency passwords (OTEPs). If it's a valid OTEP it will also remove it from the user's list of OTEPs.

This method will return true in the following conditions:

  • The two factor authentication is not enabled
  • You have provided a valid secret key for
  • You have provided a valid OTEP
You can define the following options in the $options array: otp_config The OTP (one time password, a.k.a. two factor auth) configuration object. If not set we'll load it automatically. warn_if_not_req Issue a warning if you are checking a secret key against a user account which doesn't have any two factor authentication method enabled. warn_irq_msg The string to use for the warn_if_not_req warning

  • return: True if it's a valid secret key for this user.
  • since: 3.2
  • access: public
boolean isValidSecretKey (integer $user_id, string $secretkey, [array $options = array()])
  • integer $user_id: The user's numeric ID
  • string $secretkey: The secret key you want to check
  • array $options: Options; see above
loadFormData (line 125)

Method to get the data that should be injected in the form.

  • return: The data for the form.
  • since: 1.6
  • access: protected
mixed loadFormData ()

Redefinition of:
JModelForm::loadFormData()
Method to get the data that should be injected in the form.

Redefined in descendants as:
preprocessForm (line 154)

Override JModelAdmin::preprocessForm to ensure the correct plugin group is loaded.

  • since: 1.6
  • throws: Exception if there is an error in the form event.
  • access: protected
void preprocessForm (JForm $form, mixed $data, [string $group = 'user'])
  • JForm $form: A JForm object.
  • mixed $data: The data expected for the form.
  • string $group: The name of the plugin group to import (defaults to "content").

Redefinition of:
JModelForm::preprocessForm()
Method to allow derived classes to preprocess the form.
save (line 168)

Method to save the form data.

  • return: True on success.
  • since: 1.6
  • access: public
boolean save (array $data)
  • array $data: The form data.

Redefined in descendants as:
setOtpConfig (line 911)

Sets the one time password (OTP) – a.k.a. two factor authentication – configuration for a particular user. The $otpConfig object is the same as the one returned by the getOtpConfig method.

  • return: True on success
  • since: 3.2
  • access: public
boolean setOtpConfig (integer $user_id, stdClass $otpConfig)
  • integer $user_id: The numeric ID of the user
  • stdClass $otpConfig: The OTP configuration object

Inherited Methods

Inherited From JModelAdmin

 JModelAdmin::__construct()
 JModelAdmin::batch()
 JModelAdmin::batchAccess()
 JModelAdmin::batchCopy()

Inherited From JModelForm

 JModelForm::checkin()
 JModelForm::checkout()
 JModelForm::getForm()
 JModelForm::loadForm()
 JModelForm::loadFormData()
 JModelForm::preprocessData()
 JModelForm::preprocessForm()
 JModelForm::validate()

Inherited From JModelLegacy

 JModelLegacy::__construct()
 JModelLegacy::addIncludePath()
 JModelLegacy::addTablePath()
 JModelLegacy::cleanCache()
 JModelLegacy::getDbo()
 JModelLegacy::getInstance()
 JModelLegacy::getName()
 JModelLegacy::getState()
 JModelLegacy::getTable()
 JModelLegacy::loadHistory()
 JModelLegacy::populateState()
 JModelLegacy::setDbo()
 JModelLegacy::setState()
 JModelLegacy::_createFileName()
 JModelLegacy::_createTable()
 JModelLegacy::_getList()
 JModelLegacy::_getListCount()

Inherited From JObject

 JObject::__construct()
 JObject::def()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::__toString()

Documentation generated on Tue, 19 Nov 2013 15:16:28 +0100 by phpDocumentor 1.4.3