\App\ConsoleModule\ModelsConsoleUserManager

Tool for managing users from CLI

Summary

Methods
Properties
Constants
__construct()
changePassword()
delete()
edit()
editPassword()
getInfo()
getUsers()
register()
getUser()
uniqueUserName()
listUsers()
listUserNames()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(\App\CoreModule\Models\Context  database) : 

Constructor

Parameters

\App\CoreModule\Models\Context database

Database context

Returns

changePassword()

changePassword(  id,   oldPassword,   newPassword) : 

Change user's password

Parameters

id

User ID

oldPassword

Old password

newPassword

New password

Throws

\App\CoreModule\Models\InvalidPasswordException

Returns

delete()

delete(  id) : 

Delete the user

Parameters

id

User ID

Returns

edit()

edit(  id,   username,   role,   language) : 

Edit the user

Parameters

id

User ID

username

New username

role

New user role

language

New user's language

Throws

\App\CoreModule\Models\UsernameAlreadyExistsException

Returns

editPassword()

editPassword(  id,   password) : 

Edit rhe user's password

Parameters

id

User ID

password

New User's password

Returns

getInfo()

getInfo(  id) : array|null

Get information about the user

Parameters

id

User ID

Returns

array|null —

Information about the user or null

getUsers()

getUsers() : mixed||string|int

Get all registered users

Returns

mixed||string|int —

Registered users

register()

register(  username,   password,   role,   language) : 

Register a new user

Parameters

username

Username

password

Password

role

User's role

language

User's language

Throws

\App\CoreModule\Models\UsernameAlreadyExistsException

Returns

getUser()

getUser(null|string  username) : array|null

Get information about the user from username

Parameters

null|string username

Username

Returns

array|null —

Information about the user

uniqueUserName()

uniqueUserName(null|string  username) : 

Check if the username is unique

Parameters

null|string username

Username to check

Returns

Is username unique?

listUsers()

listUsers() : mixed||string|int

List all registered users

Returns

mixed||string|int —

Registered users

listUserNames()

listUserNames() : mixed||string|int

List user names of all webapp's users

Returns

mixed||string|int —

User names of all webapp's users