Browse Source

Déconnexion : gestion redirection

feature/rotating_product
Guillaume Bourgeois 7 months ago
parent
commit
ed91dfb583
2 changed files with 29 additions and 1 deletions
  1. +24
    -1
      frontend/controllers/SiteController.php
  2. +5
    -0
      producer/controllers/SiteController.php

+ 24
- 1
frontend/controllers/SiteController.php View File

@@ -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 View File

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

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

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

Loading…
Cancel
Save