File: 1.19.3a/server/web/group.php (View as HTML)

  1: <?php
  2: /* -------------------------------------------------------------
  3: This file is part of FreeNATS
  4: 
  5: FreeNATS is (C) Copyright 2008-2017 PurplePixie Systems
  6: 
  7: FreeNATS is free software: you can redistribute it and/or modify
  8: it under the terms of the GNU General Public License as published by
  9: the Free Software Foundation, either version 3 of the License, or
 10: (at your option) any later version.
 11: 
 12: FreeNATS is distributed in the hope that it will be useful,
 13: but WITHOUT ANY WARRANTY; without even the implied warranty of
 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 15: GNU General Public License for more details.
 16: 
 17: You should have received a copy of the GNU General Public License
 18: along with Foobar.  If not, see www.gnu.org/licenses
 19: 
 20: For more information see www.purplepixie.org/freenats
 21: -------------------------------------------------------------- */
 22: 
 23: ob_start();
 24: require("include.php");
 25: $NATS->Start();
 26: if (!$NATS_Session->Check($NATS->DB))
 27: 	{
 28: 	header("Location: ./?login_msg=Invalid+Or+Expired+Session");
 29: 	exit();
 30: 	}
 31: if ($NATS_Session->userlevel<1) UL_Error("View Group");
 32: 
 33: if (!$NATS->isUserAllowedGroup($NATS_Session->username,$_REQUEST['groupid']))
 34: 	UL_Error("View Group");
 35: 
 36: ob_end_flush();
 37: Screen_Header("Viewing Group",1);
 38: ?>
 39: <br>
 40: <?php
 41: 
 42: $q="SELECT * FROM fngroup WHERE groupid=\"".ss($_REQUEST['groupid'])."\" LIMIT 0,1";
 43: $r=$NATS->DB->Query($q);
 44: if (!$row=$NATS->DB->Fetch_Array($r))
 45: 	{
 46: 	echo "No such group.<br><br>";
 47: 	Screen_Footer();
 48: 	exit();
 49: 	}
 50: $NATS->DB->Free($r);
 51: 
 52: echo "<table border=0><tr><td align=left valign=top>";
 53: 
 54: echo "<b class=\"minortitle\">Group: ".$row['groupname']."</b><br><br>";
 55: 
 56: echo "<table class=\"nicetable\">";
 57: 
 58: echo "<tr><td align=right>
 59: Group Name
 60: :</td><td align=left>";
 61: echo $row['groupname'];
 62: echo "</td></tr>";
 63: 
 64: echo "<tr><td align=right>
 65: Description
 66: :</td><td align=left>";
 67: echo $row['groupdesc'];
 68: echo "</td></tr>";
 69: 
 70: echo "<tr><td align=right>
 71: Status
 72: :</td><td align=left>";
 73: $al=$NATS->GroupAlertLevel($_REQUEST['groupid']);
 74: echo "<b class=\"al".$al."\">";
 75: echo oText($al);
 76: echo "</b>";
 77: echo "</td></tr>";
 78: 
 79: if ($NATS_Session->userlevel>4) 
 80: 	echo "<tr><td align=right>Settings :</td><td align=left><a href=group.edit.php?groupid=".$_REQUEST['groupid'].">Group Options</a></td></tr>";
 81: 
 82: echo "</table>";
 83: echo "</td><td style=\"width: 50px;\">&nbsp;</td><td align=left valign=top>";
 84: ng_tiny($_REQUEST['groupid'],$row['groupname']);
 85: echo "</td></tr></table>";
 86: 
 87: echo "<br><br>";
 88: echo "<table border=0>";
 89: $a=0;
 90: //$q="SELECT nodeid FROM fngrouplink WHERE groupid=".ss($_REQUEST['groupid']);
 91: $q="select fngrouplink.nodeid as nodeid from fngrouplink left join fnnode on fngrouplink.nodeid=fnnode.nodeid where fngrouplink.groupid=".ss($_REQUEST['groupid'])." order by fnnode.weight";
 92: $r=$NATS->DB->Query($q);
 93: while ($row=$NATS->DB->Fetch_Array($r))
 94: 	{
 95: 	if ($a==0) echo "<tr>";
 96: 	echo "<td>";
 97: 	np_tiny($row['nodeid']);
 98: 	echo "</td>";
 99: 	$a++;
100: 	if ($a>=5) 
101: 		{
102: 		echo "</tr>";
103: 		$a=0;
104: 		}
105: 	}
106: if ($a>0) echo "</tr>";
107: /*
108: if ($a>0) // otherwise at the first row anyway
109: 	{
110: 	while ($a<5)
111: 		{
112: 		echo "<td>&nbsp;</td>";
113: 		$a++;
114: 		}
115: 	echo "</tr>";
116: 	}
117: */
118: echo "</table>";
119: 
120: ?>
121: 
122: 
123: <?php
124: Screen_Footer();
125: ?>
126: