Ver código fonte

Déconnexion : gestion redirection

feature/rotating_product
Guillaume Bourgeois 7 meses atrás
pai
commit
ed91dfb583
2 arquivos alterados com 29 adições e 1 exclusões
  1. +24
    -1
      frontend/controllers/SiteController.php
  2. +5
    -0
      producer/controllers/SiteController.php

+ 24
- 1
frontend/controllers/SiteController.php Ver arquivo

@@ -299,7 +299,30 @@ class SiteController extends FrontendController
{
\Yii::$app->user->logout();

return $this->goHome();
$referer = Yii::$app->request->referrer ?: Yii::$app->homeUrl;

$authenticatedActions = [
// frontend
'user/update',

// producer
'order/order',
'order/history',
'subscription/index',
'subscription/form',
'credit/history',
'credit/add',
'newsletter/index'
];

foreach($authenticatedActions as $authenticatedAction) {
$pos = strpos($referer, $authenticatedAction);
if($pos !== false) {
$referer = substr($referer, 0, $pos);
}
}

return $this->redirect($referer);
}

/**

+ 5
- 0
producer/controllers/SiteController.php Ver arquivo

@@ -66,6 +66,11 @@ class SiteController extends ProducerBaseController
];
}

/*public function actionLogin()
{
//return
}*/

/**
* Affiche et gère les erreurs.
*/

Carregando…
Cancelar
Salvar