update multi language login site

CR: sonhh (fake)
This commit is contained in:
2021-09-23 11:38:22 +07:00
parent 61e82f68ca
commit e4829d7f78
7 changed files with 58 additions and 16 deletions

View File

@@ -14,13 +14,6 @@ use yii\helpers\Url;
*/
class DashboardController extends Controller {
public function init() {
parent::init();
if (Yii::$app->user->isGuest) {
return $this->redirect(['/site/login']);
}
}
/**
* {@inheritdoc}
*/
@@ -157,4 +150,12 @@ class DashboardController extends Controller {
}
}
public function actionChangeLanguageLogin($lang) {
$language = \app\models\common::allLanguage();
foreach ($language as $key => $value) {
if ($value['name'] === $lang)
return $this->redirect(['/site/login', 'lang' => $lang]);
}
}
}