Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe UsersModelUser
+ Graphe d'héritage de UsersModelUser:

Fonctions membres publiques

 __construct ($config=array())
 
 getTable ($type='User', $prefix='JTable', $config=array())
 
 getItem ($pk=null)
 
 getForm ($data=array(), $loadData=true)
 
 save ($data)
 
 delete (&$pks)
 
 block (&$pks, $value=1)
 
 activate (&$pks)
 
 batch ($commands, $pks, $contexts)
 
 batchReset ($userIds, $action)
 
 batchUser ($groupId, $userIds, $action)
 
 getGroups ()
 
 getAssignedGroups ($userId=null)
 
 getOtpConfig ($userId=null)
 
 setOtpConfig ($userId, $otpConfig)
 
 getOtpConfigEncryptionKey ()
 
 getTwofactorform ($userId=null)
 
 generateOteps ($userId, $count=10)
 
 isValidSecretKey ($userId, $secretKey, $options=array())
 
 isValidOtep ($userId, $otep, $otpConfig=null)
 

Fonctions membres protégées

 loadFormData ()
 
 preprocessForm (JForm $form, $data, $group='user')
 

Attributs protégés

 $_item = null
 

Description détaillée

User model.

Depuis
1.6

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $config = array())

Constructor.

Paramètres
array$configAn optional associative array of configuration settings.
Depuis
3.2

Références $config.

Documentation des fonctions membres

◆ activate()

activate ( $pks)

Method to activate user records.

Paramètres
array&$pksThe ids of the items to activate.
Renvoie
boolean True on success.
Depuis
1.6

Références $dispatcher, $i, $user, elseif, JEventDispatcher\getInstance(), User\getTable(), null, et JError\raiseWarning().

◆ batch()

batch (   $commands,
  $pks,
  $contexts 
)

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

Paramètres
array$commandsAn array of commands to perform.
array$pksAn array of item ids.
array$contextsAn array of item contexts.
Renvoie
boolean Returns true on success, false on failure.
Depuis
2.5

Références ArrayHelper\getValue(), et ArrayHelper\toInteger().

◆ batchReset()

batchReset (   $userIds,
  $action 
)

Batch flag users as being required to reset their passwords

Paramètres
array$userIdsAn array of user IDs on which to operate
string$actionThe action to perform
Renvoie
boolean True on success, false on failure
Depuis
3.2

Références $action, $db, $query, $value, et ArrayHelper\toInteger().

◆ batchUser()

batchUser (   $groupId,
  $userIds,
  $action 
)

Perform batch operations

Paramètres
integer$groupIdThe group ID which assignments are being edited
array$userIdsAn array of user IDs on which to operate
string$actionThe action to perform
Renvoie
boolean True on success, false on failure
Depuis
1.6

Références $action, $db, $groups, $id, $query, $users, et ArrayHelper\toInteger().

◆ block()

block ( $pks,
  $value = 1 
)

Method to block user records.

Paramètres
array&$pksThe ids of the items to publish.
integer$valueThe value of the published state
Renvoie
boolean True on success.
Depuis
1.6

Références $app, $dispatcher, $i, $options, $user, $value, UserHelper\destroyUserSessions(), elseif, JEventDispatcher\getInstance(), User\getTable(), null, et JError\raiseWarning().

◆ delete()

delete ( $pks)

Method to delete rows.

Paramètres
array&$pksAn array of item ids.
Renvoie
boolean Returns true on success, false on failure.
Depuis
1.6

Références $dispatcher, $i, $user, JEventDispatcher\getInstance(), User\getTable(), et JError\raiseWarning().

◆ generateOteps()

generateOteps (   $userId,
  $count = 10 
)

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

Paramètres
integer$userIdThe user ID
integer$countHow many OTEPs to generate? Default: 10
Renvoie
array The generated OTEPs
Depuis
3.2

Références $base, $count, $i, et $userId.

Référencé par AdminModelProfile\generateOteps().

◆ getAssignedGroups()

getAssignedGroups (   $userId = null)

Gets the groups this object is assigned to

Paramètres
integer$userIdThe user ID to retrieve the groups for
Renvoie
array An array of assigned groups
Depuis
1.6

Références $form, $params, et $userId.

◆ getForm()

getForm (   $data = array(),
  $loadData = true 
)

