2008-03-09 22:49:53 +00:00
|
|
|
<?php
|
|
|
|
echo("<div style='margin: 10px'>");
|
|
|
|
echo("<h3>User Preferences</h3>");
|
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
if ($_POST['action'] == "changepass")
|
|
|
|
{
|
|
|
|
if (authenticate($_SESSION['username'],$_POST['old_pass']))
|
|
|
|
{
|
|
|
|
if ($_POST['new_pass'] == "" || $_POST['new_pass2'] == "")
|
2010-06-21 15:39:43 +00:00
|
|
|
{
|
|
|
|
$changepass_message = "Password must not be blank.";
|
|
|
|
}
|
2011-03-17 00:09:20 +00:00
|
|
|
elseif ($_POST['new_pass'] == $_POST['new_pass2'])
|
2010-06-21 15:39:43 +00:00
|
|
|
{
|
|
|
|
changepassword($_SESSION['username'],$_POST['new_pass']);
|
2011-03-17 00:09:20 +00:00
|
|
|
$changepass_message = "Password Changed.";
|
|
|
|
}
|
|
|
|
else
|
2010-06-21 15:39:43 +00:00
|
|
|
{
|
|
|
|
$changepass_message = "Passwords don't match.";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$changepass_message = "Incorrect password";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-03-17 20:26:29 +00:00
|
|
|
include("includes/update-preferences-password.inc.php");
|
2008-03-09 22:49:53 +00:00
|
|
|
|
|
|
|
echo("<div style='width: 800px; background-color: #fff; padding:5px; margin-bottom:10px; float:left;'>");
|
|
|
|
echo("</div>");
|
|
|
|
|
|
|
|
echo("<div style='width: 300px; float: right;'>");
|
|
|
|
echo("<div style='background-color: #e5e5e5; border: solid #e5e5e5 10px; margin-bottom:10px;'>");
|
|
|
|
|
2010-06-21 16:01:04 +00:00
|
|
|
if (passwordscanchange())
|
|
|
|
{
|
|
|
|
echo("<div style='font-size: 18px; font-weight: bold; margin-bottom: 5px;'>Change Password</div>");
|
|
|
|
echo($changepass_message);
|
2011-04-06 13:54:50 +00:00
|
|
|
echo("<form method='post' action='".$config['base_url']."/preferences/'><input type=hidden name='action' value='changepass'>
|
2008-03-09 22:49:53 +00:00
|
|
|
<table>
|
2009-03-17 20:26:29 +00:00
|
|
|
<tr><td>Old Password</td><td><input type=password name=old_pass autocomplete='off'></input></td></tr>
|
|
|
|
<tr><td>New Password</td><td><input type=password name=new_pass autocomplete='off'></input></td></tr>
|
|
|
|
<tr><td>New Password</td><td><input type=password name=new_pass2 autocomplete='off'></input></td></tr>
|
2010-02-07 14:17:02 +00:00
|
|
|
<tr><td></td><td align=right><input type=submit class=submit></td></tr></table></form>");
|
2010-06-21 16:01:04 +00:00
|
|
|
echo("</div>");
|
|
|
|
}
|
2008-03-09 22:49:53 +00:00
|
|
|
|
|
|
|
echo("<div style='background-color: #e5e5e5; border: solid #e5e5e5 10px; margin-bottom:10px;'>");
|
2009-03-17 20:26:29 +00:00
|
|
|
echo("<div style='font-size: 18px; font-weight: bold; margin-bottom: 5px;'>Device Permissions</div>");
|
2008-03-09 22:49:53 +00:00
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
if ($_SESSION['userlevel'] == '10') { echo("<strong class='blue'>Global Administrative Access</strong>"); }
|
|
|
|
if ($_SESSION['userlevel'] == '5') { echo("<strong class='green'>Global Viewing Access</strong>"); }
|
2011-04-06 13:54:50 +00:00
|
|
|
if ($_SESSION['userlevel'] == '1')
|
|
|
|
{
|
2008-03-09 22:49:53 +00:00
|
|
|
$perms = mysql_query("SELECT * FROM `devices_perms` AS P, `devices` AS D WHERE `user_id` = '" . $user_id . "' AND P.device_id = D.device_id");
|
|
|
|
|
2011-04-06 13:54:50 +00:00
|
|
|
while ($perm = mysql_fetch_assoc($perms))
|
2011-03-17 00:09:20 +00:00
|
|
|
{
|
2008-03-09 22:49:53 +00:00
|
|
|
echo("<a href='?page=device&id=" . $perm['device_id'] . "'>" . $perm['hostname'] . "</a><br />");
|
|
|
|
$dev_access = 1;
|
|
|
|
}
|
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
if (!$dev_access) { echo("No access!"); }
|
|
|
|
}
|
2008-03-09 22:49:53 +00:00
|
|
|
|
|
|
|
echo("</div>");
|
|
|
|
echo("</div>");
|
|
|
|
echo("</div>");
|
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
?>
|