From 42717091bc9d75b770ae1b7ab66c14c1f2637a5d Mon Sep 17 00:00:00 2001 From: Carsten Schmitz Date: Wed, 21 Sep 2016 16:03:01 +0200 Subject: [PATCH] Fixed issue #11586: Window size problem for admin screens Dev Now shows a warning right after login. --- application/core/LSUserIdentity.php | 10 +++++++--- application/helpers/common_helper.php | 1 + application/views/admin/authentication/login.php | 6 +++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/application/core/LSUserIdentity.php b/application/core/LSUserIdentity.php index 78855a9869a..1e0e1d6748d 100644 --- a/application/core/LSUserIdentity.php +++ b/application/core/LSUserIdentity.php @@ -127,8 +127,12 @@ protected function postLogin() // Check for default password if ($this->password === 'password') { - App()->user->setFlash('warning', gT('Warning: You are still using the default password (\'password\'). Please change your password and re-login again.')); - //App()->user->setFlash('pwdnotify', gT('Warning: You are still using the default password (\'password\'). Please change your password and re-login again.')); + Yii::app()->setFlashMessage(gT("Warning: You are still using the default password ('password'). Please change your password and re-login again."),'warning'); + } + + if ((int)App()->request->getPost('width', '1280') < 1280) + { + Yii::app()->setFlashMessage(gT("Your browser screen size is too small to use the administration properly. The minimum size required is 1280*1024 px."),'error'); } // Do session setup @@ -142,7 +146,7 @@ protected function postLogin() Yii::app()->session['session_hash'] = hash('sha256',getGlobalSetting('SessionName').$user->users_name.$user->uid); // Perform language settings - if (App()->request->getPost('loginlang','default') != 'default') + if (App()->request->getPost('loginlang', 'default') != 'default') { $user->lang = sanitize_languagecode(App()->request->getPost('loginlang')); $user->save(); diff --git a/application/helpers/common_helper.php b/application/helpers/common_helper.php index 5b19e810855..c90bd185988 100644 --- a/application/helpers/common_helper.php +++ b/application/helpers/common_helper.php @@ -2624,6 +2624,7 @@ function stripCtrlChars($sValue) } return $sValue; } + // make a string safe to include in a JavaScript String parameter. function javascriptEscape($str, $strip_tags=false, $htmldecode=false) { $new_str =''; diff --git a/application/views/admin/authentication/login.php b/application/views/admin/authentication/login.php index d3e67241f69..8cfd22b1ff2 100644 --- a/application/views/admin/authentication/login.php +++ b/application/views/admin/authentication/login.php @@ -116,6 +116,7 @@

+