|
| __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) |
|
◆ __construct()
__construct |
( |
|
$config = array() | ) |
|
Constructor.
- Paramètres
-
array | $config | An optional associative array of configuration settings. |
- Depuis
- 3.2
Références $config.
◆ activate()
◆ batch()
batch |
( |
|
$commands, |
|
|
|
$pks, |
|
|
|
$contexts |
|
) |
| |
Method to perform batch operations on an item or a set of items.
- Paramètres
-
array | $commands | An array of commands to perform. |
array | $pks | An array of item ids. |
array | $contexts | An 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 | $userIds | An array of user IDs on which to operate |
string | $action | The 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 | $groupId | The group ID which assignments are being edited |
array | $userIds | An array of user IDs on which to operate |
string | $action | The 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 | &$pks | The ids of the items to publish. |
integer | $value | The value of the published state |
- Renvoie
- boolean True on success.
- Depuis
- 1.6
Références $app, $dispatcher, $i, $options, $user, $value, elseif, JEventDispatcher\getInstance(), User\getTable(), null, et JError\raiseWarning().
◆ delete()
◆ generateOteps()
generateOteps |
( |
|
$userId, |
|
|
|
$count = 10 |
|
) |
| |
Generates a new set of One Time Emergency Passwords (OTEPs) for a given user.
- Paramètres
-
integer | $userId | The user ID |
integer | $count | How 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 | $userId | The 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 | $data | An optional array of data for the form to interrogate. |
boolean | $loadData | True 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()
Gets the available groups.
- Renvoie
- array An array of groups
- Depuis
- 1.6
Références $user, et null.
◆ getItem()
Method to get a single record.
- Paramètres
-
integer | $pk | The id of the primary key. |
- Renvoie
- mixed Object on success, false on failure.
- Depuis
- 1.6
Références null.
◆ getOtpConfig()
getOtpConfig |
( |
|
$userId = null | ) |
|
◆ 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 | $type | The table type to instantiate |
string | $prefix | A prefix for the table class name. Optional. |
array | $config | Configuration array for model. Optional. |
- Renvoie
- JTable A database object
- Depuis
- 1.6
Références $config, $prefix, et $type.
◆ getTwofactorform()
getTwofactorform |
( |
|
$userId = null | ) |
|
◆ 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 | $userId | 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) |
- 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 | $userId | The user's numeric ID |
string | $secretKey | The secret key you want to check |
array | $options | Options; 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()
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 | $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"). |
- Renvoie
- void
- Depuis
- 1.6
- Exceptions
-
Exception | if there is an error in the form event. |
Références $data, et $form.
◆ save()
◆ 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 | $userId | The numeric ID of the user |
stdClass | $otpConfig | The 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().
◆ $_item
La documentation de cette classe a été générée à partir du fichier suivant :