Method to get the record form.

Paramètres
array$dataAn optional array of data for the form to interrogate.
boolean$loadDataTrue if the form is to load its own data (default case), false if not.
Renvoie
mixed A JForm object on success, false on failure
Depuis
1.6

Références $form, et $userId.

◆ getGroups()

getGroups ( )

Gets the available groups.

Renvoie
array An array of groups
Depuis
1.6

Références $user, et null.

◆ getItem()

getItem (   $pk = null)

Method to get a single record.

Paramètres
integer$pkThe id of the primary key.
Renvoie
mixed Object on success, false on failure.
Depuis
1.6

Références null.

◆ getOtpConfig()

getOtpConfig (   $userId = null)

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

Paramètres
integer$userIdThe numeric ID of the user
Renvoie
stdClass An object holding the OTP configuration for this user
Depuis
3.2

Get the raw data, without going through JUser (required in order to be able to modify the user record before logging in the user).

Références $config, $db, $item, $key, $query, $userId, et null.

Référencé par AdminModelProfile\getOtpConfig(), UsersModelProfile\getOtpConfig(), et UsersModelProfile\getTwofactorform().

◆ getOtpConfigEncryptionKey()

getOtpConfigEncryptionKey ( )

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

Renvoie
string The encryption key
Depuis
3.2

◆ getTable()

getTable (   $type = 'User',
  $prefix = 'JTable',
  $config = array() 
)

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

Paramètres
string$typeThe table type to instantiate
string$prefixA prefix for the table class name. Optional.
array$configConfiguration array for model. Optional.
Renvoie
JTable A database object
Depuis
1.6

Références $config, $prefix, et $type.

◆ getTwofactorform()

getTwofactorform (   $userId = null)

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

Paramètres
integer$userIdThe user ID to load the forms for (optional)
Renvoie
array
Depuis
3.2

Références $userId, et FOFPlatform\getInstance().

Référencé par AdminModelProfile\getTwofactorform().

◆ isValidOtep()

isValidOtep (   $userId,
  $otep,
  $otpConfig = null 
)

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.

Paramètres
integer$userIdThe user ID against which you are checking
string$otepThe string you want to test for validity
object$otpConfigOptional; the two factor authentication configuration (automatically fetched if not set)
Renvoie
boolean True if it's a valid OTEP or if two factor auth is not enabled in this user's account.
Depuis
3.2

Two factor authentication enabled and no OTEPs defined. The user has used them all up. Therefore anything they enter is an invalid OTEP.

Références $check, et $userId.

◆ isValidSecretKey()

isValidSecretKey (   $userId,
  $secretKey,
  $options = array() 
)

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

Paramètres
integer$userIdThe user's numeric ID
string$secretKeyThe secret key you want to check
array$optionsOptions; see above
Renvoie
boolean True if it's a valid secret key for this user.
Depuis
3.2

Références $app, $check, $extension, $lang, $options, $userId, FOFPlatform\getInstance(), JPATH_ADMINISTRATOR, et null.

◆ loadFormData()

loadFormData ( )
protected

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

Renvoie
mixed The data for the form.
Depuis
1.6

Références $data.

◆ preprocessForm()

preprocessForm ( JForm  $form,
  $data,
  $group = 'user' 
)
protected

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

Paramètres
JForm$formA JForm object.
mixed$dataThe data expected for the form.
string$groupThe name of the plugin group to import (defaults to "content").
Renvoie
void
Depuis
1.6
Exceptions
Exceptionif there is an error in the form event.

Références $data, et $form.

◆ save()

save (   $data)

Method to save the form data.

Paramètres
array$dataThe form data.
Renvoie
boolean True on success.
Depuis
1.6

Références $data, $user, UserHelper\destroyUserSessions(), FOFPlatform\getInstance(), et null.

◆ setOtpConfig()

setOtpConfig (   $userId,
  $otpConfig 
)

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.

Paramètres
integer$userIdThe numeric ID of the user
stdClass$otpConfigThe OTP configuration object
Renvoie
boolean True on success
Depuis
3.2

Références $db, $key, $userId, et json_encode.

Référencé par AdminModelProfile\setOtpConfig().

Documentation des champs

◆ $_item

$_item = null
protected

La documentation de cette classe a été générée à partir du fichier suivant :