PHP Class CakeDC\Users\Shell\UsersShell

Inheritance: extends Cake\Console\Shell
Show file Open project: cakedc/users

Protected Properties

Property Type Description
$_usernameSeed array Work as a seed for username generator

Public Methods

Method Description
activateUser ( ) : void Activate an specific user
addSuperuser ( ) : void Add a new superadmin user
addUser ( ) : void Add a new user
changeRole ( ) : void Change role for a user
deactivateUser ( ) : void De-activate an specific user
deleteUser ( ) : void Delete an specific user and associated social accounts
getOptionParser ( ) : OptionParser
initialize ( ) : void initialize callback
passwordEmail ( ) : void Reset password via email for user
resetAllPasswords ( ) : void Reset password for all user
resetPassword ( ) : void Reset password for a user

Protected Methods

Method Description
_changeUserActive ( boolean $active ) : boolean Change user active field
_generateRandomPassword ( ) : string Generates a random password.
_generateRandomUsername ( ) : string Generates a random username based on a list of preexisting ones.
_generatedHashedPassword ( string $password ) : string Hash a password
_updateUser ( string $username, array $data ) : boolean Update user by username

Method Details

_changeUserActive() protected method

Change user active field
protected _changeUserActive ( boolean $active ) : boolean
$active boolean active value
return boolean

_generateRandomPassword() protected method

Generates a random password.
protected _generateRandomPassword ( ) : string
return string

_generateRandomUsername() protected method

Generates a random username based on a list of preexisting ones.
protected _generateRandomUsername ( ) : string
return string

_generatedHashedPassword() protected method

Hash a password
protected _generatedHashedPassword ( string $password ) : string
$password string password
return string

_updateUser() protected method

Update user by username
protected _updateUser ( string $username, array $data ) : boolean
$username string username
$data array data
return boolean

activateUser() public method

Arguments: - Username
public activateUser ( ) : void
return void

addSuperuser() public method

Add a new superadmin user
public addSuperuser ( ) : void
return void

addUser() public method

Add a new user
public addUser ( ) : void
return void

changeRole() public method

Arguments: - Username - Role to be set
public changeRole ( ) : void
return void

deactivateUser() public method

Arguments: - Username
public deactivateUser ( ) : void
return void

deleteUser() public method

Delete an specific user and associated social accounts
public deleteUser ( ) : void
return void

getOptionParser() public method

public getOptionParser ( ) : OptionParser
return OptionParser

initialize() public method

initialize callback
public initialize ( ) : void
return void

passwordEmail() public method

Reset password via email for user
public passwordEmail ( ) : void
return void

resetAllPasswords() public method

Arguments: - Password to be set
public resetAllPasswords ( ) : void
return void

resetPassword() public method

Arguments: - Username - Password to be set
public resetPassword ( ) : void
return void

Property Details

$_usernameSeed protected property

Work as a seed for username generator
protected array $_usernameSeed
return array