#110 Update user management / profile pages
This commit is contained in:
parent
f291aa4f67
commit
bdf44e0a16
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,7 +15,6 @@ download_attachment.php
|
||||
file_limits.php
|
||||
footer.txt
|
||||
header.txt
|
||||
hesk_javascript_v25.js
|
||||
hesk_settings.inc.php
|
||||
img/add_article.png
|
||||
img/add_category.png
|
||||
@ -274,5 +273,4 @@ img/ico_tools.png
|
||||
inc/recaptcha/recaptchalib_v2.php
|
||||
ip_whois.php
|
||||
language/en/emails/reset_password.txt
|
||||
language/en/help_files/ticket_list.html
|
||||
hesk_javascript.js
|
||||
language/en/help_files/ticket_list.html
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*******************************************************************************
|
||||
* Title: Help Desk Software HESK
|
||||
* Version: 2.5.5 from 5th August 2014
|
||||
* Version: 2.6.0 beta 1 from 30th December 2014
|
||||
* Author: Klemen Stirn
|
||||
* Website: http://www.hesk.com
|
||||
********************************************************************************
|
||||
@ -39,6 +39,7 @@ define('HESK_PATH','../');
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
require(HESK_PATH . 'inc/profile_functions.inc.php');
|
||||
hesk_load_database_functions();
|
||||
|
||||
hesk_session_start();
|
||||
@ -61,6 +62,7 @@ $hesk_settings['features'] = array(
|
||||
'can_man_users', /* User can create and edit staff accounts */
|
||||
'can_man_cat', /* User can manage categories/departments */
|
||||
'can_man_canned', /* User can manage canned responses */
|
||||
'can_man_ticket_tpl', /* User can manage ticket templates */
|
||||
'can_add_archive', /* User can mark tickets as "Tagged" */
|
||||
'can_assign_self', /* User can assign tickets to himself/herself */
|
||||
'can_assign_others', /* User can assign tickets to other staff members */
|
||||
@ -70,20 +72,51 @@ $hesk_settings['features'] = array(
|
||||
'can_run_reports_full', /* User can run reports and see statistics (unrestricted) */
|
||||
'can_export', /* User can export own tickets to Excel */
|
||||
'can_view_online', /* User can view what staff members are currently online */
|
||||
'can_ban_emails', /* User can ban email addresses */
|
||||
'can_unban_emails', /* User can delete email address bans. Also enables "can_ban_emails" */
|
||||
'can_ban_ips', /* User can ban IP addresses */
|
||||
'can_unban_ips', /* User can delete IP bans. Also enables "can_ban_ips" */
|
||||
'can_service_msg', /* User can manage service messages shown in customer interface */
|
||||
);
|
||||
|
||||
/* Set default values */
|
||||
$default_userdata = array(
|
||||
|
||||
// Profile info
|
||||
'name' => '',
|
||||
'email' => '',
|
||||
'user' => '',
|
||||
'cleanpass' => '',
|
||||
'user' => '',
|
||||
'autoassign' => 'Y',
|
||||
|
||||
// Signature
|
||||
'signature' => '',
|
||||
|
||||
// Permissions
|
||||
'isadmin' => 1,
|
||||
'active' => 1,
|
||||
'categories' => array('1'),
|
||||
'features' => array('can_view_tickets','can_reply_tickets','can_change_cat','can_assign_self','can_view_unassigned','can_view_online'),
|
||||
'signature' => '',
|
||||
'cleanpass' => '',
|
||||
|
||||
// Preferences
|
||||
'afterreply' => 0,
|
||||
'autorefresh' => 0,
|
||||
|
||||
// Defaults
|
||||
'autostart' => 1,
|
||||
'notify_customer_new' => 1,
|
||||
'notify_customer_reply' => 1,
|
||||
'show_suggested' => 1,
|
||||
|
||||
// Notifications
|
||||
'notify_new_unassigned' => 1,
|
||||
'notify_new_my' => 1,
|
||||
'notify_reply_unassigned' => 1,
|
||||
'notify_reply_my' => 1,
|
||||
'notify_assigned' => 1,
|
||||
'notify_note' => 1,
|
||||
'notify_pm' => 1,
|
||||
'notify_note_unassigned' => 1,
|
||||
);
|
||||
|
||||
/* A list of all categories */
|
||||
@ -101,7 +134,10 @@ while ($row=hesk_dbFetchAssoc($res))
|
||||
if ( ! $_SESSION['isadmin'])
|
||||
{
|
||||
/* Can't create admin users */
|
||||
$_POST['isadmin'] = 0;
|
||||
if ( isset($_POST['isadmin']) )
|
||||
{
|
||||
unset($_POST['isadmin']);
|
||||
}
|
||||
|
||||
/* Can only add features he/she has access to */
|
||||
$hesk_settings['features'] = array_intersect( explode(',', $_SESSION['heskprivileges']) , $hesk_settings['features']);
|
||||
@ -166,149 +202,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
?>
|
||||
|
||||
<div style="margin-top: 20px" class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><?php echo $hesklang['add_user']; ?></div>
|
||||
<div class="panel-body">
|
||||
<h6><?php echo $hesklang['req_marked_with']; ?> <font class="important">*</font></h6>
|
||||
<div class="footerWithBorder blankSpace"></div>
|
||||
|
||||
<form class="form-horizontal" name="form1" action="manage_users.php" method="post">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-5 control-label"><?php echo $hesklang['real_name']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" name="name" size="40" maxlength="50" value="<?php echo $_SESSION['userdata']['name']; ?>" placeholder="<?php echo $hesklang['real_name']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-sm-5 control-label"><?php echo $hesklang['email']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" name="email" size="40" maxlength="255" placeholder="<?php echo $hesklang['email']; ?>" value="<?php echo $_SESSION['userdata']['email']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user" class="col-sm-5 control-label"><?php echo $hesklang['username']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" name="user" size="40" maxlength="20" value="<?php echo $_SESSION['userdata']['user']; ?>" placeholder="<?php echo $hesklang['username']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pass" class="col-sm-5 control-label"><?php echo $hesklang['pass']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-7">
|
||||
<input type="password" class="form-control" name="newpass" autocomplete="off" size="40" placeholder="<?php echo $hesklang['pass']; ?>" value="<?php echo $_SESSION['userdata']['cleanpass']; ?>" onkeyup="javascript:hesk_checkPassword(this.value)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="confirmPass" class="col-sm-5 control-label" style="font-size: .9em"><?php echo $hesklang['confirm_pass']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-7">
|
||||
<input type="password" name="newpass2" class="form-control" autocomplete="off" placeholder="<?php echo $hesklang['confirm_pass']; ?>" size="40" value="<?php echo $_SESSION['userdata']['cleanpass']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pwStrength" class="col-sm-5 control-label" style="font-size: .9em"><?php echo $hesklang['pwdst']; ?>:</label>
|
||||
<div class="col-sm-7">
|
||||
<div style="border: 1px solid gray; width: 100px;">
|
||||
<div id="progressBar"
|
||||
style="font-size: 1px; height: 22px; width: 0px; border: 1px solid white;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="administrator" class="col-sm-5 control-label"><?php echo $hesklang['administrator']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-7">
|
||||
<?php
|
||||
/* Only administrators can create new administrator accounts */
|
||||
if ($_SESSION['isadmin'])
|
||||
{
|
||||
?>
|
||||
<div class="radio"><label><input type="radio" name="isadmin" value="1" onchange="Javascript:hesk_toggleLayerDisplay('options')" <?php if ($_SESSION['userdata']['isadmin']) echo 'checked="checked"'; ?> /> <?php echo $hesklang['yes'].' '.$hesklang['admin_can']; ?></label></div>
|
||||
<div class="radio"><label><input type="radio" name="isadmin" value="0" onchange="Javascript:hesk_toggleLayerDisplay('options')" <?php if (!$_SESSION['userdata']['isadmin']) echo 'checked="checked"'; ?> /> <?php echo $hesklang['no'].' '.$hesklang['staff_can']; ?></label></div>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $hesklang['no'].' '.$hesklang['staff_can'];
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="options" style="display: <?php echo ($_SESSION['isadmin'] && $_SESSION['userdata']['isadmin']) ? 'none' : 'block'; ?>">
|
||||
<div class="form-group">
|
||||
<label for="categories" class="col-sm-5 control-label"><?php echo $hesklang['allowed_cat']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-7">
|
||||
<?php
|
||||
foreach ($hesk_settings['categories'] as $catid => $catname)
|
||||
{
|
||||
echo '<div class="checkbox"><label><input type="checkbox" name="categories[]" value="' . $catid . '" ';
|
||||
if ( in_array($catid,$_SESSION['userdata']['categories']) )
|
||||
{
|
||||
echo ' checked="checked" ';
|
||||
}
|
||||
echo ' />' . $catname . '</label></div> ';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="permissions" class="col-sm-5 control-label"><?php echo $hesklang['allow_feat']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-7">
|
||||
<?php
|
||||
foreach ($hesk_settings['features'] as $k)
|
||||
{
|
||||
echo '<div class="checkbox"><label><input type="checkbox" name="features[]" value="' . $k . '" ';
|
||||
if (in_array($k,$_SESSION['userdata']['features']))
|
||||
{
|
||||
echo ' checked="checked" ';
|
||||
}
|
||||
echo ' />' . $hesklang[$k] . '</label></div> ';
|
||||
}
|
||||
?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="can_change_notification_settings" checked> <?php echo $hesklang['can_change_notification_settings']; ?> </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="auto-assign" class="col-sm-5 control-label"><?php echo $hesklang['opt']; ?>:</label>
|
||||
<div class="col-sm-7">
|
||||
<?php
|
||||
if ($hesk_settings['autoassign'])
|
||||
{
|
||||
?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="autoassign" value="Y" <?php if ( ! isset($_SESSION['userdata']['autoassign']) || $_SESSION['userdata']['autoassign'] == 1 ) {echo 'checked="checked"';} ?> /> <?php echo $hesklang['user_aa']; ?></label>
|
||||
</div>
|
||||
<?php } if ($_SESSION['can_manage_settings']) { ?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="manage_settings"> <?php echo $hesklang['can_man_settings']; ?></label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="signature" class="col-sm-5 control-label"><?php echo $hesklang['signature_max']; ?>:</label>
|
||||
|
||||
<div class="col-sm-7">
|
||||
<textarea class="form-control" name="signature" rows="6" placeholder="<?php echo $hesklang['sig']; ?>" cols="40"><?php echo $_SESSION['userdata']['signature']; ?></textarea>
|
||||
<?php echo $hesklang['sign_extra']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12 text-right">
|
||||
<input type="hidden" name="a" value="new" />
|
||||
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
|
||||
<input type="submit" class="btn btn-default" value="<?php echo $hesklang['create_user']; ?>" />
|
||||
<a class="btn btn-default" href="manage_users.php?a=reset_form"><?php echo $hesklang['refi']; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-10 col-md-offset-1">
|
||||
<script language="Javascript" type="text/javascript"><!--
|
||||
function confirm_delete()
|
||||
{
|
||||
@ -345,7 +239,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
</tr>
|
||||
<!-- I can't get this block to tab over without breaking, so it will be awkwardly sticking out for now :( -->
|
||||
<?php
|
||||
$res = hesk_dbQuery('SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'users` ORDER BY `id` ASC');
|
||||
$res = hesk_dbQuery('SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'users` ORDER BY `name` ASC');
|
||||
|
||||
$i=1;
|
||||
$cannot_manage = array();
|
||||
@ -470,7 +364,18 @@ EOC;
|
||||
{
|
||||
echo ' <i style="color: green" class="fa fa-circle"></i> '.$hesklang['online'].' <i style="color: gray" class="fa fa-circle"></i> '.$hesklang['offline'];
|
||||
}?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-10 col-md-offset-1">
|
||||
<h3><?php echo $hesklang['add_user']; ?></h3>
|
||||
<h6><?php echo $hesklang['req_marked_with']; ?> <font class="important">*</font></h6>
|
||||
<div class="footerWithBorder blankSpace"></div>
|
||||
|
||||
<form name="form1" method="post" action="manage_users.php" class="form-horizontal" role="form">
|
||||
<?php hesk_profile_tab('userdata', false, 'create_user'); ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script language="Javascript" type="text/javascript"><!--
|
||||
@ -554,7 +459,7 @@ function edit_user()
|
||||
|
||||
if ( ! isset($_SESSION['save_userdata']))
|
||||
{
|
||||
$res = hesk_dbQuery("SELECT `user`,`pass`,`isadmin`,`name`,`email`,`signature`,`categories`,`autoassign`,`heskprivileges` AS `features`, `can_manage_settings`, `active`, `can_change_notification_settings`
|
||||
$res = hesk_dbQuery("SELECT *,`heskprivileges` AS `features`, `can_manage_settings`, `active`, `can_change_notification_settings`
|
||||
FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."users` WHERE `id`='".intval($id)."' LIMIT 1");
|
||||
$_SESSION['userdata'] = hesk_dbFetchAssoc($res);
|
||||
|
||||
@ -605,157 +510,7 @@ function edit_user()
|
||||
<div class="footerWithBorder blankSpace"></div>
|
||||
|
||||
<form role="form" class="form-horizontal" name="form1" method="post" action="manage_users.php">
|
||||
<!-- Contact info -->
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['real_name']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" placeholder="<?php echo $hesklang['real_name']; ?>" type="text" name="name" size="40" maxlength="50" value="<?php echo $_SESSION['userdata']['name']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" placeholder="<?php echo $hesklang['email']; ?>" type="text" name="email" size="40" maxlength="255" value="<?php echo $_SESSION['userdata']['email']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user" class="col-sm-3 control-label"><?php echo $hesklang['username']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" placeholder="<?php echo $hesklang['username']; ?>" type="text" name="user" size="40" maxlength="20" value="<?php echo $_SESSION['userdata']['user']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newpass" class="col-sm-3 control-label"><?php echo $hesklang['pass']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="password" class="form-control" placeholder="<?php echo $hesklang['pass']; ?>" name="newpass" autocomplete="off" size="40" value="<?php echo $_SESSION['userdata']['cleanpass']; ?>" onkeyup="javascript:hesk_checkPassword(this.value)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newpass2" class="col-sm-3 control-label"><?php echo $hesklang['confirm_pass']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="password" class="form-control" placeholder="<?php echo $hesklang['confirm_pass']; ?>" name="newpass2" autocomplete="off" size="40" value="<?php echo $_SESSION['userdata']['cleanpass']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pwdst" class="col-sm-3 control-label"><?php echo $hesklang['pwdst']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<div style="border: 1px solid gray; width: 100px;">
|
||||
<div id="progressBar"
|
||||
style="font-size: 1px; height: 14px; width: 0px; border: 1px solid white;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="isadmin" class="col-sm-3 control-label"><?php echo $hesklang['administrator']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-9">
|
||||
<?php
|
||||
/* Only administrators can create new administrator accounts */
|
||||
if ($_SESSION['isadmin'])
|
||||
{
|
||||
?>
|
||||
<div class="radio"><label><input type="radio" name="isadmin" value="1" onchange="Javascript:hesk_toggleLayerDisplay('options')" <?php if ($_SESSION['userdata']['isadmin']) echo 'checked="checked"'; ?> /> <?php echo $hesklang['yes'].' '.$hesklang['admin_can']; ?></label></div>
|
||||
<div class="radio"><label><input type="radio" name="isadmin" value="0" onchange="Javascript:hesk_toggleLayerDisplay('options')" <?php if (!$_SESSION['userdata']['isadmin']) echo 'checked="checked"'; ?> /> <?php echo $hesklang['no'].' '.$hesklang['staff_can']; ?></label></div>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $hesklang['no'].' '.$hesklang['staff_can'];
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="options" style="display: <?php echo ($_SESSION['isadmin'] && $_SESSION['userdata']['isadmin']) ? 'none' : ''; ?>">
|
||||
<div class="row">
|
||||
<label for="cats" class="control-label col-sm-3"><?php echo $hesklang['allowed_cat']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-6">
|
||||
<?php
|
||||
foreach ($hesk_settings['categories'] as $catid => $catname)
|
||||
{
|
||||
echo '<div class="checkbox"><label><input type="checkbox" name="categories[]" value="' . $catid . '" ';
|
||||
if ( in_array($catid,$_SESSION['userdata']['categories']) )
|
||||
{
|
||||
echo ' checked="checked" ';
|
||||
}
|
||||
echo ' />' . $catname . '</label></div> ';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label for="feats" class="control-label col-sm-3"><?php echo $hesklang['allow_feat']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-6">
|
||||
<?php
|
||||
foreach ($hesk_settings['features'] as $k)
|
||||
{
|
||||
echo '<div class="checkbox"><label><input type="checkbox" name="features[]" value="' . $k . '" ';
|
||||
if (in_array($k,$_SESSION['userdata']['features']))
|
||||
{
|
||||
echo ' checked="checked" ';
|
||||
}
|
||||
echo ' />' . $hesklang[$k] . '</label></div> ';
|
||||
}
|
||||
|
||||
$manageNotificationCheckboxState = '';
|
||||
if (
|
||||
isset($_SESSION['userdata']['can_change_notification_settings'])
|
||||
&& $_SESSION['userdata']['can_change_notification_settings'] == 1)
|
||||
{
|
||||
$manageNotificationCheckboxState = 'checked';
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="can_change_notification_settings" <?php echo $manageNotificationCheckboxState; ?>>
|
||||
<?php echo $hesklang['can_change_notification_settings']; ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="autoassign" class="col-sm-3 control-label"><?php echo $hesklang['opt']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<?php if ($hesk_settings['autoassign'])
|
||||
{ ?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="autoassign" value="Y" <?php if ( isset($_SESSION['userdata']['autoassign']) && $_SESSION['userdata']['autoassign'] == 1 ) {echo 'checked="checked"';} ?> /> <?php echo $hesklang['user_aa']; ?></label>
|
||||
</div>
|
||||
<?php } if ($_GET['id'] != 1) { ?>
|
||||
<div class="checkbox">
|
||||
<?php if (isset($_SESSION['userdata']['can_manage_settings'])) { ?>
|
||||
<label><input type="checkbox" name="manage_settings"
|
||||
<?php if ($_SESSION['userdata']['can_manage_settings']) { echo 'checked="checked"';} ?>
|
||||
<?php if (!$_SESSION['can_manage_settings']) { echo 'disabled'; } ?>> <?php echo $hesklang['can_man_settings']; ?></label>
|
||||
<?php if (!$_SESSION['can_manage_settings'] && $_SESSION['userdata']['can_manage_settings']) {
|
||||
echo '<input type="hidden" name="manage_settings" value="1">';
|
||||
} ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="manage_settings" value="1">
|
||||
<?php } ?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="active" <?php if ($_SESSION['userdata']['active']) { echo 'checked';} ?>> <?php echo $hesklang['active_user']; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="signature" class="col-sm-3 control-label"><?php echo $hesklang['signature_max']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea class="form-control" placeholder="<?php echo $hesklang['sig']; ?>" name="signature" rows="6" cols="40"><?php echo $_SESSION['userdata']['signature']; ?></textarea><br />
|
||||
<?php echo $hesklang['sign_extra']; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit -->
|
||||
<div class="form-group" style="text-align: center">
|
||||
<input type="hidden" name="a" value="save" />
|
||||
<input type="hidden" name="userid" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
|
||||
<input class="btn btn-default" type="submit" value="<?php echo $hesklang['save_changes']; ?>" />
|
||||
<a class="btn btn-default" href="manage_users.php"><?php echo $hesklang['dich']; ?></a>
|
||||
</div>
|
||||
<?php hesk_profile_tab('userdata',false,'edit_user'); ?>
|
||||
</form>
|
||||
<script language="Javascript" type="text/javascript"><!--
|
||||
hesk_checkPassword(document.form1.newpass.value);
|
||||
@ -779,18 +534,6 @@ function new_user()
|
||||
|
||||
$myuser = hesk_validateUserInfo();
|
||||
|
||||
/* Can view unassigned tickets? */
|
||||
if ( in_array('can_view_unassigned', $myuser['features']) )
|
||||
{
|
||||
$sql_where = '';
|
||||
$sql_what = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql_where = ' , `notify_new_unassigned`, `notify_reply_unassigned` ';
|
||||
$sql_what = " , '0', '0' ";
|
||||
}
|
||||
|
||||
/* Categories and Features will be stored as a string */
|
||||
$myuser['categories'] = implode(',',$myuser['categories']);
|
||||
$myuser['features'] = implode(',',$myuser['features']);
|
||||
@ -810,7 +553,30 @@ function new_user()
|
||||
}
|
||||
|
||||
hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."users` (
|
||||
`user`,`pass`,`isadmin`,`name`,`email`,`signature`,`categories`,`autoassign`,`heskprivileges`, `can_manage_settings`, `can_change_notification_settings` $sql_where) VALUES (
|
||||
`user`,
|
||||
`pass`,
|
||||
`isadmin`,
|
||||
`name`,
|
||||
`email`,
|
||||
`signature`,
|
||||
`categories`,
|
||||
`autoassign`,
|
||||
`heskprivileges`,
|
||||
`can_manage_settings`,
|
||||
`can_change_notification_settings`,
|
||||
`afterreply`,
|
||||
`autostart`,
|
||||
`notify_customer_new`,
|
||||
`notify_customer_reply`,
|
||||
`show_suggested`,
|
||||
`notify_new_unassigned`,
|
||||
`notify_new_my`,
|
||||
`notify_reply_unassigned`,
|
||||
`notify_reply_my`,
|
||||
`notify_assigned`,
|
||||
`notify_pm`,
|
||||
`notify_note`,
|
||||
`notify_note_unassigned`) VALUES (
|
||||
'".hesk_dbEscape($myuser['user'])."',
|
||||
'".hesk_dbEscape($myuser['pass'])."',
|
||||
'".intval($myuser['isadmin'])."',
|
||||
@ -821,8 +587,21 @@ function new_user()
|
||||
'".intval($myuser['autoassign'])."',
|
||||
'".hesk_dbEscape($myuser['features'])."',
|
||||
'".hesk_dbEscape($myuser['can_manage_settings'])."',
|
||||
'".hesk_dbEscape($myuser['can_change_notification_settings'])."'
|
||||
$sql_what )" );
|
||||
'".hesk_dbEscape($myuser['can_change_notification_settings'])."',
|
||||
'".($myuser['afterreply'])."' ,
|
||||
'".($myuser['autostart'])."' ,
|
||||
'".($myuser['notify_customer_new'])."' ,
|
||||
'".($myuser['notify_customer_reply'])."' ,
|
||||
'".($myuser['show_suggested'])."' ,
|
||||
'".($myuser['notify_new_unassigned'])."' ,
|
||||
'".($myuser['notify_new_my'])."' ,
|
||||
'".($myuser['notify_reply_unassigned'])."' ,
|
||||
'".($myuser['notify_reply_my'])."' ,
|
||||
'".($myuser['notify_assigned'])."' ,
|
||||
'".($myuser['notify_pm'])."',
|
||||
'".($myuser['notify_note'])."',
|
||||
'".($myuser['notify_note_unassigned'])."'
|
||||
)" );
|
||||
|
||||
$_SESSION['seluser'] = hesk_dbInsertID();
|
||||
|
||||
@ -854,16 +633,16 @@ function update_user()
|
||||
$myuser['id'] = $tmp;
|
||||
|
||||
/* Only active users can be assigned tickets */
|
||||
if ($myuser['active']) {
|
||||
/* If can't view assigned changes this */
|
||||
if (in_array('can_view_unassigned', $myuser['features'])) {
|
||||
$sql_where = "";
|
||||
} else {
|
||||
$sql_where = " , `notify_new_unassigned`='0', `notify_reply_unassigned`='0' ";
|
||||
}
|
||||
} else {
|
||||
if (!$myuser['active']) {
|
||||
$myuser['autoassign'] = 0;
|
||||
$sql_where = " , `notify_new_unassigned`='0', `notify_new_my`='0', `notify_reply_unassigned`='0', `notify_reply_my`='0', `notify_assigned`='0', `notify_pm`='0', `notify_note`='0' ";
|
||||
$myuser['notify_new_unassigned'] = 0;
|
||||
$myuser['notify_new_my'] = 0;
|
||||
$myuser['notify_reply_unassigned'] = 0;
|
||||
$myuser['notify_reply_my'] = 0;
|
||||
$myuser['notify_assigned'] = 0;
|
||||
$myuser['notify_pm'] = 0;
|
||||
$myuser['notify_note'] = 0;
|
||||
$myuser['notify_note_unassigned'] = 0;
|
||||
}
|
||||
|
||||
/* Check for duplicate usernames */
|
||||
@ -914,8 +693,20 @@ function update_user()
|
||||
`autoassign`='".intval($myuser['autoassign'])."',
|
||||
`heskprivileges`='".hesk_dbEscape($myuser['features'])."',
|
||||
`can_manage_settings`='".hesk_dbEscape($myuser['can_manage_settings'])."',
|
||||
`can_change_notification_settings`='".hesk_dbEscape($myuser['can_change_notification_settings'])."'
|
||||
$sql_where
|
||||
`can_change_notification_settings`='".hesk_dbEscape($myuser['can_change_notification_settings'])."',
|
||||
`afterreply`='".($myuser['afterreply'])."' ,
|
||||
`autostart`='".($myuser['autostart'])."' ,
|
||||
`notify_customer_new`='".($myuser['notify_customer_new'])."' ,
|
||||
`notify_customer_reply`='".($myuser['notify_customer_reply'])."' ,
|
||||
`show_suggested`='".($myuser['show_suggested'])."' ,
|
||||
`notify_new_unassigned`='".($myuser['notify_new_unassigned'])."' ,
|
||||
`notify_new_my`='".($myuser['notify_new_my'])."' ,
|
||||
`notify_reply_unassigned`='".($myuser['notify_reply_unassigned'])."' ,
|
||||
`notify_reply_my`='".($myuser['notify_reply_my'])."' ,
|
||||
`notify_assigned`='".($myuser['notify_assigned'])."' ,
|
||||
`notify_pm`='".($myuser['notify_pm'])."',
|
||||
`notify_note`='".($myuser['notify_note'])."',
|
||||
`notify_note_unassigned`='".($myuser['notify_note_unassigned'])."'
|
||||
WHERE `id`='".intval($myuser['id'])."' LIMIT 1");
|
||||
|
||||
unset($_SESSION['save_userdata']);
|
||||
@ -1022,6 +813,22 @@ function hesk_validateUserInfo($pass_required = 1, $redirect_to = './manage_user
|
||||
}
|
||||
}
|
||||
|
||||
// Defaults
|
||||
$myuser['autostart'] = isset($_POST['autostart']) ? 1 : 0;
|
||||
$myuser['notify_customer_new'] = isset($_POST['notify_customer_new']) ? 1 : 0;
|
||||
$myuser['notify_customer_reply'] = isset($_POST['notify_customer_reply']) ? 1 : 0;
|
||||
$myuser['show_suggested'] = isset($_POST['show_suggested']) ? 1 : 0;
|
||||
|
||||
/* Notifications */
|
||||
$myuser['notify_new_unassigned'] = empty($_POST['notify_new_unassigned']) ? 0 : 1;
|
||||
$myuser['notify_new_my'] = empty($_POST['notify_new_my']) ? 0 : 1;
|
||||
$myuser['notify_reply_unassigned'] = empty($_POST['notify_reply_unassigned']) ? 0 : 1;
|
||||
$myuser['notify_reply_my'] = empty($_POST['notify_reply_my']) ? 0 : 1;
|
||||
$myuser['notify_assigned'] = empty($_POST['notify_assigned']) ? 0 : 1;
|
||||
$myuser['notify_note'] = empty($_POST['notify_note']) ? 0 : 1;
|
||||
$myuser['notify_pm'] = empty($_POST['notify_pm']) ? 0 : 1;
|
||||
$myuser['notify_note_unassigned'] = empty($_POST['notify_note_unassigned']) ? 0 : 1;
|
||||
|
||||
/* Save entered info in session so we don't loose it in case of errors */
|
||||
$_SESSION['userdata'] = $myuser;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*******************************************************************************
|
||||
* Title: Help Desk Software HESK
|
||||
* Version: 2.5.5 from 5th August 2014
|
||||
* Version: 2.6.0 beta 1 from 30th December 2014
|
||||
* Author: Klemen Stirn
|
||||
* Website: http://www.hesk.com
|
||||
********************************************************************************
|
||||
@ -39,6 +39,7 @@ define('HESK_PATH','../');
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
require(HESK_PATH . 'inc/profile_functions.inc.php');
|
||||
hesk_load_database_functions();
|
||||
|
||||
hesk_session_start();
|
||||
@ -167,178 +168,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
?>
|
||||
|
||||
<form role="form" class="form-horizontal" method="post" action="profile.php" name="form1">
|
||||
<h4><?php echo $hesklang['pinfo']; ?></h4>
|
||||
<div class="footerWithBorder blankSpace"></div>
|
||||
<!-- Contact info -->
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" type="text" name="name" size="30" maxlength="50" value="<?php echo $_SESSION['new']['name']; ?>" placeholder="<?php echo $hesklang['name']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="email" size="30" maxlength="255" value="<?php echo $_SESSION['new']['email']; ?>" placeholder="<?php echo $hesklang['email']; ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
// Let admins change their username
|
||||
if ($_SESSION['isadmin'])
|
||||
{
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label for="user" class="col-sm-3 control-label"><?php echo $hesklang['username']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="user" size="30" maxlength="50" value="<?php echo $_SESSION['new']['user']; ?>" autocomplete="off" placeholder="<?php echo $hesklang['username']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label for="newpass" class="col-sm-3 control-label"><?php echo $hesklang['new_pass']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="password" class="form-control" name="newpass" size="30" onkeyup="javascript:hesk_checkPassword(this.value)" autocomplete="off" placeholder="<?php echo $hesklang['new_pass']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newpass2" class="col-sm-3 control-label"><?php echo $hesklang['confirm_pass']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="password" class="form-control" name="newpass2" size="30" autocomplete="off" placeholder="<?php echo $hesklang['confirm_pass']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pwdStrength" class="col-sm-3 control-label"><?php echo $hesklang['pwdst']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<div style="border: 1px solid gray; width: 100px;">
|
||||
<div id="progressBar"
|
||||
style="font-size: 1px; height: 14px; width: 0px; border: 1px solid white;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4><?php echo $hesklang['sig']; ?></h4>
|
||||
<div class="footerWithBorder blankSpace"></div>
|
||||
<!-- Signature -->
|
||||
<div class="form-group">
|
||||
<label for="signature" class="col-sm-3 control-label"><?php echo $hesklang['signature_max']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea class="form-control" name="signature" rows="6" cols="40" placholder="<?php echo $hesklang['sig']; ?>"><?php echo $_SESSION['new']['signature']; ?></textarea><br />
|
||||
<?php echo $hesklang['sign_extra']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<h4><?php echo $hesklang['pref']; ?></h4>
|
||||
<?php
|
||||
if ($can_reply_tickets)
|
||||
{
|
||||
?>
|
||||
<div class="footerWithBorder blankSpace"></div>
|
||||
<div class="form-group">
|
||||
<label for="afterreply" class="col-sm-3 control-label"><?php echo $hesklang['aftrep']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="afterreply" value="0" <?php if (!$_SESSION['new']['afterreply']) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['showtic']; ?></label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="afterreply" value="1" <?php if ($_SESSION['new']['afterreply'] == 1) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['gomain']; ?></label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="afterreply" value="2" <?php if ($_SESSION['new']['afterreply'] == 2) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['shownext']; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="autostart" class="col-sm-3 control-label"><?php echo $hesklang['ts']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="autostart" value="1" <?php if (!empty($_SESSION['new']['autostart'])) {echo 'checked="checked"';}?> /> <?php echo $hesklang['autoss']; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="form-group">
|
||||
<label for="autoRefresh" class="col-sm-3 control-label"><?php echo $hesklang['ticket_auto_refresh']; ?></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="autorefresh" name="autorefresh" value="<?php echo $_SESSION['new']['autorefresh']; ?>">
|
||||
<span class="help-block"><?php echo $hesklang['autorefresh_restrictions']; ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<h4><?php echo $hesklang['notn']; ?></h4>
|
||||
<h6><?php echo $hesklang['nomw']; ?></h6>
|
||||
<div class="footerWithBorder blankSpace"></div>
|
||||
<?php $disabledText = isset($_SESSION['new']['can_change_notification_settings']) && $_SESSION['new']['can_change_notification_settings'] ? '' : 'disabled';
|
||||
if ($disabledText == 'disabled') { ?>
|
||||
<div class="alert alert-info"><?php echo $hesklang['notifications_disabled_info']; ?></div>
|
||||
<?php }
|
||||
?>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
if ($can_view_tickets)
|
||||
{
|
||||
if ($can_view_unassigned)
|
||||
{
|
||||
?>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_new_unassigned" value="1" <?php if (!empty($_SESSION['new']['notify_new_unassigned'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['nwts']; ?> <?php echo $hesklang['unas']; ?></label></div></div>
|
||||
<?php
|
||||
if ($disabledText == 'disabled')
|
||||
{ ?>
|
||||
<input type="hidden" name="notify_new_unassigned" value="<?php echo !empty($_SESSION['new']['notify_new_unassigned']) ? '1' : '0'; ?>">
|
||||
<?php }
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<input type="hidden" name="notify_new_unassigned" value="0" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_new_my" value="1" <?php if (!empty($_SESSION['new']['notify_new_my'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['nwts']; ?> <?php echo $hesklang['s_my']; ?></label></div></div>
|
||||
<?php
|
||||
if ($disabledText == 'disabled')
|
||||
{ ?>
|
||||
<input type="hidden" name="notify_new_my" value="<?php echo !empty($_SESSION['new']['notify_new_my']) ? '1' : '0'; ?>">
|
||||
<?php }
|
||||
|
||||
if ($can_view_unassigned)
|
||||
{
|
||||
?>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_reply_unassigned" value="1" <?php if (!empty($_SESSION['new']['notify_reply_unassigned'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['ncrt']; ?> <?php echo $hesklang['unas']; ?></label></div></div>
|
||||
<?php
|
||||
if ($disabledText == 'disabled')
|
||||
{ ?>
|
||||
<input type="hidden" name="notify_reply_unassigned" value="<?php echo !empty($_SESSION['new']['notify_reply_unassigned']) ? '1' : '0'; ?>">
|
||||
<?php }
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<input type="hidden" name="notify_reply_unassigned" value="0" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_reply_my" value="1" <?php if (!empty($_SESSION['new']['notify_reply_my'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['ncrt']; ?> <?php echo $hesklang['s_my']; ?></label></div></div>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_assigned" value="1" <?php if (!empty($_SESSION['new']['notify_assigned'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['ntam']; ?></label></div></div>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_note" value="1" <?php if (!empty($_SESSION['new']['notify_note'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['ntnote']; ?></label></div></div>
|
||||
<?php
|
||||
if ($disabledText == 'disabled')
|
||||
{ ?>
|
||||
<input type="hidden" name="notify_reply_my" value="<?php echo !empty($_SESSION['new']['notify_reply_my']) ? '1' : '0'; ?>">
|
||||
<input type="hidden" name="notify_assigned" value="<?php echo !empty($_SESSION['new']['notify_assigned']) ? '1' : '0'; ?>">
|
||||
<input type="hidden" name="notify_note" value="<?php echo !empty($_SESSION['new']['notify_note']) ? '1' : '0'; ?>">
|
||||
<?php }
|
||||
|
||||
if ($_SESSION['isadmin']) { ?>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_note_unassigned" value="1" <?php if (!empty($_SESSION['new']['notify_note_unassigned'])) {echo 'checked="checked"';}?>> <?php echo $hesklang['notify_note_unassigned']; ?></label></div> </div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
|
||||
<div style="text-align: center"><input type="submit" class="btn btn-default" value="<?php echo $hesklang['update_profile']; ?>" /></div>
|
||||
<?php hesk_profile_tab('new'); ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
446
hesk_javascript.js
Normal file
446
hesk_javascript.js
Normal file
@ -0,0 +1,446 @@
|
||||
/*******************************************************************************
|
||||
* Title: Help Desk Software HESK
|
||||
* Version: 2.6.0 beta 1 from 30th December 2014
|
||||
* Author: Klemen Stirn
|
||||
* Website: http://www.hesk.com
|
||||
********************************************************************************
|
||||
* COPYRIGHT AND TRADEMARK NOTICE
|
||||
* Copyright 2005-2014 Klemen Stirn. All Rights Reserved.
|
||||
* HESK is a registered trademark of Klemen Stirn.
|
||||
|
||||
* The HESK may be used and modified free of charge by anyone
|
||||
* AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT.
|
||||
* By using this code you agree to indemnify Klemen Stirn from any
|
||||
* liability that might arise from it's use.
|
||||
|
||||
* Selling the code for this program, in part or full, without prior
|
||||
* written consent is expressly forbidden.
|
||||
|
||||
* Using this code, in part or full, to create derivate work,
|
||||
* new scripts or products is expressly forbidden. Obtain permission
|
||||
* before redistributing this software over the Internet or in
|
||||
* any other medium. In all cases copyright and header must remain intact.
|
||||
* This Copyright is in full effect in any country that has International
|
||||
* Trade Agreements with the United States of America or
|
||||
* with the European Union.
|
||||
|
||||
* Removing any of the copyright notices without purchasing a license
|
||||
* is expressly forbidden. To remove HESK copyright notice you must purchase
|
||||
* a license for this script. For more information on how to obtain
|
||||
* a license please visit the page below:
|
||||
* https://www.hesk.com/buy.php
|
||||
*******************************************************************************/
|
||||
|
||||
function hesk_insertTag(tag) {
|
||||
var text_to_insert = '%%'+tag+'%%';
|
||||
hesk_insertAtCursor(document.form1.msg, text_to_insert);
|
||||
document.form1.message.focus();
|
||||
}
|
||||
|
||||
function hesk_insertAtCursor(myField, myValue) {
|
||||
if (document.selection) {
|
||||
myField.focus();
|
||||
sel = document.selection.createRange();
|
||||
sel.text = myValue;
|
||||
}
|
||||
else if (myField.selectionStart || myField.selectionStart == '0') {
|
||||
var startPos = myField.selectionStart;
|
||||
var endPos = myField.selectionEnd;
|
||||
myField.value = myField.value.substring(0, startPos)
|
||||
+ myValue
|
||||
+ myField.value.substring(endPos, myField.value.length);
|
||||
} else {
|
||||
myField.value += myValue;
|
||||
}
|
||||
}
|
||||
|
||||
function hesk_changeAll(myID) {
|
||||
var d = document.form1;
|
||||
var setTo = myID.checked ? true : false;
|
||||
|
||||
for (var i = 0; i < d.elements.length; i++)
|
||||
{
|
||||
if(d.elements[i].type == 'checkbox' && d.elements[i].name != 'checkall')
|
||||
{
|
||||
d.elements[i].checked = setTo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function hesk_attach_disable(ids) {
|
||||
for($i=0;$i<ids.length;$i++) {
|
||||
if (ids[$i]=='c11'||ids[$i]=='c21'||ids[$i]=='c31'||ids[$i]=='c41'||ids[$i]=='c51') {
|
||||
document.getElementById(ids[$i]).checked=false;
|
||||
}
|
||||
document.getElementById(ids[$i]).disabled=true;
|
||||
}
|
||||
}
|
||||
|
||||
function hesk_attach_enable(ids) {
|
||||
for($i=0;$i<ids.length;$i++) {
|
||||
document.getElementById(ids[$i]).disabled=false;
|
||||
}
|
||||
}
|
||||
|
||||
function hesk_attach_toggle(control,ids) {
|
||||
if (document.getElementById(control).checked) {
|
||||
hesk_attach_enable(ids);
|
||||
} else {
|
||||
hesk_attach_disable(ids);
|
||||
}
|
||||
}
|
||||
|
||||
function hesk_window(PAGE,HGT,WDT)
|
||||
{
|
||||
var HeskWin = window.open(PAGE,"Hesk_window","height="+HGT+",width="+WDT+",menubar=0,location=0,toolbar=0,status=0,resizable=1,scrollbars=1");
|
||||
HeskWin.focus();
|
||||
}
|
||||
|
||||
function hesk_toggleLayerDisplay(nr) {
|
||||
if (document.all)
|
||||
document.all[nr].style.display = (document.all[nr].style.display == 'none') ? 'block' : 'none';
|
||||
else if (document.getElementById)
|
||||
document.getElementById(nr).style.display = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
|
||||
}
|
||||
|
||||
function hesk_confirmExecute(myText) {
|
||||
if (confirm(myText))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function hesk_deleteIfSelected(myField,myText) {
|
||||
if(document.getElementById(myField).checked)
|
||||
{
|
||||
return hesk_confirmExecute(myText);
|
||||
}
|
||||
}
|
||||
|
||||
function hesk_rate(url,element_id)
|
||||
{
|
||||
if (url.length==0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var element = document.getElementById(element_id);
|
||||
|
||||
xmlHttp=GetXmlHttpObject();
|
||||
if (xmlHttp==null)
|
||||
{
|
||||
alert ("Your browser does not support AJAX!");
|
||||
return;
|
||||
}
|
||||
|
||||
xmlHttp.open("GET",url,true);
|
||||
|
||||
xmlHttp.onreadystatechange = function()
|
||||
{
|
||||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
|
||||
{
|
||||
element.innerHTML = xmlHttp.responseText;
|
||||
}
|
||||
}
|
||||
|
||||
xmlHttp.send(null);
|
||||
}
|
||||
|
||||
function stateChanged()
|
||||
{
|
||||
if (xmlHttp.readyState==4)
|
||||
{
|
||||
document.getElementById("rating").innerHTML=xmlHttp.responseText;
|
||||
}
|
||||
}
|
||||
|
||||
function GetXmlHttpObject()
|
||||
{
|
||||
var xmlHttp=null;
|
||||
try
|
||||
{
|
||||
// Firefox, Opera 8.0+, Safari
|
||||
xmlHttp=new XMLHttpRequest();
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// Internet Explorer
|
||||
try
|
||||
{
|
||||
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
}
|
||||
return xmlHttp;
|
||||
}
|
||||
|
||||
var heskKBquery = '';
|
||||
var heskKBfailed = false;
|
||||
|
||||
function hesk_suggestKB()
|
||||
{
|
||||
var d = document.form1;
|
||||
var s = d.subject.value;
|
||||
var m = d.message.value;
|
||||
var element = document.getElementById('kb_suggestions');
|
||||
|
||||
if (s != '' && m != '' && (heskKBquery != s + " " + m || heskKBfailed == true) )
|
||||
{
|
||||
element.style.display = 'block';
|
||||
var params = "p=1&" + "q=" + encodeURIComponent( s + " " + m );
|
||||
heskKBquery = s + " " + m;
|
||||
|
||||
xmlHttp=GetXmlHttpObject();
|
||||
if (xmlHttp==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
xmlHttp.open('POST','suggest_articles.php',true);
|
||||
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
|
||||
xmlHttp.onreadystatechange = function()
|
||||
{
|
||||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
|
||||
{
|
||||
element.innerHTML = xmlHttp.responseText;
|
||||
heskKBfailed = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
heskKBfailed = true;
|
||||
}
|
||||
}
|
||||
|
||||
xmlHttp.send(params);
|
||||
}
|
||||
|
||||
setTimeout('hesk_suggestKB();', 2000);
|
||||
|
||||
}
|
||||
|
||||
function hesk_suggestKBsearch(isAdmin)
|
||||
{
|
||||
var d = document.searchform;
|
||||
var s = d.search.value;
|
||||
var element = document.getElementById('kb_suggestions');
|
||||
|
||||
if (isAdmin)
|
||||
{
|
||||
var path = 'admin_suggest_articles.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
var path = 'suggest_articles.php';
|
||||
}
|
||||
|
||||
if (s != '' && (heskKBquery != s || heskKBfailed == true) )
|
||||
{
|
||||
element.style.display = 'block';
|
||||
var params = "q=" + encodeURIComponent( s );
|
||||
heskKBquery = s;
|
||||
|
||||
xmlHttp=GetXmlHttpObject();
|
||||
if (xmlHttp==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
xmlHttp.open('POST', path, true);
|
||||
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
|
||||
xmlHttp.onreadystatechange = function()
|
||||
{
|
||||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
|
||||
{
|
||||
element.innerHTML = unescape(xmlHttp.responseText);
|
||||
heskKBfailed = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
heskKBfailed = true;
|
||||
}
|
||||
}
|
||||
|
||||
xmlHttp.send(params);
|
||||
}
|
||||
|
||||
setTimeout('hesk_suggestKBsearch('+isAdmin+');', 2000);
|
||||
}
|
||||
|
||||
function hesk_suggestEmail(isAdmin)
|
||||
{
|
||||
var email = document.form1.email.value;
|
||||
var element = document.getElementById('email_suggestions');
|
||||
|
||||
if (isAdmin)
|
||||
{
|
||||
var path = '../suggest_email.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
var path = 'suggest_email.php';
|
||||
}
|
||||
|
||||
if (email != '')
|
||||
{
|
||||
var params = "e=" + encodeURIComponent( email );
|
||||
|
||||
xmlHttp=GetXmlHttpObject();
|
||||
if (xmlHttp==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
xmlHttp.open('POST', path, true);
|
||||
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
|
||||
xmlHttp.onreadystatechange = function()
|
||||
{
|
||||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
|
||||
{
|
||||
element.innerHTML = unescape(xmlHttp.responseText);
|
||||
element.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
xmlHttp.send(params);
|
||||
}
|
||||
}
|
||||
|
||||
function hesk_btn(Elem, myClass)
|
||||
{
|
||||
Elem.className = myClass;
|
||||
}
|
||||
|
||||
function hesk_checkPassword(password)
|
||||
{
|
||||
|
||||
var numbers = "0123456789";
|
||||
var lowercase = "abcdefghijklmnopqrstuvwxyz";
|
||||
var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
var punctuation = "!.@$L#*()%~<>{}[]";
|
||||
|
||||
var combinations = 0;
|
||||
|
||||
if (hesk_contains(password, numbers) > 0) {
|
||||
combinations += 10;
|
||||
}
|
||||
|
||||
if (hesk_contains(password, lowercase) > 0) {
|
||||
combinations += 26;
|
||||
}
|
||||
|
||||
if (hesk_contains(password, uppercase) > 0) {
|
||||
combinations += 26;
|
||||
}
|
||||
|
||||
if (hesk_contains(password, punctuation) > 0) {
|
||||
combinations += punctuation.length;
|
||||
}
|
||||
|
||||
var totalCombinations = Math.pow(combinations, password.length);
|
||||
var timeInSeconds = (totalCombinations / 200) / 2;
|
||||
var timeInDays = timeInSeconds / 86400
|
||||
var lifetime = 3650;
|
||||
var percentage = timeInDays / lifetime;
|
||||
|
||||
var friendlyPercentage = hesk_cap(Math.round(percentage * 100), 98);
|
||||
|
||||
if (friendlyPercentage < (password.length * 5)) {
|
||||
friendlyPercentage += password.length * 5;
|
||||
}
|
||||
|
||||
var friendlyPercentage = hesk_cap(friendlyPercentage, 98);
|
||||
|
||||
var progressBar = document.getElementById("progressBar");
|
||||
progressBar.style.width = friendlyPercentage + "%";
|
||||
|
||||
if (percentage > 1) {
|
||||
// strong password
|
||||
progressBar.classList.remove('progress-bar-danger');
|
||||
progressBar.classList.remove('progress-bar-warning');
|
||||
progressBar.classList.add('progress-bar-success');
|
||||
return;
|
||||
}
|
||||
|
||||
if (percentage > 0.5) {
|
||||
// reasonable password
|
||||
progressBar.classList.remove('progress-bar-danger');
|
||||
progressBar.classList.remove('progress-bar-success');
|
||||
progressBar.classList.add('progress-bar-warning');
|
||||
return;
|
||||
}
|
||||
|
||||
if (percentage > 0.10 || percentage <= 0.10) {
|
||||
// weak password
|
||||
progressBar.classList.remove('progress-bar-warning');
|
||||
progressBar.classList.remove('progress-bar-success');
|
||||
progressBar.classList.add('progress-bar-danger');
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function hesk_cap(number, max) {
|
||||
if (number > max) {
|
||||
return max;
|
||||
} else {
|
||||
return number;
|
||||
}
|
||||
}
|
||||
|
||||
function hesk_contains(password, validChars) {
|
||||
|
||||
count = 0;
|
||||
|
||||
for (i = 0; i < password.length; i++) {
|
||||
var char = password.charAt(i);
|
||||
if (validChars.indexOf(char) > -1) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
function setCookie(name, value, expires, path, domain, secure)
|
||||
{
|
||||
document.cookie= name + "=" + escape(value) +
|
||||
((expires) ? "; expires=" + expires.toGMTString() : "") +
|
||||
((path) ? "; path=" + path : "") +
|
||||
((domain) ? "; domain=" + domain : "") +
|
||||
((secure) ? "; secure" : "");
|
||||
}
|
||||
|
||||
function getCookie(name)
|
||||
{
|
||||
var dc = document.cookie;
|
||||
var prefix = name + "=";
|
||||
var begin = dc.indexOf("; " + prefix);
|
||||
if (begin == -1) {
|
||||
begin = dc.indexOf(prefix);
|
||||
if (begin != 0) return null;
|
||||
} else {
|
||||
begin += 2;
|
||||
}
|
||||
var end = document.cookie.indexOf(";", begin);
|
||||
if (end == -1) {
|
||||
end = dc.length;
|
||||
}
|
||||
return unescape(dc.substring(begin + prefix.length, end));
|
||||
}
|
||||
|
||||
function deleteCookie(name, path, domain)
|
||||
{
|
||||
if (getCookie(name)) {
|
||||
document.cookie = name + "=" +
|
||||
((path) ? "; path=" + path : "") +
|
||||
((domain) ? "; domain=" + domain : "") +
|
||||
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
|
||||
}
|
||||
}
|
382
inc/profile_functions.inc.php
Normal file
382
inc/profile_functions.inc.php
Normal file
@ -0,0 +1,382 @@
|
||||
<?php
|
||||
/*******************************************************************************
|
||||
* Title: Help Desk Software HESK
|
||||
* Version: 2.6.0 beta 1 from 30th December 2014
|
||||
* Author: Klemen Stirn
|
||||
* Website: http://www.hesk.com
|
||||
********************************************************************************
|
||||
* COPYRIGHT AND TRADEMARK NOTICE
|
||||
* Copyright 2005-2014 Klemen Stirn. All Rights Reserved.
|
||||
* HESK is a registered trademark of Klemen Stirn.
|
||||
|
||||
* The HESK may be used and modified free of charge by anyone
|
||||
* AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT.
|
||||
* By using this code you agree to indemnify Klemen Stirn from any
|
||||
* liability that might arise from it's use.
|
||||
|
||||
* Selling the code for this program, in part or full, without prior
|
||||
* written consent is expressly forbidden.
|
||||
|
||||
* Using this code, in part or full, to create derivate work,
|
||||
* new scripts or products is expressly forbidden. Obtain permission
|
||||
* before redistributing this software over the Internet or in
|
||||
* any other medium. In all cases copyright and header must remain intact.
|
||||
* This Copyright is in full effect in any country that has International
|
||||
* Trade Agreements with the United States of America or
|
||||
* with the European Union.
|
||||
|
||||
* Removing any of the copyright notices without purchasing a license
|
||||
* is expressly forbidden. To remove HESK copyright notice you must purchase
|
||||
* a license for this script. For more information on how to obtain
|
||||
* a license please visit the page below:
|
||||
* https://www.hesk.com/buy.php
|
||||
*******************************************************************************/
|
||||
|
||||
/* Check if this is a valid include */
|
||||
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
|
||||
|
||||
|
||||
function hesk_profile_tab($session_array='new',$is_profile_page=true,$action='profile_page')
|
||||
{
|
||||
global $hesk_settings, $hesklang, $can_reply_tickets, $can_view_tickets, $can_view_unassigned;
|
||||
?>
|
||||
<div role="tabpanel">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#profile-info" aria-controls="profile-info" role="tab" data-toggle="tab"><?php echo $hesklang['pinfo']; ?></a></li>
|
||||
<?php
|
||||
if (!$is_profile_page)
|
||||
{
|
||||
?>
|
||||
<li role="presentation"><a href="#permissions" aria-controls="permissions" role="tab" data-toggle="tab"><?php echo $hesklang['permissions']; ?></a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<li role="presentation"><a href="#signature" aria-controls="signature" role="tab" data-toggle="tab"><?php echo $hesklang['sig']; ?></a></li>
|
||||
<li role="presentation"><a href="#preferences" aria-controls="preferences" role="tab" data-toggle="tab"><?php echo $hesklang['pref']; ?></a></li>
|
||||
<li role="presentation"><a href="#notifications" aria-controls="notifications" role="tab" data-toggle="tab"><?php echo $hesklang['notn']; ?></a></li>
|
||||
</ul>
|
||||
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content summaryList tabPadding">
|
||||
<div role="tabpanel" class="tab-pane fade in active" id="profile-info">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-md-3 control-label"><?php echo $hesklang['real_name']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" name="name" size="40" maxlength="50" value="<?php echo $_SESSION[$session_array]['name']; ?>" placeholder="<?php echo $hesklang['real_name']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-md-3 control-label"><?php echo $hesklang['email']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" name="email" size="40" maxlength="255" placeholder="<?php echo $hesklang['email']; ?>" value="<?php echo $_SESSION[$session_array]['email']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if ( ! $is_profile_page || $_SESSION['isadmin']) {
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label for="user" class="col-md-3 control-label"><?php echo $hesklang['username']; ?>: <font
|
||||
class="important">*</font></label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" name="user" size="40" maxlength="20"
|
||||
value="<?php echo $_SESSION[$session_array]['user']; ?>"
|
||||
placeholder="<?php echo $hesklang['username']; ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$passwordRequiredSpan = $action == 'create_user' ? '' : 'display:none';
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label for="pass" class="col-md-3 control-label"><?php echo $is_profile_page ? $hesklang['new_pass'] : $hesklang['pass']; ?>: <span class="important" style="<?php echo $passwordRequiredSpan; ?>">*</span></label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" class="form-control" name="newpass" autocomplete="off" size="40" placeholder="<?php echo $hesklang['pass']; ?>" value="<?php echo $_SESSION[$session_array]['cleanpass']; ?>" onkeyup="javascript:hesk_checkPassword(this.value)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="confirmPass" class="col-md-3 control-label"><?php echo $hesklang['confirm_pass']; ?>: <span class="important" style="<?php echo $passwordRequiredSpan; ?>">*</span></label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" name="newpass2" class="form-control" autocomplete="off" placeholder="<?php echo $hesklang['confirm_pass']; ?>" size="40" value="<?php echo $_SESSION[$session_array]['cleanpass']; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pwStrength" class="col-md-3 control-label"><?php echo $hesklang['pwdst']; ?>:</label>
|
||||
<div class="col-md-9">
|
||||
<div class="progress">
|
||||
<div id="progressBar" class="progress-bar progress-bar-danger" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if ( ! $is_profile_page && $hesk_settings['autoassign']) {
|
||||
?>
|
||||
<div class="blankSpace"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<?php
|
||||
if ($hesk_settings['autoassign']) {
|
||||
?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="autoassign"
|
||||
value="Y" <?php if (!isset($_SESSION[$session_array]['autoassign']) || $_SESSION[$session_array]['autoassign'] == 1) {
|
||||
echo 'checked="checked"';
|
||||
} ?> /> <?php echo $hesklang['user_aa']; ?></label>
|
||||
</div>
|
||||
<?php }
|
||||
if ($_SESSION['can_manage_settings']) { ?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox"
|
||||
name="manage_settings" <?php if (!isset($_SESSION[$session_array]['autoassign']) || $_SESSION[$session_array]['can_manage_settings'] == 1) {
|
||||
echo 'checked="checked"';
|
||||
} ?>> <?php echo $hesklang['can_man_settings']; ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if (!$is_profile_page) {
|
||||
?>
|
||||
<div role="tabpanel" class="tab-pane fade" id="permissions">
|
||||
<div class="form-group">
|
||||
<label for="administrator" class="col-md-3 control-label"><?php echo $hesklang['administrator']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-md-9">
|
||||
<?php
|
||||
/* Only administrators can create new administrator accounts */
|
||||
if ($_SESSION['isadmin'])
|
||||
{
|
||||
?>
|
||||
<div class="radio"><label><input type="radio" name="isadmin" value="1" onchange="Javascript:hesk_toggleLayerDisplay('options')" <?php if ($_SESSION[$session_array]['isadmin']) echo 'checked="checked"'; ?> /> <b><?php echo $hesklang['administrator'].'</b> '.$hesklang['admin_can']; ?></label></div>
|
||||
<div class="radio"><label><input type="radio" name="isadmin" value="0" onchange="Javascript:hesk_toggleLayerDisplay('options')" <?php if (!$_SESSION[$session_array]['isadmin']) echo 'checked="checked"'; ?> /> <b><?php echo $hesklang['astaff'].'</b> '.$hesklang['staff_can']; ?></label></div>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<b>'.$hesklang['astaff'].'</b> '.$hesklang['staff_can'];
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="options" style="display: <?php echo ($_SESSION['isadmin'] && $_SESSION[$session_array]['isadmin']) ? 'none' : 'block'; ?>">
|
||||
<div class="form-group">
|
||||
<label for="categories" class="col-md-3 control-label"><?php echo $hesklang['allowed_cat']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-md-9">
|
||||
<?php
|
||||
foreach ($hesk_settings['categories'] as $catid => $catname)
|
||||
{
|
||||
echo '<div class="checkbox"><label><input type="checkbox" name="categories[]" value="' . $catid . '" ';
|
||||
if ( in_array($catid,$_SESSION[$session_array]['categories']) )
|
||||
{
|
||||
echo ' checked="checked" ';
|
||||
}
|
||||
echo ' />' . $catname . '</label></div> ';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="permissions" class="col-md-3 control-label"><?php echo $hesklang['allow_feat']; ?>: <font class="important">*</font></label>
|
||||
<div class="col-md-9">
|
||||
<?php
|
||||
foreach ($hesk_settings['features'] as $k)
|
||||
{
|
||||
echo '<div class="checkbox"><label><input type="checkbox" name="features[]" value="' . $k . '" ';
|
||||
if (in_array($k,$_SESSION[$session_array]['features']))
|
||||
{
|
||||
echo ' checked="checked" ';
|
||||
}
|
||||
echo ' />' . $hesklang[$k] . '</label></div> ';
|
||||
}
|
||||
?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="can_change_notification_settings" checked> <?php echo $hesklang['can_change_notification_settings']; ?> </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div role="tabpanel" class="tab-pane fade" id="signature">
|
||||
<div class="form-group">
|
||||
<label for="signature" class="col-md-3 control-label"><?php echo $hesklang['signature_max']; ?>:</label>
|
||||
|
||||
<div class="col-md-9">
|
||||
<textarea class="form-control" name="signature" rows="6" placeholder="<?php echo $hesklang['sig']; ?>" cols="40"><?php echo $_SESSION[$session_array]['signature']; ?></textarea>
|
||||
<?php echo $hesklang['sign_extra']; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane fade" id="preferences">
|
||||
<?php
|
||||
if ( ! $is_profile_page || $can_reply_tickets )
|
||||
{
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label for="afterreply" class="col-sm-3 control-label"><?php echo $hesklang['aftrep']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="afterreply" value="0" <?php if (!$_SESSION[$session_array]['afterreply']) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['showtic']; ?></label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="afterreply" value="1" <?php if ($_SESSION[$session_array]['afterreply'] == 1) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['gomain']; ?></label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="afterreply" value="2" <?php if ($_SESSION[$session_array]['afterreply'] == 2) {echo 'checked="checked"';} ?>/> <?php echo $hesklang['shownext']; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo $hesklang['defaults']; ?>:</label>
|
||||
<div class="col-sm-9">
|
||||
<?php
|
||||
if ($hesk_settings['time_worked'])
|
||||
{
|
||||
?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="autostart" value="1" <?php if (!empty($_SESSION[$session_array]['autostart'])) {echo 'checked="checked"';}?> /> <?php echo $hesklang['autoss']; ?></label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="notify_customer_new" value="1" <?php if (!empty($_SESSION[$session_array]['notify_customer_new'])) {echo 'checked="checked"';}?> /> <?php echo $hesklang['pncn']; ?></label><br />
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="notify_customer_reply" value="1" <?php if (!empty($_SESSION[$session_array]['notify_customer_reply'])) {echo 'checked="checked"';}?> /> <?php echo $hesklang['pncr']; ?></label><br />
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="show_suggested" value="1" <?php if (!empty($_SESSION[$session_array]['show_suggested'])) {echo 'checked="checked"';}?> /> <?php echo $hesklang['pssy']; ?></label><br />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="form-group">
|
||||
<label for="autoRefresh" class="col-sm-3 control-label"><?php echo $hesklang['ticket_auto_refresh']; ?></label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" id="autorefresh" name="autorefresh" value="<?php echo $_SESSION[$session_array]['autorefresh']; ?>">
|
||||
<span class="help-block"><?php echo $hesklang['autorefresh_restrictions']; ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane fade" id="notifications">
|
||||
<?php $disabledText = isset($_SESSION[$session_array]['can_change_notification_settings']) && $_SESSION[$session_array]['can_change_notification_settings'] ? '' : 'disabled';
|
||||
if (!$is_profile_page) {
|
||||
$disabledText = '';
|
||||
}
|
||||
if ($disabledText == 'disabled') { ?>
|
||||
<div class="alert alert-info"><?php echo $hesklang['notifications_disabled_info']; ?></div>
|
||||
<?php }
|
||||
?>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
if (! $is_profile_page || $can_view_tickets)
|
||||
{
|
||||
if (! $is_profile_page || $can_view_unassigned)
|
||||
{
|
||||
?>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_new_unassigned" value="1" <?php if (!empty($_SESSION[$session_array]['notify_new_unassigned'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['nwts']; ?> <?php echo $hesklang['unas']; ?></label></div></div>
|
||||
|
||||
<?php
|
||||
if ($disabledText == 'disabled')
|
||||
{ ?>
|
||||
<input type="hidden" name="notify_new_unassigned" value="<?php echo !empty($_SESSION[$session_array]['notify_new_unassigned']) ? '1' : '0'; ?>">
|
||||
<?php }
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<input type="hidden" name="notify_new_unassigned" value="0" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_new_my" value="1" <?php if (!empty($_SESSION[$session_array]['notify_new_my'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['nwts']; ?> <?php echo $hesklang['s_my']; ?></label></div></div>
|
||||
<?php
|
||||
if ($disabledText == 'disabled')
|
||||
{ ?>
|
||||
<input type="hidden" name="notify_new_my" value="<?php echo !empty($_SESSION[$session_array]['notify_new_my']) ? '1' : '0'; ?>">
|
||||
<?php }
|
||||
|
||||
if ( ! $is_profile_page || $can_view_unassigned)
|
||||
{
|
||||
?>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_reply_unassigned" value="1" <?php if (!empty($_SESSION[$session_array]['notify_reply_unassigned'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['ncrt']; ?> <?php echo $hesklang['unas']; ?></label></div></div>
|
||||
<?php
|
||||
if ($disabledText == 'disabled')
|
||||
{ ?>
|
||||
<input type="hidden" name="notify_reply_unassigned" value="<?php echo !empty($_SESSION[$session_array]['notify_reply_unassigned']) ? '1' : '0'; ?>">
|
||||
<?php }
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<input type="hidden" name="notify_reply_unassigned" value="0" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_reply_my" value="1" <?php if (!empty($_SESSION[$session_array]['notify_reply_my'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['ncrt']; ?> <?php echo $hesklang['s_my']; ?></label></div></div>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_assigned" value="1" <?php if (!empty($_SESSION[$session_array]['notify_assigned'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['ntam']; ?></label></div></div>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_note" value="1" <?php if (!empty($_SESSION[$session_array]['notify_note'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['ntnote']; ?></label></div></div>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_pm" value="1" <?php if (!empty($_SESSION[$session_array]['notify_pm'])) {echo 'checked="checked"';} echo ' '.$disabledText ?> /> <?php echo $hesklang['npms']; ?></label></div></div>
|
||||
<?php
|
||||
if ($disabledText == 'disabled')
|
||||
{ ?>
|
||||
<input type="hidden" name="notify_reply_my" value="<?php echo !empty($_SESSION[$session_array]['notify_reply_my']) ? '1' : '0'; ?>">
|
||||
<input type="hidden" name="notify_assigned" value="<?php echo !empty($_SESSION[$session_array]['notify_assigned']) ? '1' : '0'; ?>">
|
||||
<input type="hidden" name="notify_note" value="<?php echo !empty($_SESSION[$session_array]['notify_note']) ? '1' : '0'; ?>">
|
||||
<input type="hidden" name="notify_pm" value="<?php echo !empty($_SESSION[$session_array]['notify_pm']) ? '1' : '0'; ?>">
|
||||
<?php }
|
||||
|
||||
if ($_SESSION['isadmin']) { ?>
|
||||
<div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_note_unassigned" value="1" <?php if (!empty($_SESSION[$session_array]['notify_note_unassigned'])) {echo 'checked="checked"';}?>> <?php echo $hesklang['notify_note_unassigned']; ?></label></div> </div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<?php
|
||||
if ($action == 'profile_page')
|
||||
{ ?>
|
||||
<input type="submit" class="btn btn-default" value="<?php echo $hesklang['update_profile']; ?>" />
|
||||
<?php
|
||||
} elseif ($action == 'create_user')
|
||||
{ ?>
|
||||
<input type="hidden" name="a" value="new" />
|
||||
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
|
||||
<input type="submit" value="<?php echo $hesklang['create_user']; ?>" class="btn btn-default">
|
||||
<a href="manage_users.php?a=reset_form" class="btn btn-danger"><?php echo $hesklang['refi']; ?></a></p>
|
||||
<?php
|
||||
} elseif ($action == 'edit_user')
|
||||
{ ?>
|
||||
<input type="hidden" name="a" value="save" />
|
||||
<input type="hidden" name="userid" value="<?php echo intval( hesk_GET('id') ); ?>" />
|
||||
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
|
||||
<input class="btn btn-default" type="submit" value="<?php echo $hesklang['save_changes']; ?>" />
|
||||
<a class="btn btn-danger" href="manage_users.php"><?php echo $hesklang['dich']; ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script language="Javascript" type="text/javascript"><!--
|
||||
hesk_checkPassword(document.form1.newpass.value);
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<?php
|
||||
} // END hesk_profile_tab()
|
Loading…
x
Reference in New Issue
Block a user