瀏覽代碼

Déconnexion : gestion redirection

feature/rotating_product
Guillaume Bourgeois 7 月之前
父節點
當前提交
ed91dfb583
共有 2 個檔案被更改,包括 29 行新增1 行删除
  1. +24
    -1
      frontend/controllers/SiteController.php
  2. +5
    -0
      producer/controllers/SiteController.php

+ 24
- 1
frontend/controllers/SiteController.php 查看文件

@@ -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 查看文件

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

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

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

Loading…
取消
儲存