Skip to content

Commit

Permalink
refresh page once if user id is not found
Browse files Browse the repository at this point in the history
refresh page once if user id is not found on first session start, i.e. coming back from a closed browser without logging out.
else, if can't find id, send to login.
  • Loading branch information
creecros authored May 16, 2019
1 parent ec57afb commit 4654651
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ public function onStartup()
{
Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale');
$user_id = $this->customizerFileModel->getUserSessionId();

if ($user_id == 0 && $this->configModel->get('customizer_refresh_page', 'no')) {
$this->configModel->save(['customizer_refresh_page' => 'yes']);
$this->response->redirect($this->helper->url->to('DashboardController', 'show'));
} else if ($user_id == 0 && $this->configModel->get('customizer_refresh_page', 'yes')) {
$this->configModel->save(['customizer_refresh_page' => 'no']);
$this->response->redirect($this->helper->url->to('AuthController', 'login'));
} else {
$this->configModel->save(['customizer_refresh_page' => 'no']);
}

$user_theme = $this->userMetadataModel->get($user_id, 'themeSelection', $this->configModel->get('themeSelection', 'plugins/Customizer/Assets/css/theme.css' ));
$default_theme = $this->configModel->get('themeSelection', 'plugins/Customizer/Assets/css/theme.css');
if ($this->configModel->get('toggle_user_themes', 'disable') == 'enable') {
Expand Down Expand Up @@ -151,7 +162,7 @@ public function getPluginAuthor()

public function getPluginVersion()
{
return '1.11.1';
return '1.11.2';
}

public function getPluginHomepage()
Expand Down

0 comments on commit 4654651

Please sign in to comment.