Location: PHPKode > projects > Helpdesk Solutions > helpdesk/scripts/admin/admin_security.php
<?
include($DOCUMENT_ROOT.'/helpdesk/include/database.php');
include($DOCUMENT_ROOT.'/helpdesk/include/new_user.php');

session_start();

if ($valid != "yes") {
	header("Location: /helpdesk/login.php");
	exit;
}

$head = "Name the Security Levels";
$bttm_menu = " &nbsp;&nbsp;<a class=bttm_menu href='/helpdesk/scripts/main_adminmenu.php'>Main Menu</a>&nbsp;&nbsp;|
				&nbsp;&nbsp;<a class=bttm_menu href='/helpdesk/scripts/admin/admin_menu.php'>Prefs Menu</a>&nbsp;&nbsp;|
				&nbsp;&nbsp;<a class=bttm_menu href='/helpdesk/logout.php'>Log Out</a>&nbsp;&nbsp;|
";

if ($submit) {
	//Check there are no blank fields
	if ((!$lev1) || (!$lev2) || (!$lev3) || (!$lev4) || (!$lev5)) {
		$warning = "<td class=warning>** One of the fields is blank. Please ensure there is a name in each field";
	} else {
		//Update the fields with the new names
		$sql1 = "UPDATE permissions SET per_name = '$lev1' WHERE per_level = '1'";
		$sql2 = "UPDATE permissions SET per_name = '$lev2' WHERE per_level = '2'";
		$sql3 = "UPDATE permissions SET per_name = '$lev3' WHERE per_level = '3'";
		$sql4 = "UPDATE permissions SET per_name = '$lev4' WHERE per_level = '4'";
		$sql5 = "UPDATE permissions SET per_name = '$lev5' WHERE per_level = '5'";
		$result=mysql_query($sql1,$conn);
		$result=mysql_query($sql2,$conn);
		$result=mysql_query($sql3,$conn);
		$result=mysql_query($sql4,$conn);
		$result=mysql_query($sql5,$conn);
		$warning = "<td class=success>** Changes have now been saved!";
	}
}

$head = "Security Levels";

// Get names from database

$sql = "SELECT per_level, per_name FROM permissions";
$result = db_query2($sql,$conn);

while ($row = mysql_fetch_array($result)) {
	$level = $row['per_level'];
	$name_temp = $row['per_name'];

	$table .= "<tr class=standard_2><td nowrap class=redtext>Level $level<td> - <td><input type=text name=lev$level value=\"$name_temp\" size=20 maxlength=20>";
}




$bottom = "
<h1>Security Levels Setup</h1>

This allows you to change the name of each security level.<br>
<br>
<b>Key:</b><br>
<table>
<tr class=standard><td valign=top nowrap class=redtext>Level 1<td valign=top>-<td class=bluetext>Is the top security clearence. The level required to change all the site settings.
<tr class=standard><td valign=top nowrap class=redtext>Level 2<td valign=top>-<td class=bluetext>For Assistant Admins who will be able to change various settings such as adding Users, Knowledgebase management, Forum management etc.
<tr class=standard><td valign=top nowrap class=redtext>Level 3<td valign=top>-<td class=bluetext>For IT Support Personal who need to only manage their helpdesk requests.
<tr class=standard><td valign=top nowrap class=redtext>Level 4<td valign=top>-<td class=bluetext>Advanced Users - Those who will need to be allowed to add their own (departmental) documentation to the knowledgebase.
<tr class=standard><td valign=top nowrap class=redtext>Level 5<td valign=top>-<td class=bluetext>Normal Users - Those who need to add their own helpdesk requests and view knowledgebase articles.

</table>
<br><br>
<b>Modify level names:</b><br>
<br>
<form method=post action='$phpself'>
<table>
$table

<tr><td colspan=3><br><input type=submit name=submit value='Save Changes'>
</table>
</form>


";


include($DOCUMENT_ROOT.'/helpdesk/include/template.inc.php');
?>
Return current item: Helpdesk Solutions