CWIS Developer Documentation
Public Member Functions | Static Public Member Functions | List of all members
UserEditingUI Class Reference

Class supplying standard methods that process changes to user entered via HTML forms. More...

Public Member Functions

 __construct ($CWUser)
 Set up a new UserEditingUI. More...
 
 UpdateUserAttributes (array $FormValues, $IsNewUser=FALSE, $UpdateUserEmail=FALSE)
 Save user attributes that aren't stored in User Schema fields. More...
 
 UpdateUserFields (array $Fields)
 Save updated values for fields from the User schema based on data supplised in HTML forms. More...
 
 UploadFiles ($FormValues, $Files)
 Process file upload requests. More...
 
 UploadImages ($FormValues, $Files)
 Process image upload requests for a user. More...
 

Static Public Member Functions

static UserFormHasErrors (&$FTool, $UserErrorCodes, $ErrorMessages=NULL)
 Determine if a user editing form has errors, setting error codes in the correspnding FormTool. More...
 
static GetActivationEmailSubstitutions ($NewUser)
 Retrieve the array of substitutions for new user activation mails. More...
 
static GetRequestAccountForm ($ReadOnlyFields=array(), $FieldsToExclude=array(), $AdditionalFields=array())
 Retrieve the array of Request Account Form information. More...
 
static GetAdditionalErrorCodes ($UserName)
 Get the list of account creation-related error messages. More...
 
static TestUserValues ($FormValues)
 Check potential form values for a user including event signals. More...
 

Detailed Description

Class supplying standard methods that process changes to user entered via HTML forms.

Definition at line 14 of file UserEditingUI.php.

Constructor & Destructor Documentation

UserEditingUI::__construct (   $CWUser)

Set up a new UserEditingUI.

Parameters
CWUser$CWUserUser to operate on.

Definition at line 20 of file UserEditingUI.php.

Member Function Documentation

static UserEditingUI::GetActivationEmailSubstitutions (   $NewUser)
static

Retrieve the array of substitutions for new user activation mails.

Parameters
CWUser$NewUserUser that wants to be activated.
Returns
array of substitutions (keys are search strings, values their replacements).

Definition at line 786 of file UserEditingUI.php.

static UserEditingUI::GetAdditionalErrorCodes (   $UserName)
static

Get the list of account creation-related error messages.

Parameters
string$UserNameUserName for the password reminder link.
Returns
array mapping error codes to error messages.

Definition at line 964 of file UserEditingUI.php.

References U_DUPLICATEEMAIL.

static UserEditingUI::GetRequestAccountForm (   $ReadOnlyFields = array(),
  $FieldsToExclude = array(),
  $AdditionalFields = array() 
)
static

Retrieve the array of Request Account Form information.

Parameters
array$ReadOnlyFieldsFields to be displayed as read-only. (OPTIONAL)
array$FieldsToExcludeFields to be removed from default list. (OPTIONAL)
array$AdditionalFieldsAdditional fields to be displayed. (OPTIONAL)
Returns
array of form fields.

Definition at line 814 of file UserEditingUI.php.

References FormUI_Base\FTYPE_HEADING, FormUI_Base\FTYPE_OPTION, FormUI_Base\FTYPE_PASSWORD, FormUI_Base\FTYPE_TEXT, User\GetPasswordRulesDescription(), and StdLib\GetUsStatesList().

static UserEditingUI::TestUserValues (   $FormValues)
static

Check potential form values for a user including event signals.

Parameters
array$FormValuesValues as from $_POST.
Returns
array of error codes.

Definition at line 981 of file UserEditingUI.php.

References U_OKAY.

UserEditingUI::UpdateUserAttributes ( array  $FormValues,
  $IsNewUser = FALSE,
  $UpdateUserEmail = FALSE 
)

Save user attributes that aren't stored in User Schema fields.

Parameters
array$FormValuesFrom _POST to process.
bool$IsNewUserNew User? (OPTIONAL, default FALSE).
bool$UpdateUserEmailIndicate whether user email should be updated (OPTIONAL, default FALSE)

Definition at line 32 of file UserEditingUI.php.

References User\Get(), User\Id(), and User\Set().

UserEditingUI::UpdateUserFields ( array  $Fields)
UserEditingUI::UploadFiles (   $FormValues,
  $Files 
)

Process file upload requests.

Parameters
array$FormValuesValues as from $_POST.
array$FilesFiles as from $_FILES.

Definition at line 509 of file UserEditingUI.php.

References File\FILESTAT_OK, File\FILESTAT_ZEROLENGTH, MetadataSchema\MDFTYPE_FILE, and MetadataSchema\SCHEMAID_USER.

UserEditingUI::UploadImages (   $FormValues,
  $Files 
)

Process image upload requests for a user.

Parameters
array$FormValuesValues as from $_POST.
array$FilesFiles as from $_FILES.

Definition at line 590 of file UserEditingUI.php.

References AI_OKAY, AI_UNKNOWNTYPE, AI_UNSUPPORTEDFORMAT, MetadataSchema\MDFTYPE_IMAGE, and MetadataSchema\SCHEMAID_USER.

static UserEditingUI::UserFormHasErrors ( $FTool,
  $UserErrorCodes,
  $ErrorMessages = NULL 
)
static

Determine if a user editing form has errors, setting error codes in the correspnding FormTool.

Parameters
FormTool$FToolFTool associated with the user edting page.
array$UserErrorCodesError codes encountered for this edit.
array$ErrorMessagesError messages corresponding to each error code ( array($ErrorCode => $ErrorMessage) ).
Returns
bool TRUE when the form has errors, FALSE otherwise.

Definition at line 666 of file UserEditingUI.php.

References User\GetStatusMessageForCode(), U_DUPLICATEEMAIL, U_DUPLICATEUSERNAME, U_EMAILSDONTMATCH, U_EMPTYEMAIL, U_EMPTYEMAILAGAIN, U_EMPTYPASSWORD, U_EMPTYPASSWORDAGAIN, U_EMPTYUSERNAME, U_ILLEGALEMAIL, U_ILLEGALEMAILAGAIN, U_ILLEGALPASSWORD, U_ILLEGALPASSWORDAGAIN, U_ILLEGALUSERNAME, and U_PASSWORDSDONTMATCH.


The documentation for this class was generated from the following file: