menu

SiteGenesis / Server-side JS / Module: controllers/Account

Controller that renders the account overview, manages customer registration and password reset, and edits customer profile information.

Source:

Members

(static) EditForm

Handles the form submission on profile update of edit profile.

Source:
See:

(static) EditProfile

Updates the profile of an authenticated customer.

Source:
See:

(static) IncludeNavigation

Renders the account navigation.

Source:
See:

(static) PasswordReset

Renders the password reset screen.

Source:
See:

(static) PasswordResetDialog

Renders the password reset dialog.

Source:
See:

(static) PasswordResetDialogForm

Handles the password reset form.

Source:
See:

(static) PasswordResetForm

The form handler for password resets.

Source:
See:

(static) RegistrationForm

Handles registration form submit.

Source:
See:

(static) SetNewPassword

Renders the screen for setting a new password.

Source:
See:

(static) SetNewPasswordForm

Handles the set new password form submit.

Source:
See:

(static) Show

Renders the account overview.

Source:
See:

(static) StartRegister

Start the customer registration process and renders customer registration page.

Source:
See:

Methods

(inner) editForm()

Handles the form submission on profile update of edit profile. Handles cancel and confirm actions.

  • cancel - clears the profile form and redirects to the Account-Show controller function.
  • confirm - gets a CustomerModel object that wraps the current customer. Validates several form fields. If any of the profile validation conditions fail, the user is redirected to the Account-EditProfile controller function. If the profile is valid, the user is redirected to the Account-Show controller function.
Source:

(inner) editProfile()

Clears the profile form and copies customer profile information from the customer global variable to the form. Gets a ContentModel object that wraps the myaccount-personaldata content asset, and updates the page meta data. Renders the account/user/registration template using an anonymous view.

Source:

(inner) includeNavigation()

Renders the accountnavigation template.

Source:

(inner) passwordReset()

Gets the requestpassword form and renders the requestpasswordreset template. This is similar to the password reset dialog, but has a screen-based interaction instead of a popup interaction.

Source:

(inner) passwordResetDialog()

Clears the requestpassword form and renders the account/password/requestpasswordresetdialog template.

Source:

(inner) passwordResetDialogForm()

Handles the password reset form.

Source:

(inner) passwordResetForm()

The form handler for password resets.

Source:

(inner) passwordResetFormHandler()

Handles form submission from dialog and full page password reset. Handles cancel, send, and error actions.

  • cancel - renders the given template.
  • send - gets a CustomerModel object that wraps the current customer. Gets an EmailModel object that wraps an Email object. Checks whether the customer requested the their login password be reset. If the customer wants to reset, a password reset token is generated and an email is sent to the customer using the mail/resetpasswordemail template. Then the account/password/requestpasswordreset_confirm template is rendered.
  • error - the given template is rendered and passed an error code.
Source:

(inner) registrationForm()

Gets a CustomerModel object wrapping the current customer. Gets a profile form and handles the confirm action. confirm - validates the profile by checking that the email and password fields:

  • match the emailconfirm and passwordconfirm fields
  • are not duplicates of existing username and password fields for the profile If the fields are not valid, the registration template is rendered. If the fields are valid, a new customer account is created, the profile form is cleared and the customer is redirected to the Account-Show controller function.
Source:

(inner) setNewPassword()

Gets a CustomerModel wrapping the current customer. Clears the resetpassword form. Checks if the customer wants to reset their password. If there is no reset token, redirects to the Account-PasswordReset controller function. If there is a reset token, renders the screen for setting a new password.

Source:

(inner) setNewPasswordForm()

Gets a profile form and handles the cancel and send actions.

  • cancel - renders the setnewpassword template.
  • send - gets a CustomerModel object that wraps the current customer and gets an EmailModel object that wraps an Email object. Checks whether the customer can be retrieved using a reset password token. If the customer does not have a valid token, the controller redirects to the Account-PasswordReset controller function. If they do, then an email is sent to the customer using the mail/setpasswordemail template and the setnewpassword_confirm template is rendered.
Source:

(inner) show()

Gets a ContentModel object that wraps the myaccount-home content asset, updates the page metadata, and renders the account/accountoverview template.

Source:

(inner) startRegister()

Clears the profile form, adds the email address from login as the profile email address, and renders customer registration page.

Source: