Saving properly works, login page updated
This commit is contained in:
parent
3a8d69b061
commit
57f9fdec63
@ -3815,7 +3815,7 @@ $modsForHesk_settings = mfh_getSettings();
|
|||||||
<input title="LOGIN BACKGROUND COLOR" type="file" name="login-background-image" style="display: inline;vertical-align: bottom" <?php if ($modsForHesk_settings['login_background_type'] == 'color') { echo 'disabled'; } ?>>
|
<input title="LOGIN BACKGROUND COLOR" type="file" name="login-background-image" style="display: inline;vertical-align: bottom" <?php if ($modsForHesk_settings['login_background_type'] == 'color') { echo 'disabled'; } ?>>
|
||||||
<?php if ($modsForHesk_settings['login_background_type'] == 'image'): ?>
|
<?php if ($modsForHesk_settings['login_background_type'] == 'image'): ?>
|
||||||
<br>
|
<br>
|
||||||
<img src="../<?php echo $hesk_settings['cache_dir']; ?>/login-background/<?php echo $modsForHesk_settings['login_background']; ?>" alt="Login Background" height="125" width="125" class="push-down-10">
|
<img src="../<?php echo $hesk_settings['cache_dir']; ?>/lb_<?php echo $modsForHesk_settings['login_background']; ?>" alt="Login Background" height="125" width="125" class="push-down-10">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$('input[name="login-background-color"]').colorpicker({
|
$('input[name="login-background-color"]').colorpicker({
|
||||||
|
@ -500,7 +500,7 @@ $set['login_background_type'] = hesk_input(hesk_POST('login-background'));
|
|||||||
|
|
||||||
$changedBackground = false;
|
$changedBackground = false;
|
||||||
if ($set['login_background_type'] == 'color') {
|
if ($set['login_background_type'] == 'color') {
|
||||||
unlink($hesk_settings['cache_dir'] . '/' . $set['login_background']);
|
unlink($hesk_settings['cache_dir'] . '/lb_' . $set['login_background']);
|
||||||
$set['login_background'] = hesk_input(hesk_POST('login-background-color'));
|
$set['login_background'] = hesk_input(hesk_POST('login-background-color'));
|
||||||
if ($set['login_background'] == '') {
|
if ($set['login_background'] == '') {
|
||||||
$set['login_background'] = '#d2d6de';
|
$set['login_background'] = '#d2d6de';
|
||||||
@ -520,25 +520,22 @@ if ($set['login_background_type'] == 'color') {
|
|||||||
if ($file_size > $hesk_settings['attachments']['max_size']) {
|
if ($file_size > $hesk_settings['attachments']['max_size']) {
|
||||||
return hesk_fileError(sprintf($hesklang['file_too_large'], $file_name));
|
return hesk_fileError(sprintf($hesklang['file_too_large'], $file_name));
|
||||||
}
|
}
|
||||||
|
$ext = strtolower(strrchr($file_name, "."));
|
||||||
|
|
||||||
if (file_exists($hesk_settings['cache_dir'] . '/login-background/' . $set['login_background'])) {
|
if (file_exists($hesk_settings['cache_dir'] . '/lb_' . $set['login_background'])) {
|
||||||
unlink($hesk_settings['cache_dir'] . '/login-background/' . $set['login_background']);
|
unlink($hesk_settings['cache_dir'] . '/lb_' . $set['login_background']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$useChars = 'AEUYBDGHJLMNPQRSTVWXZ123456789';
|
$saved_name = 'login-background' . $ext;
|
||||||
$tmp = uniqid();
|
|
||||||
for ($j = 1; $j < 10; $j++) {
|
|
||||||
$tmp .= $useChars{mt_rand(0, 29)};
|
|
||||||
}
|
|
||||||
|
|
||||||
$file_to_move = $_FILES['login-background-image']['tmp_name'];
|
$file_to_move = $_FILES['login-background-image']['tmp_name'];
|
||||||
|
|
||||||
|
|
||||||
if (!move_uploaded_file($file_to_move, dirname(dirname(__FILE__)) . '/' . $hesk_settings['cache_dir'] . '/login-background/' . $file_name)) {
|
if (!move_uploaded_file($file_to_move, dirname(dirname(__FILE__)) . '/' . $hesk_settings['cache_dir'] . '/lb_' . $saved_name)) {
|
||||||
hesk_error($hesklang['cannot_move_tmp']);
|
hesk_error($hesklang['cannot_move_tmp']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$set['login_background'] = $file_name;
|
$set['login_background'] = $saved_name;
|
||||||
$changedBackground = true;
|
$changedBackground = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,9 +269,8 @@ function print_login()
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="login-box">
|
<div class="login-box">
|
||||||
<div class="login-logo">
|
<div class="login-box-container">
|
||||||
<?php echo $hesk_settings['hesk_title']; ?>
|
<div class="login-box-background"></div>
|
||||||
</div>
|
|
||||||
<div class="login-box-body">
|
<div class="login-box-body">
|
||||||
<div class="loginError">
|
<div class="loginError">
|
||||||
<?php
|
<?php
|
||||||
@ -279,6 +278,9 @@ function print_login()
|
|||||||
hesk_handle_messages();
|
hesk_handle_messages();
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="login-logo">
|
||||||
|
<?php echo $hesk_settings['hesk_title']; ?>
|
||||||
|
</div>
|
||||||
<h4 class="login-box-msg">
|
<h4 class="login-box-msg">
|
||||||
<?php echo $hesklang['staff_login_title']; ?>
|
<?php echo $hesklang['staff_login_title']; ?>
|
||||||
</h4>
|
</h4>
|
||||||
@ -462,6 +464,7 @@ function print_login()
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<?php
|
<?php
|
||||||
hesk_cleanSessionVars('a_iserror');
|
hesk_cleanSessionVars('a_iserror');
|
||||||
|
|
||||||
|
@ -178,8 +178,36 @@ button.dropdown-submit {
|
|||||||
min-width: 350px;
|
min-width: 350px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.login-box-container {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-box-background {
|
||||||
|
/* Absolutely position it, but stretch it to all four corners, then put it just behind #search's z-index */
|
||||||
|
/* background is handled in the header logic */
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 99;
|
||||||
|
|
||||||
|
/* Pull the background 70px higher to the same place as #bg's */
|
||||||
|
/*background-position: center -70px;*/
|
||||||
|
|
||||||
|
-webkit-filter: blur(10px);
|
||||||
|
/*filter: url('/media/blur.svg#blur');*/
|
||||||
|
filter: blur(10px);
|
||||||
|
}
|
||||||
|
|
||||||
.login-box-body {
|
.login-box-body {
|
||||||
|
position: relative;
|
||||||
|
box-shadow: 0 0 50px 5px rgba(0,0,0,0.3),
|
||||||
|
0 0 5px -1px white;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
background: rgba(255, 255, 255, .75);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-link {
|
.button-link {
|
||||||
|
@ -90,11 +90,26 @@ $modsForHesk_settings = mfh_getSettings();
|
|||||||
color: <?php echo $modsForHesk_settings['questionMarkColor']; ?>;
|
color: <?php echo $modsForHesk_settings['questionMarkColor']; ?>;
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php if (defined('PAGE_TITLE') && PAGE_TITLE == 'LOGIN'): ?>
|
<?php
|
||||||
|
if (defined('PAGE_TITLE') && PAGE_TITLE == 'LOGIN'):
|
||||||
|
if ($modsForHesk_settings['login_background_type'] == 'color'):
|
||||||
|
?>
|
||||||
body {
|
body {
|
||||||
background: <?php echo $modsForHesk_settings['login_background']; ?>;
|
background: <?php echo $modsForHesk_settings['login_background']; ?>;
|
||||||
}
|
}
|
||||||
<?php endif; ?>
|
<?php else: ?>
|
||||||
|
body {
|
||||||
|
background: url('<?php echo HESK_PATH . 'cache/lb_' . $modsForHesk_settings['login_background']; ?>')
|
||||||
|
no-repeat center center fixed;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-box-background {
|
||||||
|
background: url('<?php echo HESK_PATH . 'cache/lb_' . $modsForHesk_settings['login_background']; ?>')
|
||||||
|
no-repeat center center fixed;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
<?php endif; endif; ?>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
Loading…
x
Reference in New Issue
Block a user