wCMF
3.6
|
Public Member Functions | |
UserManager ($params) | |
encryptPassword ($password) | |
onError ($message, $file='', $line='') | |
startTransaction () | |
commitTransaction () | |
rollbackTransaction () | |
& | createUser ($name, $firstname, $login, $password, $passwordRepeated) |
removeUser ($login) | |
setUserProperty ($login, $property, $value) | |
resetPassword ($login, $newPassword, $newPasswordRepeated) | |
changePassword ($login, $oldPassword, $newPassword, $newPasswordRepeated) | |
& | createRole ($name) |
removeRole ($name) | |
setRoleProperty ($name, $property, $value) | |
addUserToRole ($rolename, $login) | |
removeUserFromRole ($rolename, $login) | |
listUsers () | |
listRoles () | |
listUserRoles ($login) | |
listRoleMembers ($rolename) | |
& | getUser ($login) |
& | getRole ($name) |
& | getPrincipal ($oid) |
removePrincipal ($oid) | |
getUserClassName () | |
getRoleClassName () | |
initialize ($params) | |
& | createUserImpl ($name, $firstname, $login, $password) |
removeUserImpl (&$user) | |
setUserPropertyImpl (&$user, $property, $value) | |
& | createRoleImpl ($name) |
removeRoleImpl (&$role) | |
setRolePropertyImpl (&$role, $property, $value) | |
addUserToRoleImpl (&$role, &$user) | |
removeUserFromRoleImpl (&$role, &$user) | |
Public Attributes | |
$_initParams = null | |
$_userRepository = null | |
$_roleConfig = null | |
UserManager is used to edit users and roles. UserManager supports the following operations:
This class defines abstract methods that subclasses must implement to support different user repositories. The UserManager implementation class is defined by the configuration key 'UserManager' in the [implementation] section.
Definition at line 52 of file class.UserManager.php.
UserManager::UserManager | ( | $params | ) |
Creates a UserManager Object.
params | Initialization data given in an associative array as needed to load the user repository |
Definition at line 62 of file class.UserManager.php.
References InifileParser\getInstance(), and initialize().
UserManager::encryptPassword | ( | $password | ) |
Encrypt a password using the md5 algorithm.
password | The password to encrypt |
Definition at line 79 of file class.UserManager.php.
Referenced by changePassword(), createUser(), LoginController\executeKernel(), AuthUser\login(), and resetPassword().
UserManager::onError | ( | $message, | |
$file = '' , |
|||
$line = '' |
|||
) |
Internal error method. Rollback transaction and call WCMFException::throwEx.
Definition at line 87 of file class.UserManager.php.
References rollbackTransaction(), and WCMFException\throwEx().
Referenced by addUserToRole(), changePassword(), createRole(), createUser(), getPrincipal(), getRoleClassName(), getUserClassName(), listRoleMembers(), listUserRoles(), removePrincipal(), removeRole(), removeUser(), removeUserFromRole(), resetPassword(), setRoleProperty(), and setUserProperty().
UserManager::startTransaction | ( | ) |
Start a transaction. If implemented, the UserManager will collect a number of actions and execute them on commitTransaction(). If not implemented the UserManager will execute these actions on every call of the appropriate function.
Definition at line 98 of file class.UserManager.php.
UserManager::commitTransaction | ( | ) |
Commit a transaction. If implemented, the UserManager will execute a number of actions that it collected since the call to startTransaction(). If not implemented the UserManager will execute these actions on every call of the appropriate function.
Definition at line 105 of file class.UserManager.php.
UserManager::rollbackTransaction | ( | ) |
Rollback a transaction. If implemented, the UserManager will rollback a number of actions that it collected since the call to startTransaction(). If not implemented the UserManager will execute these actions on every call of the appropriate function.
Definition at line 112 of file class.UserManager.php.
Referenced by onError().
& UserManager::createUser | ( | $name, | |
$firstname, | |||
$login, | |||
$password, | |||
$passwordRepeated | |||
) |
Create a user login with a given password.
name | The name of the user |
firstname | The first name of the user |
login | The login of the user |
password | The password of the user |
passwordRepeated | The password of the user again |
Definition at line 123 of file class.UserManager.php.
References createUserImpl(), encryptPassword(), Message\get(), getUser(), and onError().
UserManager::removeUser | ( | $login | ) |
Remove a user login.
login | The login of the user |
Definition at line 149 of file class.UserManager.php.
References Message\get(), getUser(), onError(), and removeUserImpl().
Referenced by removePrincipal().
UserManager::setUserProperty | ( | $login, | |
$property, | |||
$value | |||
) |
Set a user property.
login | The login of the user |
property | One of the USER_PROPERTY constants |
value | The value to set this property to |
Definition at line 171 of file class.UserManager.php.
References DATATYPE_ATTRIBUTE, Message\get(), getUser(), onError(), setUserPropertyImpl(), USER_PROPERTY_CONFIG, USER_PROPERTY_FIRSTNAME, USER_PROPERTY_LOGIN, and USER_PROPERTY_NAME.
Referenced by addUserToRole(), and removeUserFromRole().
UserManager::resetPassword | ( | $login, | |
$newPassword, | |||
$newPasswordRepeated | |||
) |
Reset a users password.
login | The login of the user |
newPassword | The new password for the user |
newPasswordRepeated | The new password of the user again |
Definition at line 207 of file class.UserManager.php.
References encryptPassword(), Message\get(), getUser(), onError(), and setUserPropertyImpl().
UserManager::changePassword | ( | $login, | |
$oldPassword, | |||
$newPassword, | |||
$newPasswordRepeated | |||
) |
Change a users password.
login | The login of the user |
oldPassword | The old password of the user |
newPassword | The new password for the user |
newPasswordRepeated | The new password of the user again |
Definition at line 233 of file class.UserManager.php.
References encryptPassword(), Message\get(), getUser(), onError(), and setUserPropertyImpl().
& UserManager::createRole | ( | $name | ) |
Create a role.
name | The name of the role |
Definition at line 262 of file class.UserManager.php.
References createRoleImpl(), Message\get(), getRole(), and onError().
UserManager::removeRole | ( | $name | ) |
Remove a role.
name | The name of the role |
Definition at line 282 of file class.UserManager.php.
References Message\get(), getRole(), onError(), and removeRoleImpl().
Referenced by removePrincipal().
UserManager::setRoleProperty | ( | $name, | |
$property, | |||
$value | |||
) |
Set a role property.
name | The name of the role |
property | One of the ROLE_PROPERTY constants |
value | The value to set this property to |
Definition at line 304 of file class.UserManager.php.
References DATATYPE_ATTRIBUTE, Message\get(), getRole(), onError(), ROLE_PROPERTY_NAME, and setRolePropertyImpl().
UserManager::addUserToRole | ( | $rolename, | |
$login | |||
) |
Add a user to a role.
rolename | The name of the role |
login | The login of the user |
Definition at line 339 of file class.UserManager.php.
References addUserToRoleImpl(), Message\get(), getRole(), getUser(), onError(), setUserProperty(), and USER_PROPERTY_CONFIG.
UserManager::removeUserFromRole | ( | $rolename, | |
$login | |||
) |
Remove a user from a role.
rolename | The name of the role |
login | The login of the user |
Definition at line 363 of file class.UserManager.php.
References Message\get(), getRole(), getUser(), onError(), removeUserFromRoleImpl(), setUserProperty(), and USER_PROPERTY_CONFIG.
UserManager::listUsers | ( | ) |
Get list of all users.
Definition at line 386 of file class.UserManager.php.
UserManager::listRoles | ( | ) |
Get list of all roles.
Definition at line 399 of file class.UserManager.php.
UserManager::listUserRoles | ( | $login | ) |
Get list of all roles a user has.
Definition at line 412 of file class.UserManager.php.
References Message\get(), getUser(), and onError().
Referenced by listRoleMembers().
UserManager::listRoleMembers | ( | $rolename | ) |
Get list of all users that have a role.
Definition at line 429 of file class.UserManager.php.
References Message\get(), getRole(), listUserRoles(), and onError().
& UserManager::getUser | ( | $login | ) |
Get a user from the repository.
login | The login of the user |
Definition at line 451 of file class.UserManager.php.
Referenced by addUserToRole(), changePassword(), createUser(), listUserRoles(), removeUser(), removeUserFromRole(), resetPassword(), and setUserProperty().
& UserManager::getRole | ( | $name | ) |
Get a role from the repository.
name | The name of the role |
Definition at line 468 of file class.UserManager.php.
Referenced by addUserToRole(), createRole(), listRoleMembers(), removeRole(), removeUserFromRole(), and setRoleProperty().
& UserManager::getPrincipal | ( | $oid | ) |
Get a principal (type: user/role) from the repository.
oid | The oid of the principal |
Definition at line 485 of file class.UserManager.php.
References PersistenceFacade\decomposeOID(), Message\get(), getRoleClassName(), getUserClassName(), and onError().
Referenced by removePrincipal().
UserManager::removePrincipal | ( | $oid | ) |
Remove a principal (type: user/role) from the repository.
oid | The oid of the principal |
Definition at line 512 of file class.UserManager.php.
References PersistenceFacade\decomposeOID(), Message\get(), getPrincipal(), getRoleClassName(), getUserClassName(), onError(), removeRole(), and removeUser().
UserManager::getUserClassName | ( | ) |
Get the user implemenataion class name as configured in config section 'implementation' key 'User'. Maybe used in a static way.
Definition at line 539 of file class.UserManager.php.
References InifileParser\getInstance(), and onError().
Referenced by LockManagerRDB\aquireLockImpl(), UserManagerRDB\createUserImpl(), UserManagerXML\createUserImpl(), UserManagerXML\createUserInstance(), UserController\executeKernel(), PrincipalController\executeKernel(), LockManagerRDB\getLockImpl(), getPrincipal(), AuthUser\getType(), User\getUser(), UserManagerRDB\initialize(), AuthUser\login(), LockManagerRDB\releaseLockImpl(), and removePrincipal().
UserManager::getRoleClassName | ( | ) |
Get the role implemenataion class name as configured in config section 'implementation' key 'Role'. Maybe used in a static way.
Definition at line 553 of file class.UserManager.php.
References InifileParser\getInstance(), and onError().
Referenced by UserManagerRDB\createRoleImpl(), UserManagerXML\createRoleInstance(), PrincipalController\executeKernel(), getPrincipal(), User\getRoleByName(), User\getRoles(), UserManagerRDB\initialize(), and removePrincipal().
UserManager::initialize | ( | $params | ) |
Methods to be implemented by subclasses. Get the user and roles. This method is called before any operation on the repository. Subclasses will override this method to get the data from the application repository.
params | Initialization data given in an associative array as needed to load the user repository |
Definition at line 572 of file class.UserManager.php.
References WCMFException\throwEx().
Referenced by UserManager().
& UserManager::createUserImpl | ( | $name, | |
$firstname, | |||
$login, | |||
$password | |||
) |
Create a user login with a given password.
name | The name of the user |
firstname | The first name of the user |
login | The login of the user |
password | The encrypted password of the user |
Definition at line 586 of file class.UserManager.php.
References WCMFException\throwEx().
Referenced by createUser().
UserManager::removeUserImpl | ( | & | $user | ) |
Remove a user.
user | A reference to the user |
Definition at line 597 of file class.UserManager.php.
References WCMFException\throwEx().
Referenced by removeUser().
UserManager::setUserPropertyImpl | ( | & | $user, |
$property, | |||
$value | |||
) |
Set a user property.
user | A reference to the user |
property | One of the USER_PROPERTY constants or 'password' |
value | The value to set this property to |
Definition at line 608 of file class.UserManager.php.
References WCMFException\throwEx().
Referenced by changePassword(), resetPassword(), and setUserProperty().
& UserManager::createRoleImpl | ( | $name | ) |
Create a role.
name | The name of the role |
Definition at line 619 of file class.UserManager.php.
References WCMFException\throwEx().
Referenced by createRole().
UserManager::removeRoleImpl | ( | & | $role | ) |
Remove a role.
role | A reference to the role |
Definition at line 630 of file class.UserManager.php.
References WCMFException\throwEx().
Referenced by removeRole().
UserManager::setRolePropertyImpl | ( | & | $role, |
$property, | |||
$value | |||
) |
Set a role property.
role | A reference to the role |
property | One of the ROLE_PROPERTY constants |
value | The value to set this property to |
Definition at line 641 of file class.UserManager.php.
References WCMFException\throwEx().
Referenced by setRoleProperty().
UserManager::addUserToRoleImpl | ( | & | $role, |
& | $user | ||
) |
Add a user to a role.
role | A reference to the role |
user | A reference to the user |
Definition at line 652 of file class.UserManager.php.
References WCMFException\throwEx().
Referenced by addUserToRole().
UserManager::removeUserFromRoleImpl | ( | & | $role, |
& | $user | ||
) |
Remove a user from a role.
role | A reference to the role |
user | A reference to the user |
Definition at line 663 of file class.UserManager.php.
References WCMFException\throwEx().
Referenced by removeUserFromRole().
UserManager::$_initParams = null |
Definition at line 54 of file class.UserManager.php.
UserManager::$_userRepository = null |
Definition at line 55 of file class.UserManager.php.
UserManager::$_roleConfig = null |
Definition at line 56 of file class.UserManager.php.