Преглед на файлове

[Frontend] Inscription : captcha

refactoring
Guillaume преди 2 години
родител
ревизия
0a421a7043
променени са 3 файла, в които са добавени 12 реда и са изтрити 9 реда
  1. +2
    -2
      frontend/controllers/SiteController.php
  2. +4
    -1
      frontend/models/SignupForm.php
  3. +6
    -6
      frontend/views/site/signup.php

+ 2
- 2
frontend/controllers/SiteController.php Целия файл

@@ -250,7 +250,7 @@ class SiteController extends FrontendController
public function actionSignup()
{
$model = new SignupForm();
/*if ($model->load(Yii::$app->request->post())) {
if ($model->load(Yii::$app->request->post())) {
$user = $model->signup();
if ($user) {
if (Yii::$app->getUser()->login($user)) {
@@ -266,7 +266,7 @@ class SiteController extends FrontendController
}
}
}
}*/
}

// liste des établissements disponibles
$producersArray = Producer::getProducerPopulateDropdown();

+ 4
- 1
frontend/models/SignupForm.php Целия файл

@@ -69,6 +69,7 @@ class SignupForm extends Model
public $type;
public $free_price ;
public $id_tax_rate_default ;
public $verifyCode;

/**
* @inheritdoc
@@ -186,7 +187,8 @@ class SignupForm extends Model
['free_price', 'number'],
['id_tax_rate_default', 'exist',
'targetClass' => TaxRate::className(),
'targetAttribute' => ['id_tax_rate_default' => 'id']]
'targetAttribute' => ['id_tax_rate_default' => 'id']],
['verifyCode', 'captcha', 'message' => 'Veuillez recopier le code de vérification'],
];
}
@@ -209,6 +211,7 @@ class SignupForm extends Model
'type' => 'Type de producteur',
'free_price' => 'Prix libre',
'id_tax_rate_default' => 'TVA par défaut',
'verifyCode' => 'Code de vérification',
];
}


+ 6
- 6
frontend/views/site/signup.php Целия файл

@@ -52,9 +52,7 @@ $this->params['breadcrumbs'][] = $this->title;

<h1 class="title-system-order"><span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;<?= Html::encode($this->title) ?></h1>

<div class="alert alert-warning">Inscription momentanément désactivée</div>

<!--<div class="row">
<div class="row">
<div class="col-lg-5">
<?php if(YII_ENV == 'demo'): ?>
<div class="alert alert-warning">
@@ -107,15 +105,17 @@ $this->params['breadcrumbs'][] = $this->title;
</div>
</div>

<?= $form->field($model, 'verifyCode')->widget(\yii\captcha\Captcha::className(), [
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
]) ?>

<div class="form-group" id="buttons-signup">
<?= Html::submitButton("S'inscrire", ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?>
</div>
<?php ActiveForm::end(); ?>
<?php endif; ?>
</div>
</div>-->
</div>
</div>

<!-- CGV -->

Loading…
Отказ
Запис