Метод | Описание | |
---|---|---|
__construct ( |
||
addUser ( $userLogin, $password, $email, $alias = false, $_isPasswordHashed = false ) | Add a user in the database. | |
createTokenAuth ( string $userLogin ) : string | Generates a new random authentication token. | |
deleteUser ( string $userLogin ) : boolean | Delete a user and all its access, given its login. | |
getAllUsersPreferences ( array $preferenceNames ) : array | Returns an array of Preferences | |
getInstance ( ) : |
You can create your own Users Plugin to override this class. | |
getSitesAccessFromUser ( string $userLogin ) : array | For each website ID, returns the access level of the given $userLogin. | |
getTokenAuth ( string $userLogin, string $md5Password ) : string | Returns the user's API token. | |
getUser ( string $userLogin ) : array | Returns the user information (login, password hash, alias, email, date_registered, etc.) | |
getUserByEmail ( string $userEmail ) : array | Returns the user information (login, password hash, alias, email, date_registered, etc.) | |
getUserLoginFromUserEmail ( string $userEmail ) : boolean | Returns the first login name of an existing user that has the given email address. If no user can be found for this user an error will be returned. | |
getUserPreference ( string $userLogin, string $preferenceName ) : boolean | string | Gets a user preference | |
getUsers ( string $userLogins = '' ) : array | Returns the list of all the users | |
getUsersAccessFromSite ( integer $idSite ) : array | For each user, returns his access level for the given $idSite. | |
getUsersHavingSuperUserAccess ( ) : array | Returns a list of all Super Users containing there userLogin and email address. | |
getUsersLogin ( ) : array | Returns the list of all the users login | |
getUsersSitesFromAccess ( $access ) : array | For each user, returns the list of website IDs where the user has the supplied $access level. | |
getUsersWithSiteAccess ( $idSite, $access ) | ||
hasSuperUserAccess ( ) : boolean | Detect whether the current user has super user access or not. | |
initUserPreferenceWithDefault ( string $userLogin, string $preferenceName ) | Sets a user preference in the DB using the preference's default value. | |
regenerateTokenAuth ( string $userLogin ) | Regenerate the token_auth associated with a user. | |
setSuperUserAccess ( string $userLogin, boolean | integer $hasSuperUserAccess ) | Enable or disable Super user access to the given user login. Note: When granting Super User access all previous permissions of the user will be removed as the user gains access to everything. | |
setUserAccess ( string $userLogin, string $access, integer | array $idSites ) : boolean | Set an access level to a given user for a list of websites ID. | |
setUserPreference ( string $userLogin, string $preferenceName, string $preferenceValue ) : void | Sets a user preference | |
updateUser ( $userLogin, $password = false, $email = false, $alias = false, $_isPasswordHashed = false ) | Updates a user in the database. | |
userEmailExists ( string $userEmail ) : boolean | Returns true if user with given email (userEmail) is known in the database, or the Super User | |
userExists ( string $userLogin ) : boolean | Returns true if the given userLogin is known in the database |
Метод | Описание | |
---|---|---|
checkAccessType ( $access ) | ||
checkEmail ( $email ) | ||
checkLogin ( $userLogin ) | ||
checkUserEmailExists ( string $userEmail ) | Throws an exception is the user email cannot be found | |
checkUserExists ( string $userLogin ) | Throws an exception is the user login doesn't exist | |
checkUserHasNotSuperUserAccess ( $userLogin ) | ||
checkUserIsNotAnonymous ( $userLogin ) | ||
enrichUser ( $user ) | ||
enrichUsers ( $users ) | ||
getCleanAlias ( $alias, $userLogin ) | ||
getDefaultUserPreference ( $preferenceName, $login ) | ||
getPreferenceId ( $login, $preference ) | ||
getPreferenceValue ( $userLogin, $preferenceName ) | ||
isUserTheOnlyUserHavingSuperUserAccess ( $userLogin ) |
public __construct ( |
||
$model | ||
$filter | Piwik\Plugins\UsersManager\UserAccessFilter | |
$password |
public addUser ( $userLogin, $password, $email, $alias = false, $_isPasswordHashed = false ) |
public createTokenAuth ( string $userLogin ) : string | ||
$userLogin | string | Login |
Результат | string |
public deleteUser ( string $userLogin ) : boolean | ||
$userLogin | string | the user login. |
Результат | boolean | true on success |
public getAllUsersPreferences ( array $preferenceNames ) : array | ||
$preferenceNames | array | array of preference names |
Результат | array |
public static getInstance ( ) : |
||
Результат |
public getSitesAccessFromUser ( string $userLogin ) : array | ||
$userLogin | string | User that has to be valid |
Результат | array | The returned array has the format array( idsite1 => 'view', idsite2 => 'admin', idsite3 => 'view', ... ) |
public getUserByEmail ( string $userEmail ) : array | ||
$userEmail | string | the user email |
Результат | array | the user information |
public getUserLoginFromUserEmail ( string $userEmail ) : boolean | ||
$userEmail | string | |
Результат | boolean | true if the user is known |
public getUsersAccessFromSite ( integer $idSite ) : array | ||
$idSite | integer | website ID |
Результат | array | The returned array has the format array( login1 => 'view', login2 => 'admin', login3 => 'view', ... ) |
public getUsersHavingSuperUserAccess ( ) : array | ||
Результат | array |
public getUsersLogin ( ) : array | ||
Результат | array | the list of all the users login |
public getUsersSitesFromAccess ( $access ) : array | ||
Результат | array | The returned array has the format array( login1 => array ( idsite1,idsite2), login2 => array(idsite2), ... ) |
public hasSuperUserAccess ( ) : boolean | ||
Результат | boolean |
public initUserPreferenceWithDefault ( string $userLogin, string $preferenceName ) | ||
$userLogin | string | |
$preferenceName | string |
public regenerateTokenAuth ( string $userLogin ) | ||
$userLogin | string |
public setUserAccess ( string $userLogin, string $access, integer | array $idSites ) : boolean | ||
$userLogin | string | The user login |
$access | string | Access to grant. Must have one of the following value : noaccess, view, admin |
$idSites | integer | array | The array of idSites on which to apply the access level for the user. If the value is "all" then we apply the access level to all the websites ID for which the current authentificated user has an 'admin' access. |
Результат | boolean | true on success |
public updateUser ( $userLogin, $password = false, $email = false, $alias = false, $_isPasswordHashed = false ) |
public userEmailExists ( string $userEmail ) : boolean | ||
$userEmail | string | |
Результат | boolean | true if the user is known |
public userExists ( string $userLogin ) : boolean | ||
$userLogin | string | |
Результат | boolean | true if the user is known |