Browse Source

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

dev
Guillaume Bourgeois 6 years ago
parent
commit
00a9cca6c1
6 changed files with 9 additions and 9 deletions
  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 View File

namespace backend\controllers; namespace backend\controllers;


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


/** /**
* UserController implements the CRUD actions for User model. * UserController implements the CRUD actions for User model.
'allow' => true, 'allow' => true,
'roles' => ['@'], 'roles' => ['@'],
'matchCallback' => function ($rule, $action) { '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 View File



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


/** /**
* PointVenteController implements the CRUD actions for PointVente model. * PointVenteController implements the CRUD actions for PointVente model.
'allow' => true, 'allow' => true,
'roles' => ['@'], 'roles' => ['@'],
'matchCallback' => function ($rule, $action) { '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 View File

<p>Voici votre identifiant de connexion : <br /> <p>Voici votre identifiant de connexion : <br />
<strong><?= Html::encode($user->email) ?></strong></p> <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 <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> en place votre système de réservation.</p>
<?php else: ?> <?php else: ?>

+ 1
- 1
common/mail/signup-text.php View File

Voici votre identifiant de connexion : Voici votre identifiant de connexion :
<?= $user->email ?> <?= $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 : Vous pouvez dès maintenant vous connecter à votre Espace boulanger pour mettre en place votre système de réservation :
<?= Url::backend(); ?> <?= Url::backend(); ?>
<?php else: ?> <?php else: ?>

+ 1
- 1
common/models/User.php View File

['email', 'email', 'message' => 'Cette adresse email n\'est pas valide'], ['email', 'email', 'message' => 'Cette adresse email n\'est pas valide'],
['email', 'verifyEmail'], ['email', 'verifyEmail'],
['status', 'default', 'value' => self::STATUS_ACTIVE], ['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_old', 'verifyPasswordOld'],
['password_new', 'verifyPasswordNew'], ['password_new', 'verifyPasswordNew'],
['password_new_confirm', 'verifyPasswordNewConfirm'], ['password_new_confirm', 'verifyPasswordNewConfirm'],

+ 1
- 1
frontend/models/SignupForm.php View File



// user // user
$user->id_etablissement = $etablissement->id; $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 // envoi d'un email à l'administrateur pour le prévenir
Yii::$app->mailer->compose( Yii::$app->mailer->compose(

Loading…
Cancel
Save