protected function _buildRegistrationForm() { $Form = new Form('logon', $this->getRouter(), $this->getRequest()); $Form->attach(new FormFieldset('personalInfo')); $Form->personalInfo->setLegend('Personal Info'); $FormNoteInfo = new FormNote('info', FormNote::POSITIONRIGHT); $FormNoteInfo->addSection('First and Last Name', 'Enter your first and last name separately into the labeled text input boxes.'); $FormNoteInfo->addSection('E-Mail Address', array('Enter a valid e-mail address into the labeled text input box; this value will also be your username to log onto this website.', 'Also note that to activate your account you will need to follow a link in an activation e-mail sent to this address. Make sure this is a valid e-mail.')); $FormNoteInfo->addSection('Password', 'You must enter a strong password that is at least six characters and contains at least one letter, one number, and one symbol.'); $Form->personalInfo->attach($FormNoteInfo); $FormNoteUsage = new FormNote('logonmessage', FormNote::POSITIONNORMAL); $FormNoteUsage->addSection(false, 'Please completely fill out the below information. All fields are required.'); $Form->personalInfo->attach($FormNoteUsage); $Form->personalInfo->attach(new FormInput('firstName', 'First Name')); $Form->personalInfo->firstName->restrict(new FormRestrictionNotEmpty()); $Form->personalInfo->firstName->restrict(new FormRestrictionAlphanumeric()); $Form->personalInfo->firstName->restrict(new FormRestrictionMaxLength(48)); $Form->personalInfo->attach(new FormInput('lastName', 'Last Name')); $Form->personalInfo->lastName->restrict(new FormRestrictionNotEmpty()); $Form->personalInfo->lastName->restrict(new FormRestrictionAlphanumeric()); $Form->personalInfo->lastName->restrict(new FormRestrictionMaxLength(48)); $Form->personalInfo->attach(new FormInput('email', 'E-Mail Address')); $Form->personalInfo->email->restrict(new FormRestrictionNotEmpty()); $Form->personalInfo->email->restrict(new FormRestrictionEmail()); $Form->personalInfo->email->restrict(new FormRestrictionMaxLength(48)); $Form->personalInfo->attach(new FormInput('password', 'Password', 'password')); $Form->personalInfo->password->restrict(new FormRestrictionNotEmpty()); $Form->personalInfo->password->restrict(new FormRestrictionMinLength(6)); $Form->personalInfo->password->restrict(new FormRestrictionGoodPassword()); $Form->personalInfo->attach(new FormInput('passwordc', 'Password (Confirm)', 'password')); $Form->personalInfo->passwordc->restrict(new FormRestrictionSameAsField($Form->personalInfo->password)); $Form->personalInfo->attach(new FormInputSubmit('Register')); return $Form; }
public function actionRecover() { $Form = new Form('logon', $this->getRouter(), $this->getRequest()); $Form->attach(new FormFieldset('logonCredentials')); $Form->logonCredentials->setLegend('Logon Credentials'); $FormNote1 = new FormNote('logonmessage', FormNote::POSITIONNORMAL); $FormNote1->addSection(false, 'Please provide the e-mail address registered with us to begin the password reset process.'); $Form->logonCredentials->attach($FormNote1); $Form->logonCredentials->attach(new FormInput('username', 'E-Mail Address')); $Form->logonCredentials->username->restrict(new FormRestrictionNotEmpty()); $Form->logonCredentials->username->restrict(new FormRestrictionEmail()); $Form->logonCredentials->username->restrict(new FormRestrictionMaxLength(48)); $Form->logonCredentials->attach(new FormInputSubmit('Recover Password')); if ($Form->ok()) { } else { $this->getTemplate()->body->form = $Form->fetch(); } }