Pārlūkot izejas kodu

Oubli modif : User::STATUS_BOULANGER devient User::STATUS_PRODUCER

dev
Guillaume Bourgeois pirms 6 gadiem
vecāks
revīzija
00a9cca6c1
6 mainītis faili ar 9 papildinājumiem un 9 dzēšanām
  1. +2
    -1
      backend/controllers/CommunicateController.php
  2. +3
    -4
      backend/controllers/PointVenteController.php
  3. +1
    -1
      common/mail/signup-html.php
  4. +1
    -1
      common/mail/signup-text.php
  5. +1
    -1
      common/models/User.php
  6. +1
    -1
      frontend/models/SignupForm.php

+ 2
- 1
backend/controllers/CommunicateController.php Parādīt failu

@@ -39,6 +39,7 @@ termes.
namespace backend\controllers;

use common\models\Producer ;
use common\models\User ;

/**
* UserController implements the CRUD actions for User model.
@@ -61,7 +62,7 @@ class CommunicateController extends BackendController
'allow' => true,
'roles' => ['@'],
'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN || Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
return User::hasAccessBackend();
}
]
],

+ 3
- 4
backend/controllers/PointVenteController.php Parādīt failu

@@ -40,13 +40,13 @@ namespace backend\controllers;

use Yii;
use yii\filters\AccessControl;
use common\models\PointVente;
use common\models\PointSale;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use common\models\User;
use common\models\PointVenteUser;
use common\models\UserPointSale;

/**
* PointVenteController implements the CRUD actions for PointVente model.
@@ -69,8 +69,7 @@ class PointVenteController extends BackendController
'allow' => true,
'roles' => ['@'],
'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
return User::hasAccessBackend();
}
],
],

+ 1
- 1
common/mail/signup-html.php Parādīt failu

@@ -49,7 +49,7 @@ use common\helpers\Url ;
<p>Voici votre identifiant de connexion : <br />
<strong><?= Html::encode($user->email) ?></strong></p>

<?php if($user->status == User::STATUS_BOULANGER): ?>
<?php if($user->status == User::STATUS_PRODUCER): ?>
<p>Vous pouvez dès maintenant vous connecter à votre <a href="<?= Url::backend(); ?>">Espace boulanger</a> pour mettre
en place votre système de réservation.</p>
<?php else: ?>

+ 1
- 1
common/mail/signup-text.php Parādīt failu

@@ -48,7 +48,7 @@ Votre inscription sur La boîte à pain a bien été prise en compte.
Voici votre identifiant de connexion :
<?= $user->email ?>

<?php if($user->status == User::STATUS_BOULANGER): ?>
<?php if($user->status == User::STATUS_PRODUCER): ?>
Vous pouvez dès maintenant vous connecter à votre Espace boulanger pour mettre en place votre système de réservation :
<?= Url::backend(); ?>
<?php else: ?>

+ 1
- 1
common/models/User.php Parādīt failu

@@ -101,7 +101,7 @@ class User extends ActiveRecordCommon implements IdentityInterface
['email', 'email', 'message' => 'Cette adresse email n\'est pas valide'],
['email', 'verifyEmail'],
['status', 'default', 'value' => self::STATUS_ACTIVE],
['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED, self::STATUS_ADMIN, self::STATUS_BOULANGER]],
['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED, self::STATUS_ADMIN, self::STATUS_PRODUCER]],
['password_old', 'verifyPasswordOld'],
['password_new', 'verifyPasswordNew'],
['password_new_confirm', 'verifyPasswordNewConfirm'],

+ 1
- 1
frontend/models/SignupForm.php Parādīt failu

@@ -243,7 +243,7 @@ class SignupForm extends Model

// user
$user->id_etablissement = $etablissement->id;
$user->status = User::STATUS_BOULANGER;
$user->status = User::STATUS_PRODUCER;

// envoi d'un email à l'administrateur pour le prévenir
Yii::$app->mailer->compose(

Notiek ielāde…
Atcelt
Saglabāt