CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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 | $CWUser | User 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 | $NewUser | User 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 | $UserName | UserName 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 | $ReadOnlyFields | Fields to be displayed as read-only. (OPTIONAL)
  array | $FieldsToExclude | Fields to be removed from default list. (OPTIONAL)
  array | $AdditionalFields | Additional 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 | $FormValues | Values 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 | $FormValues | From _POST to process.
  bool | $IsNewUser | New User? (OPTIONAL, default FALSE).
  bool | $UpdateUserEmail | Indicate 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 | ) |

Save updated values for fields from the User schema based on data supplised in HTML forms.

Parameters

  array | $Fields | The fields to save update.

Returns
  array of MetadataField objects for each required field that was left empty.

Definition at line 95 of file UserEditingUI.php.

References MetadataSchema\MDFTYPE_CONTROLLEDNAME, MetadataSchema\MDFTYPE_DATE, MetadataSchema\MDFTYPE_FILE, MetadataSchema\MDFTYPE_FLAG, MetadataSchema\MDFTYPE_IMAGE, MetadataSchema\MDFTYPE_NUMBER, MetadataSchema\MDFTYPE_OPTION, MetadataSchema\MDFTYPE_PARAGRAPH, MetadataSchema\MDFTYPE_POINT, MetadataSchema\MDFTYPE_REFERENCE, MetadataSchema\MDFTYPE_TEXT, MetadataSchema\MDFTYPE_TIMESTAMP, MetadataSchema\MDFTYPE_TREE, MetadataSchema\MDFTYPE_URL, MetadataSchema\MDFTYPE_USER, MetadataSchema\SCHEMAID_USER, and MetadataField\UPDATEMETHOD_ONRECORDCHANGE.

UserEditingUI::UploadFiles | ( |  | $FormValues,
|  |  | $Files
| ) |  |

Process file upload requests.

Parameters

  array | $FormValues | Values as from $_POST.
  array | $Files | Files 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 | $FormValues | Values as from $_POST.
  array | $Files | Files 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 | $FTool | FTool associated with the user edting page.
  array | $UserErrorCodes | Error codes encountered for this edit.
  array | $ErrorMessages | Error 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:

- interface/default/objects/UserEditingUI.php