Skip to content

Commit

Permalink
Fixed issue #11586: Window size problem for admin screens
Browse files Browse the repository at this point in the history
Dev Now shows a warning right after login.
  • Loading branch information
c-schmitz committed Sep 21, 2016
1 parent a14d010 commit 4271709
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 7 additions & 3 deletions application/core/LSUserIdentity.php
Expand Up @@ -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
Expand All @@ -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();
Expand Down
1 change: 1 addition & 0 deletions application/helpers/common_helper.php
Expand Up @@ -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 ='';
Expand Down
6 changes: 5 additions & 1 deletion application/views/admin/authentication/login.php
Expand Up @@ -116,6 +116,7 @@
<div class="row login-submit login-content">
<div class="col-lg-12">
<p><input type='hidden' name='action' value='login' />
<input type='hidden' id='width' name='width' value='' />
<button type="submit" class="btn btn-default" name='login_submit' value='login'><?php eT('Log in');?></button><br />
<br/>
<?php
Expand All @@ -138,5 +139,8 @@

<!-- Set focus on user input -->
<script type='text/javascript'>
document.getElementById('user').focus();
$( document ).ready(function() {
$('#user').focus();
$("#width").val($(window).width());
});
</script>

0 comments on commit 4271709

Please sign in to comment.