HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/awaldron/www/archive/demo/admin/boards_permissions.php
<?php
session_start();
include("../_functions.php");
dbconnect();
if (!is_logged()) auto_login();

echo "<html>\n";
echo "<head>\n";
echo "<title>".COMPANY_NAME." : Manage Noticeboard Permissions</title>\n";
	echo "<script language=\"JavaScript\" type=\"text/javascript\">\n";
	echo "<!--\n";
	echo "function openWindow(theURL,winName,features) { //v2.0\n";
	echo "	window.open(theURL,winName,features);\n";
	echo "}\n";
	echo "function confirm_delete(id,pg) {\n";
	echo "  input_box=confirm(\"Are you sure you want to delete this user from this Permissions Group?\");\n";
	echo "  if (input_box==true) {\n";
	echo "    self.location=\"boards_permissions.php?id=".$_GET["id"]."&del=\"+id+\"&pg=\"+pg;\n";
	echo "  }\n";
	echo "}\n";
	echo "-->\n";
	echo "</script>\n";
echo "</head>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../default.css\">\n";
echo "<body style=\"margin:15px;\">\n";

// Get Noticeboard Info
$sql = "SELECT * FROM tbl_notice_types WHERE notice_type_id=".$_GET["id"];
$res = mysql_query($sql);
extract(mysql_fetch_array($res));


// Build $user_select Options
$user_select = "<option></option>\n";
$sql = "SELECT username FROM tbl_employees WHERE is_employee=1 ORDER BY lname ASC";
$res = mysql_query($sql);
for ($i=0; $i < mysql_num_rows($res); $i++) {
	$user = mysql_fetch_array($res);
	$user_select .= "<option value=\"".$user["username"]."\">".get_user($user["username"],"fullname2")."</option>\n";
}


if (!admin_panel($_SESSION["auth_user"])) {
	echo "<br><br><br><br>".error("You must be logged in to access the administration panel!");
} else {
	
	if (isset($_GET["del"])) {
		quickUPDATE("DELETE FROM tbl_pgroup_user WHERE username='".$_GET["del"]."' AND pgroup_id=".$_GET["pg"]);
	}	
	if (isset($_POST["add"])) {
		quickUPDATE("INSERT INTO tbl_pgroup_user (pgroup_id,username) VALUES (".$_POST["pgroup_id"].",'".$_POST["adduser"]."')");
	}
	
	echo "<P><img src=\"/gui/icons/cog.gif\" align=\"left\">\n";
	echo "<div class=\"headline\">Manage Noticeboard Permissions</div>\n";
	echo "<P>Use this form to Manage Permissions related to this Noticeboard or Discussion Forum.\n";
	echo "<br><br><br><br>\n";
	echo "<div class=\"subhead\">".$notice_type_name."</div>\n";
	
	//ECHO INDIVIDUALS
	$sql = "SELECT username FROM tbl_pgroup_user WHERE pgroup_id=".$board_admins; 	
	$res = mysql_query($sql);
	
	echo "<P><table class=\"textdn\" border=0 style=\"margin-left:25px\">\n";
	echo "<tr><td valign=\"top\"><b>Administrators&nbsp;:&nbsp;</b></td><td style=\"line-height:18px;\">";
	for ($i=0; $i < mysql_num_rows($res); $i++) {
		$row = mysql_fetch_array($res);
		if ($i != 0) echo "<br>";
		echo "".get_user($row["username"],"fullname")." <a href=\"javascript:confirm_delete('".$row["username"]."',".$board_admins.")\" style=\"color:DD0000\">(X)</a>";
	} if (mysql_num_rows($res) == 0) echo "None";
	echo "</td></tr>\n";
	
	echo "<form action=\"boards_permissions.php?id=".$_GET["id"]."\" method=\"post\">\n";
	echo "<input type=\"hidden\" value=\"add\">\n";
	echo "<input type=\"hidden\" name=\"pgroup_id\" value=\"".$board_admins."\">\n";
	echo "<tr><td><b>Add Admin&nbsp;:&nbsp;</b></td><td>";
	echo "<SELECT name=\"adduser\">\n";
	echo $user_select;
	echo "</SELECT> <input type=\"submit\" name=\"add\" value=\"Add User\">\n";
	echo "</td></tr></form>\n";
	echo "</table>\n";		
	
	echo "<br><br><br><center><a href=\"boards_manage.php\">Back to Noticeboard Manager</a></center>\n";

	echo "<br><br><br><br>\n";
	echo "<center>Powered by <a href=\"http://www.intrabreeze.com\">IntraBreeze</a> &copy; 2005 IntraBreeze, LLC</center>\n";
}

echo "</body>\n</html>\n";
?>