Class lispa\amos\admin\utility\UserProfileUtility
Inheritance | lispa\amos\admin\utility\UserProfileUtility |
---|
Class UserProfileUtility
Public Methods
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
UNABLE_TO_ASSIGN_USER_ROLES_ERROR | 3 | lispa\amos\admin\utility\UserProfileUtility | |
UNABLE_TO_CREATE_USER_ERROR | 1 | Errors | lispa\amos\admin\utility\UserProfileUtility |
UNABLE_TO_CREATE_USER_PROFILE_ERROR | 2 | lispa\amos\admin\utility\UserProfileUtility |
Method Details
The method create a new account. It creates a new User and new UserProfile only with name, surname and email. The email must be unique in the database! It assign the BASIC_USER role to the new user.
This method returns the user id if all goes well. It returns boolean false in case of errors.
public static array createNewAccount ( $name, $surname, $email, $privacy = 0, $sendCredentials = false, $community = null ) | ||
$name | string | |
$surname | string | |
string | ||
$privacy | integer | Default Not Accepted |
$sendCredentials | ||
$community | string | Community |
return | array | Error or user id |
---|
This method create new User only with the email that must be unique.
public static lispa\amos\core\user\User createNewUser ( $email, $username = null ) | ||
string | ||
$username | \lispa\amos\admin\utility\string!null |
This method create new UserProfile only with the name and surname.
public static lispa\amos\admin\models\UserProfile createNewUserProfile ( $user, $name, $surname, $privacy = 0 ) | ||
$user | lispa\amos\core\user\User | |
$name | string | |
$surname | string | |
$privacy | integer | Default Not Accepted |
public static void generateDeactivateSubject ( lispa\amos\admin\models\UserProfile $model ) | ||
$model |
public static string generateSubject ( $model ) | ||
$model |
public static string generateUsername ( $email ) | ||
string |
This method return all facilitator user ids.
public static integer[] getAllFacilitatorUserIds ( ) |
This method return all communities to view for a single manager in the community managers list.
public static lispa\amos\community\models\Community[] getCommunitiesForManagers ( $communityModule, $userId ) | ||
$communityModule | lispa\amos\community\AmosCommunity | |
$userId | integer |
public static boolean sendCredentialsMail ( $model, $community = null ) | ||
$model | lispa\amos\community\models\Community | |
$community |
public static boolean sendMail ( $model, $subjectView, $contentView ) | ||
$model | ||
$subjectView | ||
$contentView |
public static boolean sendPasswordResetMail ( $model, $community = null, $urlPrevious = null ) | ||
$model | lispa\amos\community\models\Community | |
$community | ||
$urlPrevious | string |
This method set the BASIC_USER role to the user id passed by parameters.
It return
public static boolean setBasicUserRoleToUser ( $userId ) | ||
$userId | integer |
Setting personal validation scope for contents if cwh module is enabled
public static void setCwhPersonalValidation ( $userProfile ) | ||
$userProfile | lispa\amos\admin\models\UserProfile |