|
|
@ -30,6 +30,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
define('IN_SCRIPT', 1);
|
|
|
|
define('IN_SCRIPT', 1);
|
|
|
|
define('HESK_PATH', '../');
|
|
|
|
define('HESK_PATH', '../');
|
|
|
|
|
|
|
|
define('PAGE_TITLE', 'LOGIN');
|
|
|
|
|
|
|
|
|
|
|
|
/* Get all the required files and functions */
|
|
|
|
/* Get all the required files and functions */
|
|
|
|
require(HESK_PATH . 'hesk_settings.inc.php');
|
|
|
|
require(HESK_PATH . 'hesk_settings.inc.php');
|
|
|
@ -58,9 +59,6 @@ switch ($action) {
|
|
|
|
hesk_autoLogin();
|
|
|
|
hesk_autoLogin();
|
|
|
|
print_login();
|
|
|
|
print_login();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Print footer */
|
|
|
|
|
|
|
|
require_once(HESK_PATH . 'inc/footer.inc.php');
|
|
|
|
|
|
|
|
exit();
|
|
|
|
exit();
|
|
|
|
|
|
|
|
|
|
|
|
/*** START FUNCTIONS ***/
|
|
|
|
/*** START FUNCTIONS ***/
|
|
|
@ -274,7 +272,7 @@ function print_login()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' .$hesklang['admin_login'];
|
|
|
|
$hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' .$hesklang['admin_login'];
|
|
|
|
require_once(HESK_PATH . 'inc/header.inc.php');
|
|
|
|
require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
|
|
|
|
|
|
|
|
|
|
|
|
if ( hesk_isREQUEST('notice') )
|
|
|
|
if ( hesk_isREQUEST('notice') )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -287,28 +285,33 @@ function print_login()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<div class="loginError"><?php
|
|
|
|
<div class="login-box">
|
|
|
|
|
|
|
|
<div class="login-logo">
|
|
|
|
|
|
|
|
<?php echo $hesklang['staff_login_title']; ?>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="login-box-body">
|
|
|
|
|
|
|
|
<div class="loginError">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
/* This will handle error, success and notice messages */
|
|
|
|
/* This will handle error, success and notice messages */
|
|
|
|
hesk_handle_messages();
|
|
|
|
hesk_handle_messages();
|
|
|
|
?></div>
|
|
|
|
?>
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<div class="panel panel-default form-signin">
|
|
|
|
|
|
|
|
<div class="panel-heading">
|
|
|
|
|
|
|
|
<h4><span <?php echo $iconDisplay; ?>><span class="mega-octicon octicon-sign-in"></span> </span><?php echo $hesklang['admin_login']; ?></h4>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<form class="form-horizontal" role="form" action="index.php" method="post" name="form1">
|
|
|
|
<form class="form-signin form-horizontal" role="form" action="index.php" method="post" name="form1">
|
|
|
|
<?php
|
|
|
|
<?php if (in_array('pass',$_SESSION['a_iserror'])) { echo '<div class="form-group has-error">';} else { echo '<div class="form-group">';}?>
|
|
|
|
$has_error = '';
|
|
|
|
<label for="user" class="col-sm-4 control-label"><?php echo $hesklang['username']; ?>:</label>
|
|
|
|
if (in_array('pass',$_SESSION['a_iserror'])) {
|
|
|
|
|
|
|
|
$has_error = 'has-error';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="form-group <?php echo $has_error; ?>">
|
|
|
|
|
|
|
|
<label for="user" class="col-sm-4 control-label">
|
|
|
|
|
|
|
|
<?php echo $hesklang['username']; ?>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
if (defined('HESK_USER')) {
|
|
|
|
if (defined('HESK_USER'))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$savedUser = HESK_USER;
|
|
|
|
$savedUser = HESK_USER;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$savedUser = hesk_htmlspecialchars(hesk_COOKIE('hesk_username'));
|
|
|
|
$savedUser = hesk_htmlspecialchars(hesk_COOKIE('hesk_username'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -318,42 +321,46 @@ function print_login()
|
|
|
|
|
|
|
|
|
|
|
|
$remember_user = hesk_POST('remember_user');
|
|
|
|
$remember_user = hesk_POST('remember_user');
|
|
|
|
|
|
|
|
|
|
|
|
if ($hesk_settings['autologin'] && (isset($_COOKIE['hesk_p']) || $remember_user == 'AUTOLOGIN') )
|
|
|
|
if ($hesk_settings['autologin'] && (isset($_COOKIE['hesk_p']) || $remember_user == 'AUTOLOGIN')) {
|
|
|
|
{
|
|
|
|
$is_1 = 'checked';
|
|
|
|
$is_1 = 'checked="checked"';
|
|
|
|
} elseif (isset($_COOKIE['hesk_username']) || $remember_user == 'JUSTUSER') {
|
|
|
|
}
|
|
|
|
$is_2 = 'checked';
|
|
|
|
elseif (isset($_COOKIE['hesk_username']) || $remember_user == 'JUSTUSER' )
|
|
|
|
} else {
|
|
|
|
{
|
|
|
|
$is_3 = 'checked';
|
|
|
|
$is_2 = 'checked="checked"';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$is_3 = 'checked="checked"';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($hesk_settings['list_users'])
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
echo '<select class="form-control" name="user">';
|
|
|
|
|
|
|
|
$res = hesk_dbQuery('SELECT `user` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'users` ORDER BY `user` ASC');
|
|
|
|
|
|
|
|
while ($row=hesk_dbFetchAssoc($res))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$sel = (strtolower($savedUser) == strtolower($row['user'])) ? 'selected="selected"' : '';
|
|
|
|
|
|
|
|
echo '<option value="'.$row['user'].'" '.$sel.'>'.$row['user'].'</option>';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo '</select>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
if ($hesk_settings['list_users']) :
|
|
|
|
else
|
|
|
|
$res = hesk_dbQuery("SELECT `user` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `active` = '1' ORDER BY `user` ASC");
|
|
|
|
{
|
|
|
|
|
|
|
|
echo '<input class="form-control" type="text" name="user" size="35" placeholder="'.htmlspecialchars($hesklang['username']).'" value="'.$savedUser.'" />';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
|
|
|
|
<select class="form-control" name="user">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
while ($row = hesk_dbFetchAssoc($res)):
|
|
|
|
|
|
|
|
$sel = (strtolower($savedUser) == strtolower($row['user'])) ? 'selected' : '';
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<option value="<?php echo $row['user']; ?>" <?php echo $sel; ?>>
|
|
|
|
|
|
|
|
<?php echo $row['user']; ?>
|
|
|
|
|
|
|
|
</option>
|
|
|
|
|
|
|
|
<?php endwhile; ?>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
|
|
|
<input class="form-control" type="text" name="user" size="35"
|
|
|
|
|
|
|
|
placeholder="<?php echo htmlspecialchars($hesklang['username']); ?>"
|
|
|
|
|
|
|
|
value="<?php echo $savedUser; ?>">
|
|
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php if (in_array('pass',$_SESSION['a_iserror'])) { echo '<div class="form-group has-error">';} else { echo '<div class="form-group">';}?>
|
|
|
|
<?php
|
|
|
|
<label for="pass" class="col-sm-4 control-label"><?php echo $hesklang['pass']; ?>:</label>
|
|
|
|
$has_error = '';
|
|
|
|
|
|
|
|
if (in_array('pass',$_SESSION['a_iserror'])) {
|
|
|
|
|
|
|
|
$has_error = 'has-error';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="form-group <?php echo $has_error; ?>">
|
|
|
|
|
|
|
|
<label for="pass" class="col-sm-4 control-label">
|
|
|
|
|
|
|
|
<?php echo $hesklang['pass']; ?>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input type="password" class="form-control" id="pass" name="pass" size="35" placeholder="<?php echo htmlspecialchars($hesklang['pass']); ?>" />
|
|
|
|
<input type="password" class="form-control" id="pass" name="pass" size="35" placeholder="<?php echo htmlspecialchars($hesklang['pass']); ?>">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
@ -410,9 +417,9 @@ function print_login()
|
|
|
|
echo '<div class="form-group"><div class="col-md-8 col-md-offset-4">';
|
|
|
|
echo '<div class="form-group"><div class="col-md-8 col-md-offset-4">';
|
|
|
|
$cls = in_array('mysecnum',$_SESSION['a_iserror']) ? ' class="isError" ' : '';
|
|
|
|
$cls = in_array('mysecnum',$_SESSION['a_iserror']) ? ' class="isError" ' : '';
|
|
|
|
|
|
|
|
|
|
|
|
echo $hesklang['sec_enter'].'<br /> <br /><img src="'.HESK_PATH.'print_sec_img.php?'.rand(10000,99999).'" width="150" height="40" alt="'.$hesklang['sec_img'].'" title="'.$hesklang['sec_img'].'" border="1" name="secimg" style="vertical-align:text-bottom" /> '.
|
|
|
|
echo $hesklang['sec_enter'].'<br><br><img src="'.HESK_PATH.'print_sec_img.php?'.rand(10000,99999).'" width="150" height="40" alt="'.$hesklang['sec_img'].'" title="'.$hesklang['sec_img'].'" border="1" name="secimg" style="vertical-align:text-bottom"> '.
|
|
|
|
'<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\''.HESK_PATH.'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="'.HESK_PATH.'img/reload.png" height="24" width="24" alt="'.$hesklang['reload'].'" title="'.$hesklang['reload'].'" border="0" style="vertical-align:text-bottom" /></a>'.
|
|
|
|
'<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\''.HESK_PATH.'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="'.HESK_PATH.'img/reload.png" height="24" width="24" alt="'.$hesklang['reload'].'" title="'.$hesklang['reload'].'" border="0" style="vertical-align:text-bottom"></a>'.
|
|
|
|
'<br /> <br /><input type="text" name="mysecnum" size="20" maxlength="5" '.$cls.' />';
|
|
|
|
'<br><br><input type="text" name="mysecnum" size="20" maxlength="5" '.$cls.'>';
|
|
|
|
echo '</div></div>';
|
|
|
|
echo '</div></div>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // End if $hesk_settings['secimg_use'] == 2
|
|
|
|
} // End if $hesk_settings['secimg_use'] == 2
|
|
|
@ -423,13 +430,13 @@ function print_login()
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-offset-4 col-md-8">
|
|
|
|
<div class="col-md-offset-4 col-md-8">
|
|
|
|
<div class="radio">
|
|
|
|
<div class="radio">
|
|
|
|
<label><input type="radio" name="remember_user" value="AUTOLOGIN" <?php echo $is_1; ?> /> <?php echo $hesklang['autologin']; ?></label>
|
|
|
|
<label><input type="radio" name="remember_user" value="AUTOLOGIN" <?php echo $is_1; ?>> <?php echo $hesklang['autologin']; ?></label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="radio">
|
|
|
|
<div class="radio">
|
|
|
|
<label><input type="radio" name="remember_user" value="JUSTUSER" <?php echo $is_2; ?> /> <?php echo $hesklang['just_user']; ?></label>
|
|
|
|
<label><input type="radio" name="remember_user" value="JUSTUSER" <?php echo $is_2; ?>> <?php echo $hesklang['just_user']; ?></label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="radio">
|
|
|
|
<div class="radio">
|
|
|
|
<label><input type="radio" name="remember_user" value="NOTHANKS" <?php echo $is_3; ?> /> <?php echo $hesklang['nothx']; ?></label>
|
|
|
|
<label><input type="radio" name="remember_user" value="NOTHANKS" <?php echo $is_3; ?>> <?php echo $hesklang['nothx']; ?></label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -450,35 +457,28 @@ function print_login()
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-md-offset-4 col-md-8">
|
|
|
|
<div class="col-md-offset-4 col-md-8">
|
|
|
|
<input type="submit" value="<?php echo $hesklang['click_login']; ?>" class="btn btn-default" />
|
|
|
|
<input type="submit" value="<?php echo $hesklang['click_login']; ?>" class="btn btn-default">
|
|
|
|
<input type="hidden" name="a" value="do_login" />
|
|
|
|
<input type="hidden" name="a" value="do_login">
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
if ( hesk_isREQUEST('goto') && $url=hesk_REQUEST('goto') )
|
|
|
|
if ( hesk_isREQUEST('goto') && $url=hesk_REQUEST('goto') )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
echo '<input type="hidden" name="goto" value="'.$url.'" />';
|
|
|
|
echo '<input type="hidden" name="goto" value="'.$url.'">';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Do we allow staff password reset?
|
|
|
|
// Do we allow staff password reset?
|
|
|
|
if ($hesk_settings['reset_pass'])
|
|
|
|
if ($hesk_settings['reset_pass'])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
echo '<br /> <br /><a href="password.php" class="smaller">'.$hesklang['fpass'].'</a>';
|
|
|
|
echo '<br><br><a href="password.php" class="smaller">'.$hesklang['fpass'].'</a>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
hesk_cleanSessionVars('a_iserror');
|
|
|
|
hesk_cleanSessionVars('a_iserror');
|
|
|
|
|
|
|
|
|
|
|
|
require_once(HESK_PATH . 'inc/footer.inc.php');
|
|
|
|
|
|
|
|
exit();
|
|
|
|
exit();
|
|
|
|
} // End print_login()
|
|
|
|
} // End print_login()
|
|
|
|
|
|
|
|
|
|
|
|