Exemplo n.º 1
0
 /**
  * Get login form
  *
  * @return \Magelight\Webform\Blocks\Form
  */
 public function getLoginForm()
 {
     $form = Form::forge()->setHorizontal()->setConfigs('remindpass-form', $this->url(\Magelight\Config::getInstance()->getConfigString('global/auth/urls/login_url')));
     $fieldset = Fieldset::forge();
     $fieldset->addRowField(Elements\Input::forge()->setName('email'), __('E-Mail'));
     $fieldset->addRowField(Elements\PasswordInput::forge()->setName('password'), __('Password'));
     return $form->addFieldset($fieldset)->createResultRow(true)->addButtonsRow([Elements\Button::forge()->setContent(__('Enter'))->addClass('btn-primary'), Elements\Abstraction\Element::forge()->setTag('a')->setAttribute('href', $this->url('auth/remindpass'))->setContent(__('Remind password'))->setClass('btn')])->loadFromRequest(\Magelight\Http\Request::getInstance())->setValidator($this->getLoginFormValidator());
 }
Exemplo n.º 2
0
 /**
  * Get for for password recovery page
  *
  * @return \Magelight\Webform\Blocks\Form
  */
 public function getForgotPasswordForm()
 {
     $form = Form::forge()->setHorizontal()->setConfigs('remindpass-form', $this->url(\Magelight\Config::getInstance()->getConfigString('global/auth/urls/forgot_password_url')));
     $fieldset = Fieldset::forge();
     $fieldset->addRowField(Elements\Input::forge()->setName('email'), __('E-Mail', [], 1, 'default'));
     $validator = \Magelight\Webform\Models\Validator::forge();
     $validator->fieldRules('email')->required()->setCustomError(__("Please enter a valid e-mail!", 1))->chainRule()->email()->setCustomError(__("Please enter a valid e-mail!", 1));
     return $form->addFieldset($fieldset)->createResultRow(true)->addButtonsRow([Elements\Button::forge()->setContent(__('Send new password'))->addClass('btn-primary')])->loadFromRequest()->setValidator($validator)->validateOnFront();
 }
Exemplo n.º 3
0
 /**
  * Get sample form
  *
  * @return Form
  */
 public function getSampleForm()
 {
     $form = Form::forge()->setHorizontal()->setConfigs('sample', $this->url('sample/form'));
     $fieldset = Fieldset::forge();
     $fieldset->setLegend('Register new user');
     $fieldset->addRowField(Elements\Input::forge()->setName('name'), __('Name'));
     $fieldset->addRowField(Elements\Input::forge()->setName('email'), __('E-Mail'));
     $fieldset->addRowField(Elements\PasswordInput::forge()->setName('password'), __('Password'));
     $fieldset->addRowField(Elements\Captcha::forge($this->url(\Magelight\Config::getInstance()->getConfigString('global/auth/urls/render_captcha_url')))->setName('captcha')->addClass('col-md-6'), __('Enter protection code'));
     return $form->addFieldset($fieldset)->createResultRow(true)->addButtonsRow(Elements\Button::forge()->setContent(__('Register'))->addClass('btn-primary'))->loadFromRequest()->setValidator($this->getSampleFormValidator())->validateOnFront();
 }