public function addElements() { //-- Profile name -- $login = new Element\Text('profile_name'); $login->setAttribute('placeholder', 'profile_name'); $login->setAttribute('required', 'true'); $login->setAttribute('class', 'form-control'); $login->setAttribute('id', 'profile-name'); $login->setLabel('Profile name'); $login->setLabelAttributes(array('class' => 'control-label', 'for' => 'profile-name')); //-- Password -- $password = new Element\Password('password'); $password->setAttribute('placeholder', '*****'); $password->setAttribute('required', 'true'); $password->setAttribute('class', 'form-control'); $password->setAttribute('id', 'password'); $password->setLabel('Password'); $password->setLabelAttributes(array('class' => 'control-label', 'for' => 'password')); //-- Submit -- $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn btn-success'); $submit->setValue('Send'); // Binding elements $this->add($login); $this->add($password); $this->add($submit); }
public function __construct(AuthenticationService $authService) { parent::__construct('login'); $this->filter = new InputFilter(); $email = new Element\Email('email'); $email->setAttribute('required', true); $email->setAttribute('placeholder', 'Email Address'); $this->add($email); $emailFilter = new Input('email'); $emailFilter->setRequired(true); $this->filter->add($emailFilter); $password = new Element\Password('password'); $password->setAttribute('required', true); $password->setAttribute('placeholder', 'Password'); $this->add($password); $passwordFilter = new Input('password'); $passwordFilter->setRequired(true); $passwordFilter->getValidatorChain()->attach(new AuthValidator\Authentication(array('message' => 'Invalid email address or password', 'service' => $authService, 'adapter' => $authService->getAdapter(), 'identity' => 'email', 'credential' => 'password'))); $this->filter->add($passwordFilter); $buttons = new Form('buttons'); $buttons->setOption('twb-layout', 'inline'); $buttons->setAttribute('class', 'form-group'); $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn-primary pull-right'); $submit->setOption('glyphicon', 'log-in'); $submit->setLabel('Log In'); $buttons->add($submit); $forgot = new Element\Submit('forgot'); $forgot->setAttribute('formnovalidate', true); $forgot->setAttribute('class', 'btn-warning pull-right'); $forgot->setOption('glyphicon', 'question-sign'); $forgot->setLabel('Forgot Password'); $buttons->add($forgot); $this->add($buttons); }
public function __construct($sm) { parent::__construct('resetPassword'); $this->sm = $sm; $altesPasswort = new Password('oldPass'); $altesPasswort->setLabel('LABEL_CHANGE_PASSWORD_OLD_PASS'); $altesPasswort->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $altesPasswort->setAttribute('class', 'form-control'); $altesPasswort->setAttribute('id', 'oldPass'); $this->add($altesPasswort); $neuesPasswort = new Password('newPass'); $neuesPasswort->setLabel('LABEL_CHANGE_PASSWORD_NEW_PASS'); $neuesPasswort->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $neuesPasswort->setAttribute('class', 'form-control'); $neuesPasswort->setAttribute('id', 'newPass'); $this->add($neuesPasswort); $neuesPasswortConfirm = new Password('newPassConfirm'); $neuesPasswortConfirm->setLabel('LABEL_CHANGE_PASSWORD_NEW_CONFIRM'); $neuesPasswortConfirm->setLabelAttributes(array('class' => 'col-sm-2 control-label')); $neuesPasswortConfirm->setAttribute('class', 'form-control'); $neuesPasswortConfirm->setAttribute('id', 'newPassConfirm'); $this->add($neuesPasswortConfirm); $submit = new Submit('resetPasswordSubmit'); $submit->setValue('LABEL_CHANGE_PASSWORD_SUBMIT'); $submit->setAttribute('class', 'btn btn-default'); $this->add($submit); return $this; }
public function init() { $username = new Element\Text('username'); $username->setAttribute('class', 'form-control'); $username->setAttribute('placeholder', 'Username'); //$username->setAttribute('required', true); $this->add($username); $password = new Element\Password('password'); $password->setAttribute('class', 'form-control'); $password->setAttribute('placeholder', 'Password'); //$password->setAttribute('required', true); $this->add($password); }
public function __construct($useOldPassword = true) { parent::__construct(); $this->setAttribute('method', 'post'); $this->setAttribute('class', 'panel-body'); if ($useOldPassword) { $oldPassword = new Password('oldPassword'); $oldPassword->setLabel('old.password'); $oldPassword->setAttribute('class', 'form-control'); $this->add($oldPassword); } $password = new Password('password'); $password->setLabel('password'); $password->setAttribute('class', 'form-control'); $this->add($password); $password2 = new Password('password2'); $password2->setLabel('repeat.password'); $password2->setAttribute('class', 'form-control'); $this->add($password2); $captcha = new Captcha('register_captcha'); $imageAdapter = new Image(['font' => __DIR__ . '/../../fonts/arial.ttf']); $imageAdapter->setHeight(100); $imageAdapter->setWidth(400); $imageAdapter->setFontSize(48); $imageAdapter->setDotNoiseLevel(400); $imageAdapter->setLineNoiseLevel(40); $captcha->setCaptcha($imageAdapter); $captcha->setLabel('enter.text.from.the.picture'); $captcha->setAttribute('class', 'form-control'); $this->add($captcha); $submit = new Submit('save'); $submit->setValue('save'); $submit->setAttribute('class', 'btn btn-primary'); $this->add($submit); }
/** * Add pass element */ public function addPassElement($name = 'pass') { $element = new Password($name); $element->setLabel('Passwort'); $element->setAttribute('class', 'datepicker form-control'); $this->add($element); }
public function init() { parent::__construct('newPassword'); $password = new Password('password'); $password->setAttribute('id', 'password'); $password->setAttribute('placeholder', $this->translator->translate('newPassword.password.placeholder')); $this->add($password); $passwordRepeat = new Password('passwordRepeat'); $passwordRepeat->setAttribute('id', 'passwordRepeat'); $passwordRepeat->setAttribute('placeholder', $this->translator->translate('newPassword.passwordRepeat.placeholder')); $this->add($passwordRepeat); $submit = new Submit('submit'); $submit->setAttribute('class', 'button'); $submit->setValue($this->translator->translate('newPassword.submit.value')); $this->add($submit); return $this; }
public function __construct() { parent::__construct('password'); $this->filter = new InputFilter(); $oldPassword = new Element\Password('oldPassword'); $oldPassword->setAttribute('required', true); $oldPassword->setAttribute('placeholder', 'Current Password'); $this->add($oldPassword); $oldPasswordFilter = new Input('oldPassword'); $oldPasswordFilter->setRequired(true); $this->filter->add($oldPasswordFilter); $newPassword = new Element\Password('newPassword'); $newPassword->setAttribute('required', true); $newPassword->setAttribute('placeholder', 'New Password'); $this->add($newPassword); $newPasswordFilter = new Input('newPassword'); $newPasswordFilter->setRequired(true); $newPasswordFilter->getFilterChain()->attach(new Filter\StringTrim()); $newPasswordFilter->getValidatorChain()->attach(new AppValidator\PasswordStrength()); $this->filter->add($newPasswordFilter); $confirmPassword = new Element\Password('confirmPassword'); $confirmPassword->setAttribute('required', true); $confirmPassword->setAttribute('placeholder', 'Confirm New Password'); $this->add($confirmPassword); $confirmPasswordFilter = new Input('confirmPassword'); $confirmPasswordFilter->setRequired(true); $confirmPasswordFilter->getFilterChain()->attach(new Filter\StringTrim()); $confirmPasswordFilter->getValidatorChain()->attach(new Validator\Identical('newPassword')); $this->filter->add($confirmPasswordFilter); $buttons = new Form('buttons'); $buttons->setOption('twb-layout', 'inline'); $buttons->setAttribute('class', 'form-group'); $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn-primary pull-right'); $submit->setOption('glyphicon', 'lock'); $submit->setLabel('Change Password'); $buttons->add($submit); $cancel = new Element\Submit('cancel'); $cancel->setAttribute('formnovalidate', true); $cancel->setAttribute('class', 'btn-warning pull-right'); $cancel->setOption('glyphicon', 'ban-circle'); $cancel->setLabel('Cancel'); $buttons->add($cancel); $this->add($buttons); }
public function __construct() { parent::__construct('UserLogin'); $username = new TextElement('username'); $username->setAttribute('placeholder', 'Username'); $password = new PasswordElement('password'); $password->setAttribute('placeholder', 'Password'); $submit = new SubmitElement('submit', array('label' => 'Login')); $this->add($username)->add($password)->add($submit); }
public function setId() { $username = new Element\Text('username'); $username->setLabel('User name'); $username->setAttribute('id', 'username'); $this->add($username); $password = new Element\Password('Password'); $password->setLabel('Password'); $password->setAttribute('id', 'password'); $this->add($password); }
public function addElements() { //-- Password current ----------------------------- $password_current = new Element\Password('password_current'); $password_current->setAttribute('placeholder', '*****'); $password_current->setAttribute('required', 'true'); $password_current->setAttribute('class', 'form-control'); $password_current->setAttribute('id', 'password-current'); $password_current->setLabel('Current'); $password_current->setLabelAttributes(array('class' => 'control-label', 'for' => 'password-current')); //-- Password ------------------------------------ $password = new Element\Password('password'); $password->setAttribute('placeholder', '*****'); $password->setAttribute('required', 'true'); $password->setAttribute('class', 'form-control'); $password->setAttribute('id', 'password'); $password->setLabel('New'); $password->setLabelAttributes(array('class' => 'control-label', 'for' => 'password')); //-- Password (confirm) --------------------------- $password_confirm = new Element\Password('confirm_password'); $password_confirm->setAttribute('placeholder', '*****'); $password_confirm->setAttribute('required', 'true'); $password_confirm->setAttribute('class', 'form-control'); $password_confirm->setAttribute('id', 'confirm-password'); $password_confirm->setLabel('Confirm'); $password_confirm->setLabelAttributes(array('class' => 'control-label', 'for' => 'confirm-password')); //-- Submit ------------------------------------- $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn btn-success'); $submit->setValue('Send'); // Binding elements $this->add($password_current); $this->add($password); $this->add($password_confirm); $this->add($submit); }
public function inAction() { //check for the existence of any users, and if none, it means it is a new installation, then redirect to user registration $entityManager = $this->getServiceLocator()->get('entity-manager'); $countAdministrators = $entityManager->getRepository(get_class(new User()))->countAdminUsers(); if (!$countAdministrators) { $this->flashMessenger()->addInfoMessage('Here you can create the first user for the system'); return $this->redir()->toRoute('admin/default', ['controller' => 'log', 'action' => 'initial']); } $uname = new Element\Text('uname'); $uname->setLabel('User name'); $uname->setAttribute('required', 'required'); $password = new Element\Password('password'); $password->setLabel('Password'); $password->setAttribute('required', 'required'); $form = new Form('login'); $form->add($uname)->add($password); $unameInput = new Input('uname'); $unameInput->getFilterChain()->attachByName('StringTrim'); $passwordInput = new Input('password'); $inputFilter = new InputFilter(); $inputFilter->add($unameInput)->add($passwordInput); $form->setInputFilter($inputFilter); $request = $this->getRequest(); if ($request->isPost()) { $form->setData($request->getPost()); if ($form->isValid()) { $uname = $form->get('uname')->getValue(); $password = $form->get('password')->getValue(); $auth = $this->getServiceLocator()->get('auth'); $authAdapter = $auth->getAdapter(); $authAdapter->setIdentity($uname); $authAdapter->setCredential($password); $result = $auth->authenticate(); $user = $result->getIdentity(); if ($result->isValid()) { $this->flashMessenger()->addSuccessMessage(sprintf($this->translator->translate("Welcome %s. You have been logged in successfully"), $user->getUname())); return $this->redir()->toRoute('admin/default', array('controller' => 'index')); } else { $this->flashMessenger()->addErrorMessage($this->translator->translate('Wrong details')); $this->redir()->toRoute('admin/default', array('controller' => 'log', 'action' => 'in')); } } } return array('form' => $form); }
public function __construct() { parent::__construct(); $this->setAttribute('method', 'post'); $this->setAttribute('class', 'panel-body'); $username = new Text('username'); $username->setLabel('username'); $username->setAttribute('class', 'form-control'); $this->add($username); $password = new Password('password'); $password->setLabel('password'); $password->setAttribute('class', 'form-control'); $this->add($password); $submit = new Submit('login'); $submit->setValue('login'); $submit->setAttribute('class', 'btn btn-primary'); $this->add($submit); }
public function __construct($name = null) { // we want to ignore the name passed parent::__construct($name); $this->setAttributes(array('data-ng-controller' => 'loginCtrl', 'class' => 'my-form', 'data-ng-submit' => 'submit()')); $user = new Element\Text('user'); $user->setAttributes(array('required' => 'required', 'data-ng-model' => 'user')); ////->setLabel('Usuario') // ->setAttribute('data-ng-model','user') // ->setAttribute('required', 'required'); $pass = new Element\Password('pass'); $pass->setAttribute('data-ng-model', 'pass')->setAttribute('required', 'required'); $submit = new Element\Submit('entrar'); $submit->setValue('Entrar'); $this->add($user); $this->add($pass); $this->add($submit); }
public function __construct() { parent::__construct(); $this->setAttribute('method', 'post'); $this->setAttribute('class', 'panel-body'); $username = new Text('username'); $username->setLabel('username'); $username->setAttribute('class', 'form-control'); $username->setAttribute('data-urr', '/isusernameinuse'); $this->add($username); $mail = new Email('email'); $mail->setLabel('email'); $mail->setAttribute('class', 'form-control'); $this->add($mail); $password = new Password('password'); $password->setLabel('password'); $password->setAttribute('class', 'form-control'); $this->add($password); $password2 = new Password('password2'); $password2->setLabel('repeat.password'); $password2->setAttribute('class', 'form-control'); $this->add($password2); $captcha = new Captcha('registerCaptcha'); $imageAdapter = new Image(['font' => __DIR__ . '/../../fonts/arial.ttf']); $imageAdapter->setHeight(100); $imageAdapter->setWidth(400); $imageAdapter->setFontSize(48); $imageAdapter->setDotNoiseLevel(400); $imageAdapter->setLineNoiseLevel(40); $captcha->setCaptcha($imageAdapter); $captcha->setLabel('enter.text.from.the.picture'); $captcha->setAttribute('class', 'form-control'); $this->add($captcha); $agb = new Checkbox('gtcAccept'); $agb->setLabel('accept.terms.of.gtc'); $agb->setAttribute('class', 'form-control'); $agb->setLabelAttributes(['class' => 'checkboxLabel']); $this->add($agb); $submit = new Submit('register'); $submit->setValue('register'); $submit->setAttribute('class', 'btn btn-primary'); $this->add($submit); }
protected function addElements() { $username = new Element\Text('username'); $username->setLabel('Username'); $username->setAttribute('required', 'required'); $this->add($username); $email = new Element\Email('email'); $email->setLabel("Email"); $email->setAttribute('required', 'required'); $this->add($email); $password = new Element\Password('password'); $password->setLabel('password'); $password->setAttribute('required', 'required'); $this->add($password); $remember = new Element\Checkbox('rememberme'); $remember->setLabel('remember me'); $this->add($remember); $submit = new Element\Submit('submit'); $submit->setValue("submit")->setLabel("submit"); $this->add($submit); }
/** * Database form * * @return void */ public function database() { $data = array('pdo_pgsql' => 'PostgreSQL', 'pdo_mysql' => 'MySQL'); $driver = new Element\Select('driver'); $driver->setValueOptions($data)->setLabel('Driver')->setLabelAttributes(array('class' => 'control-label required col-lg-2'))->setAttribute('id', 'driver')->setAttribute('class', 'form-control'); $hostname = new Element\Text('hostname'); $hostname->setValue('localhost')->setAttribute('class', 'form-control')->setAttribute('id', 'hostname')->setLabel('Hostname')->setLabelAttributes(array('class' => 'control-label required col-lg-2')); $username = new Element\Text('username'); $username->setAttribute('type', 'text')->setAttribute('class', 'form-control')->setAttribute('id', 'username')->setLabel('Username')->setLabelAttributes(array('class' => 'control-label required col-lg-2')); $password = new Element\Password('password'); $password->setAttribute('class', 'form-control')->setAttribute('id', 'password')->setLabel('Password')->setLabelAttributes(array('class' => 'control-label required col-lg-2')); $dbname = new Element\Text('dbname'); $dbname->setAttribute('class', 'form-control')->setAttribute('id', 'dbname')->setLabel('Db Name')->setLabelAttributes(array('class' => 'control-label required col-lg-2')); $this->add($driver); $this->add($hostname); $this->add($dbname); $this->add($username); $this->add($password); $inputFilter = $this->getInputFilter(); $inputFilter->add(array('name' => 'driver', 'required' => true, 'validators' => array(array('name' => 'not_empty'))), 'driver'); $inputFilter->add(array('name' => 'hostname', 'required' => true, 'validators' => array(array('name' => 'not_empty'))), 'hostname'); $inputFilter->add(array('name' => 'username', 'required' => true, 'validators' => array(array('name' => 'not_empty'))), 'username'); $inputFilter->add(array('name' => 'password', 'required' => false), 'password'); $inputFilter->add(array('name' => 'dbname', 'required' => true, 'validators' => array(array('name' => 'not_empty'))), 'dbname'); }
public function __construct(EntityRepository $repository) { parent::__construct('signup'); $this->filter = new InputFilter(); $email = new Element\Email('email'); $email->setAttribute('required', true); $email->setAttribute('placeholder', 'Email Address'); $this->add($email); $emailFilter = new Input('email'); $emailFilter->setRequired(true); $emailFilter->getValidatorChain()->attach(new DoctrineValidator\NoObjectExists(array('message' => 'Email address already in use', 'object_repository' => $repository, 'fields' => 'email'))); $this->filter->add($emailFilter); $password = new Element\Password('password'); $password->setAttribute('required', true); $password->setAttribute('placeholder', 'Password'); $this->add($password); $passwordFilter = new Input('password'); $passwordFilter->setRequired(true); $passwordFilter->getFilterChain()->attach(new Filter\StringTrim()); $passwordFilter->getValidatorChain()->attach(new AppValidator\PasswordStrength()); $this->filter->add($passwordFilter); $confirmPassword = new Element\Password('confirmPassword'); $confirmPassword->setAttribute('required', true); $confirmPassword->setAttribute('placeholder', 'Confirm Password'); $this->add($confirmPassword); $confirmPasswordFilter = new Input('confirmPassword'); $confirmPasswordFilter->setRequired(true); $confirmPasswordFilter->getFilterChain()->attach(new Filter\StringTrim()); $confirmPasswordFilter->getValidatorChain()->attach(new Validator\Identical('password')); $this->filter->add($confirmPasswordFilter); $firstName = new Element\Text('firstName'); $firstName->setAttribute('required', true); $firstName->setAttribute('placeholder', 'First Name'); $this->add($firstName); $firstNameFilter = new Input('firstName'); $firstNameFilter->setRequired(true); $firstNameFilter->getFilterChain()->attach(new AppFilter\TitleCase()); $firstNameFilter->getFilterChain()->attach(new Filter\StringTrim()); $firstNameFilter->getFilterChain()->attach(new Filter\StripTags()); $firstNameFilter->getValidatorChain()->attach(new Validator\StringLength(array('max' => 35))); $firstNameFilter->getValidatorChain()->attach(new LocaleValidator\Alpha(array('allowWhiteSpace' => true))); $this->filter->add($firstNameFilter); $lastName = new Element\Text('lastName'); $lastName->setAttribute('required', true); $lastName->setAttribute('placeholder', 'Last Name'); $this->add($lastName); $lastNameFilter = new Input('lastName'); $lastNameFilter->setRequired(true); $lastNameFilter->getFilterChain()->attach(new AppFilter\TitleCase()); $lastNameFilter->getFilterChain()->attach(new Filter\StringTrim()); $lastNameFilter->getFilterChain()->attach(new Filter\StripTags()); $lastNameFilter->getValidatorChain()->attach(new Validator\StringLength(array('max' => 35))); $lastNameFilter->getValidatorChain()->attach(new LocaleValidator\Alpha(array('allowWhiteSpace' => true))); $this->filter->add($lastNameFilter); $street = new Element\Text('street'); $street->setAttribute('required', true); $street->setAttribute('placeholder', 'Street Address'); $this->add($street); $streetFilter = new Input('street'); $streetFilter->setRequired(true); $streetFilter->getFilterChain()->attach(new Filter\StringTrim()); $streetFilter->getFilterChain()->attach(new Filter\StripTags()); $streetFilter->getValidatorChain()->attach(new Validator\StringLength(array('max' => 50))); $this->filter->add($streetFilter); $city = new Element\Text('city'); $city->setAttribute('required', true); $city->setAttribute('placeholder', 'City'); $this->add($city); $cityFilter = new Input('city'); $cityFilter->setRequired(true); $cityFilter->getFilterChain()->attach(new Filter\StringTrim()); $cityFilter->getFilterChain()->attach(new Filter\StripTags()); $cityFilter->getValidatorChain()->attach(new Validator\StringLength(array('max' => 30))); $this->filter->add($cityFilter); $state = new Element\Text('state'); $state->setAttribute('required', true); $state->setAttribute('placeholder', 'State'); $this->add($state); $stateFilter = new Input('state'); $stateFilter->setRequired(true); $stateFilter->getFilterChain()->attach(new Filter\StringTrim()); $stateFilter->getFilterChain()->attach(new Filter\StripTags()); $stateFilter->getFilterChain()->attach(new Filter\StringToUpper()); $stateFilter->getValidatorChain()->attach(new Validator\StringLength(array('min' => 2, 'max' => 2))); $this->filter->add($stateFilter); $postalCode = new Element\Text('postalCode'); $postalCode->setAttribute('required', true); $postalCode->setAttribute('placeholder', 'Postal Code'); $this->add($postalCode); $postalCodeFilter = new Input('postalCode'); $postalCodeFilter->setRequired(true); $postalCodeFilter->getFilterChain()->attach(new Filter\StringTrim()); $postalCodeFilter->getFilterChain()->attach(new Filter\StripTags()); $this->filter->add($postalCodeFilter); $phone = new AppElement\Phone('phone'); $phone->setAttribute('required', true); $phone->setAttribute('placeholder', 'Phone Number'); $this->add($phone); $phoneFilter = new Input('phone'); $phoneFilter->setRequired(true); $this->filter->add($phoneFilter); $website = new Element\Url('website'); $website->setAttribute('placeholder', 'Website'); $this->add($website); $websiteFilter = new Input('website'); $websiteFilter->setRequired(false); $this->filter->add($websiteFilter); $submit = new Element\Submit('submit'); $submit->setAttribute('class', 'btn-primary pull-right'); $submit->setOption('glyphicon', 'user'); $submit->setLabel('Sign Up'); $this->add($submit); }