示例#1
0
 /**
  * Validates this model and creates a new account for the user.
  *
  * @return boolean whether sign-up was successful.
  */
 public function signup()
 {
     if ($this->validate()) {
         $dataContract = Module::getInstance()->getDataContract();
         $account = $dataContract->createAccount(['attributes' => $this->attributes]);
         if ($account->validate()) {
             if ($account->save(false)) {
                 $dataContract->createPasswordHistory(['accountId' => $account->id, 'password' => $account->password]);
                 $auth = Yii::$app->authManager;
                 $authorRole = $auth->getRole('salon');
                 $auth->assign($authorRole, $account->getId());
                 return true;
             }
         }
         foreach ($account->getErrors('password') as $error) {
             $this->addError('password', $error);
         }
         if ($errors = $account->getErrors()) {
             Yii::$app->session->setFlash('registration-errors', $errors);
         }
     }
     return false;
 }
示例#2
0
 /**
  * Creates a password history entry.
  *
  * @param Account $account model instance.
  */
 public function createHistoryEntry(ActiveRecord $account)
 {
     Module::getInstance()->getDataContract()->createPasswordHistory(['accountId' => $account->getPrimaryKey(), 'password' => $account->password]);
 }
示例#3
0
 public function actionIndex()
 {
     $model = Module::getInstance();
     return $this->render('index', ['model' => $model]);
 }
示例#4
0
 /**
  * Returns the account associated with the value of the login attribute.
  *
  * @return Account model instance.
  */
 public function getAccount()
 {
     if ($this->_account === null) {
         $this->_account = Account::findOne([Module::getInstance()->phoneAttribute => $this->phone]);
     }
     return $this->_account;
 }
示例#5
0
            <fieldset>
                <?php 
echo $form->field($model, 'phone')->textInput(['maxlength' => true, 'id' => 'phone', 'placeholder' => "+7 (___) ___-__-__"]);
?>

                <?php 
echo $form->field($model, 'password')->passwordInput();
?>
                <div class="form-group">
                   <label></label><?php 
echo $form->field($model, 'rememberMe')->checkbox();
?>
                </div>
                <div class="form-group">
                    <label></label><?php 
echo Html::submitButton(Module::t('views', 'Войти'), ['class' => 'bt action-button shadow animate blue']);
?>
                </div>
            </fieldset>

             <?php 
ActiveForm::end();
?>

             <div class="box_pass">
                <a href="<?php 
echo Module::URL_ROUTE_FORGOT_PASSWORD;
?>
">Забыли пароль?</a>
                <a style="color: #239910;" href="<?php 
echo Module::URL_ROUTE_SIGNUP;
示例#6
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('labels', 'ID'), 'phone' => Module::t('labels', 'Телефон'), 'username' => Module::t('labels', 'Название салона'), 'password' => Module::t('labels', 'Пароль'), 'authKey' => Module::t('labels', 'Ключ авторизации'), 'email' => Module::t('labels', 'E-mail'), 'lastLoginAt' => Module::t('labels', 'Последний вход'), 'createdAt' => Module::t('labels', 'Дата регистрации'), 'updatedAt' => Module::t('labels', 'Дата изменения'), 'city_name' => Module::t('labels', 'Город'), 'status' => Module::t('labels', 'Статус'), 'url' => Module::t('labels', 'Ссылка на сайт'), 'address' => Module::t('labels', 'Адрес'), 'xy' => Module::t('labels', 'Координаты'), 'balance' => Module::t('labels', 'Баланс'), 'other' => Module::t('labels', 'Прочая информация'), 'place_delivery' => Module::t('labels', 'Место доставки'), 'contract' => Module::t('labels', 'Договор'), 'ContractText' => Module::t('labels', 'Текст договора'), 'Contract_file' => 'Загрузить договор'];
 }
示例#7
0
    echo $form->field($model, 'captcha')->widget($captchaClass, ['captchaAction' => Module::URL_ROUTE_CAPTCHA, 'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-9">{input}</div></div>', 'imageOptions' => ['height' => 35]]);
    ?>

                    <p class="help-block">
                        <?php 
    echo Module::t('views', 'Пожалуйста введите проверочный код');
    ?>
                    </p>
                <?php 
}
?>

                <div class="form-group ">
                    <label class="control-label" for=""></label>
                    <?php 
echo Html::submitButton(Module::t('views', 'Зарегистрироваться'), ['class' => 'bt action-button shadow animate blue']);
?>
                </div>


            </fieldset>

            <?php 
ActiveForm::end();
?>

        </div>
    </div>
     <div class="row" id="box-oplata">
         <p>
             После регистрации Вам <u>бесплатно</u> будет доступно использование списка неблагонадежных клиентов других авто-прокатов, добавленных в базу auto.only3.ru
示例#8
0
 public function attributeLabels()
 {
     return ArrayHelper::merge(parent::attributeLabels(), ['phone' => Module::t('labels', 'Телефон (логин)'), 'email' => Module::t('labels', 'E-mail'), 'url' => Module::t('labels', 'Ссылка на сайт'), 'city_name' => Module::t('labels', 'Город'), 'username' => Module::t('labels', 'Автопрокат'), 'captcha' => Module::t('labels', 'Проверочный код')]);
 }