|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
\Yii::$app->user->logout(); |
|
|
\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); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |