Class lispa\amos\admin\utility\UserProfileUtility

Inheritancelispa\amos\admin\utility\UserProfileUtility

Class UserProfileUtility

Public Methods

Hide inherited methods

MethodDescriptionDefined By
createNewAccount() 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. lispa\amos\admin\utility\UserProfileUtility
createNewUser() This method create new User only with the email that must be unique. lispa\amos\admin\utility\UserProfileUtility
createNewUserProfile() This method create new UserProfile only with the name and surname. lispa\amos\admin\utility\UserProfileUtility
generateDeactivateSubject() lispa\amos\admin\utility\UserProfileUtility
generateSubject() lispa\amos\admin\utility\UserProfileUtility
generateUsername() lispa\amos\admin\utility\UserProfileUtility
getAllFacilitatorUserIds() This method return all facilitator user ids. lispa\amos\admin\utility\UserProfileUtility
getCommunitiesForManagers() This method return all communities to view for a single manager in the community managers list. lispa\amos\admin\utility\UserProfileUtility
sendCredentialsMail() lispa\amos\admin\utility\UserProfileUtility
sendMail() lispa\amos\admin\utility\UserProfileUtility
sendPasswordResetMail() lispa\amos\admin\utility\UserProfileUtility
setBasicUserRoleToUser() This method set the BASIC_USER role to the user id passed by parameters. lispa\amos\admin\utility\UserProfileUtility
setCwhPersonalValidation() Setting personal validation scope for contents if cwh module is enabled lispa\amos\admin\utility\UserProfileUtility

Constants

Hide inherited constants

ConstantValueDescriptionDefined 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

createNewAccount() public static method

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
$email string
$privacy integer

Default Not Accepted

$sendCredentials
$community string

Community

return array

Error or user id

createNewUser() public static method

This method create new User only with the email that must be unique.

public static lispa\amos\core\user\User createNewUser ( $email, $username null )
$email string
$username \lispa\amos\admin\utility\string!null
createNewUserProfile() public static method

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

generateDeactivateSubject() public static method

public static void generateDeactivateSubject ( lispa\amos\admin\models\UserProfile $model )
$model
generateSubject() public static method

public static string generateSubject ( $model )
$model
generateUsername() public static method

public static string generateUsername ( $email )
$email string
getAllFacilitatorUserIds() public static method

This method return all facilitator user ids.

public static integer[] getAllFacilitatorUserIds ( )
getCommunitiesForManagers() public static method

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
sendCredentialsMail() public static method

public static boolean sendCredentialsMail ( $model, $community null )
$model lispa\amos\community\models\Community
$community
sendMail() public static method

public static boolean sendMail ( $model, $subjectView, $contentView )
$model
$subjectView
$contentView
sendPasswordResetMail() public static method

public static boolean sendPasswordResetMail ( $model, $community null, $urlPrevious null )
$model lispa\amos\community\models\Community
$community
$urlPrevious string
setBasicUserRoleToUser() public static method

This method set the BASIC_USER role to the user id passed by parameters.

It return

public static boolean setBasicUserRoleToUser ( $userId )
$userId integer
setCwhPersonalValidation() public static method

Setting personal validation scope for contents if cwh module is enabled

public static void setCwhPersonalValidation ( $userProfile )
$userProfile lispa\amos\admin\models\UserProfile