Viewing File server/web/group.edit.php of 1.14.1a
|
1: <?php 2: /* ------------------------------------------------------------- 3: This file is part of FreeNATS 4: 5: FreeNATS is (C) Copyright 2008-2010 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 FreeNATS. 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<5) UL_Error($NATS->Lang->Item("group.editor")); 32: ob_end_flush(); 33: Screen_Header($NATS->Lang->Item("group.editor"),1,1,"","main","groups"); 34: echo "\n<script type=\"text/javascript\">\n"; 35: echo "var iconDivText='"; 36: ShowIcons(); 37: echo "';\n\n"; 38: echo "function showIcons()\n"; 39: echo "{\n"; 40: echo "document.getElementById('iconDiv').innerHTML='<br><br>'+iconDivText+'<br><br>';\n"; 41: echo "}\n"; 42: echo "</script>\n\n"; 43: ?> 44: <br> 45: <?php 46: 47: $q="SELECT * FROM fngroup WHERE groupid=".ss($_REQUEST['groupid'])." LIMIT 0,1"; 48: $r=$NATS->DB->Query($q); 49: if (!$row=$NATS->DB->Fetch_Array($r)) 50: { 51: echo $NATS->Lang->Item("no.group")."<br><br>"; 52: Screen_Footer(); 53: exit(); 54: } 55: $NATS->DB->Free($r); 56: echo "<b class=\"subtitle\">".$NATS->Lang->Item("editing")." <a href=main.php?mode=groups>".$NATS->Lang->Item("editing")."</a>:"; 57: echo " <a href=group.php?groupid=".$_REQUEST['groupid'].">".$row['groupname']."</a></b><br><br>"; 58: 59: $t="<b class=\"sectitle\">".$NATS->Lang->Item("group.settings")."</b>"; 60: Start_Round($t,600); 61: echo "<table border=0 width=100%>"; 62: echo "<form action=group.action.php method=post>"; 63: echo "<input type=hidden name=action value=save_edit>"; 64: echo "<input type=hidden name=groupid value=".$_REQUEST['groupid'].">"; 65: 66: 67: echo "<tr><td align=right>"; 68: echo $NATS->Lang->Item("group.id"); 69: echo " :</td><td align=left>"; 70: echo $row['groupid']; 71: echo "</td></tr>"; 72: 73: echo "<tr><td align=right>"; 74: echo $NATS->Lang->Item("group.name"); 75: echo " :</td><td align=left>"; 76: echo "<input type=text name=groupname size=20 maxlength=120 value=\"".$row['groupname']."\">"; 77: echo "</td></tr>"; 78: 79: echo "<tr><td align=right>"; 80: echo $NATS->Lang->Item("description"); 81: echo " :</td><td align=left>"; 82: echo "<input type=text name=groupdesc size=30 maxlength=200 value=\"".$row['groupdesc']."\">"; 83: echo "</td></tr>"; 84: 85: echo "<tr><td align=right>"; 86: echo $NATS->Lang->Item("group.icon"); 87: echo " :</td><td align=left>"; 88: echo "<select name=groupicon>"; 89: if ($row['groupicon']!="") echo "<option value=\"".$row['groupicon']."\">".$row['groupicon']."</option>"; 90: echo "<option value=\"\">Default</option>"; 91: $iconList=GetIcons(); 92: foreach($iconList as $icon) 93: echo "<option value=\"".$icon."\">".$icon."</option>"; 94: //echo "</select> [ <a href=group.edit.php?groupid=".$_REQUEST['groupid']."&show_icons=1>Show Icons</a> ]"; 95: echo "</select> [ <a href=\"javascript:showIcons()\">".$NATS->Lang->Item("show.icons")."</a> ]"; 96: echo "</td></tr>"; 97: 98: 99: echo "<tr><td colspan=2>"; 100: echo "<input type=submit value=\"".$NATS->Lang->Item("group.save")."\"> <a href=main.php>".$NATS->Lang->Item("cancel")."</a>"; 101: echo "<br><br>"; 102: echo "</td></tr>"; 103: echo "</form>"; 104: echo "</table>"; 105: End_Round(); 106: 107: if (isset($_REQUEST['show_icons'])) 108: { 109: echo "<tr><td colspan=2 align=left valign=top><br><br>"; 110: ShowIcons(); 111: echo "<br><br></td></tr>"; 112: } 113: 114: echo "<div id=\"iconDiv\"></div>"; 115: 116: echo "<br>"; 117: $t="<b class=\"sectitle\">".$NATS->Lang->Item("group.members")."</b>"; 118: Start_Round($t,600); 119: 120: echo "<table border=0 width=100%><form action=group.action.php>"; 121: echo "<input type=hidden name=groupid value=".$_REQUEST['groupid'].">"; 122: echo "<input type=hidden name=action value=save_members>"; 123: $q="SELECT nodeid,nodename FROM fnnode ORDER BY weight ASC"; 124: $r=$NATS->DB->Query($q); 125: $c=0; 126: while ($row=$NATS->DB->Fetch_Array($r)) 127: { 128: // has link? 129: $lq="SELECT glid FROM fngrouplink WHERE groupid=\"".ss($_REQUEST['groupid'])."\" AND nodeid=\"".ss($row['nodeid'])."\" LIMIT 0,1"; 130: $lr=$NATS->DB->Query($lq); 131: if ($NATS->DB->Num_Rows($lr)>0) $s=" checked"; 132: else $s=""; 133: $NATS->DB->Free($lr); 134: echo "<tr><td><input type=checkbox name=\"members[".$c++."]\" value=\"".$row['nodeid']."\"".$s.">"; 135: echo "</td><td>".$row['nodeid']." - ".$row['nodename']."</td></tr>"; 136: } 137: $NATS->DB->Free($r); 138: echo "<tr><td colspan=\"2\"><input type=submit value=\"".$NATS->Lang->Item("group.update")."\"></td></tr>"; 139: echo "</form></table>"; 140: End_Round(); 141: ?> 142: 143: 144: <?php 145: Screen_Footer(); 146: ?> 147: