function networks(){ $page=CurrentPageName(); $networsplus=Paragraphe("64-win-nic-plus.png","{add_network}",'{add_network_text}',"javascript:AddNetwork()","add_network",210); $importArtica=Paragraphe("64-samba-get.png","{import_artica_computers}",'{import_artica_computers_text}',"javascript:ImportComputers('')","import_artica_computers",210); $importList=Paragraphe("64-samba-get.png","{import_artica_computers}",'{import_artica_computers_list_text}',"javascript:ImportListComputers()","import_artica_computers_list_text",210); $sock=new sockets(); $ComputersAllowNmap=$sock->GET_INFO("ComputersAllowNmap"); $ComputersAllowDHCPLeases=$sock->GET_INFO("ComputersAllowDHCPLeases"); if($ComputersAllowNmap==null){$ComputersAllowNmap=1;} if($ComputersAllowDHCPLeases==null){$ComputersAllowDHCPLeases=1;} $autoscan_form=" <table style='width:100%'> <tr> <td valign='top' class=legend>{allow_nmap_scanner}</td> <td valign='top'>". Field_checkbox("ComputersAllowNmap",1,$ComputersAllowNmap,"ComputersAllowNmapCheck()")."</td> </tr> <tr> <td valign='top' class=legend>{allow_parse_dhcp_leases}</td> <td valign='top'>". Field_checkbox("ComputersAllowDHCPLeases",1,$ComputersAllowDHCPLeases,"ComputersAllowDHCPLeasesCheck()")."</td> </tr> </table> "; $articas=artica_import_list(); $height_artica=200; if(strlen($articas)<5){$height_artica=0;} $nets=networkslist(1); $html=" <div id='networks'> <table style='width:100%'> <tr> <td valign='top' width=70%> <div style='width:100%;height:265px;overflow:auto'> <div id='netlist'>$nets</div> </div> $autoscan_form <br> <div style='width:100%;height:{$height_artica}px;overflow:auto'> <div id='articas'>$articas</div> </div> </td> <td valign='top'> $networsplus $importArtica $importList </td> </tr> </table> </div> <script> function ComputersAllowDHCPLeasesCheck(){ var XHR = new XHRConnection(); if(document.getElementById('ComputersAllowDHCPLeases').checked){ XHR.appendData('ComputersAllowDHCPLeases',1);}else{XHR.appendData('ComputersAllowDHCPLeases',0);} XHR.sendAndLoad('$page', 'GET'); } function ComputersAllowNmapCheck(){ var XHR = new XHRConnection(); if(document.getElementById('ComputersAllowNmap').checked){ XHR.appendData('ComputersAllowNmap',1);}else{XHR.appendData('ComputersAllowNmap',0);} XHR.sendAndLoad('$page', 'GET') } </script> "; $tpl=new templates(); echo $tpl->_ENGINE_parse_body($html); }
function networks() { $networsplus = Paragraphe("64-win-nic-plus.png", "{add_network}", '{add_network_text}', "javascript:AddNetwork()", "add_network", 210); $importArtica = Paragraphe("64-samba-get.png", "{import_artica_computers}", '{import_artica_computers_text}', "javascript:ImportComputers('')", "import_artica_computers", 210); $importList = Paragraphe("64-samba-get.png", "{import_artica_computers}", '{import_artica_computers_list_text}', "javascript:ImportListComputers()", "import_artica_computers_list_text", 210); $articas = artica_import_list(); $nets = networkslist(1); $html = "<H1>{edit_networks}</H1>\n\t<div id='networks'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=70%>\n\t\t\t<div style='width:100%;height:200px;overflow:auto'>\n\t\t\t\t" . RoundedLightWhite("<div id='netlist'>{$nets}</div>") . "\n\t\t\t</div>\n\t\t\t<br>\n\t\t\t<div style='width:100%;height:200px;overflow:auto'>\n\t\t\t\t" . RoundedLightWhite("<div id='articas'>{$articas}</div>") . "\n\t\t\t</div>\t\n\t\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t</td>\n\t\t<td valign='top'>\n\t\t{$networsplus}\n\t\t{$importArtica}\n\t\t{$importList}\n\t\t</td>\n\t</tr>\n\t</table>\n\t</div>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function networks() { $page = CurrentPageName(); $tpl = new templates(); $networsplus = Paragraphe("64-win-nic-plus.png", "{add_network}", '{add_network_text}', "javascript:AddNetwork()", "add_network", 210); $importArtica = Paragraphe("64-samba-get.png", "{import_artica_computers}", '{import_artica_computers_text}', "javascript:ImportComputers('')", "import_artica_computers", 210); $importList = Paragraphe("64-samba-get.png", "{import_artica_computers}", '{import_artica_computers_list_text}', "javascript:ImportListComputers()", "import_artica_computers_list_text", 210); $networks = $tpl->_ENGINE_parse_body("{networks}"); $import_artica_computers = $tpl->_ENGINE_parse_body("{import_artica_computers}"); $sock = new sockets(); $ComputersAllowNmap = $sock->GET_INFO("ComputersAllowNmap"); $ComputersAllowDHCPLeases = $sock->GET_INFO("ComputersAllowDHCPLeases"); $EnableArpDaemon = $sock->GET_INFO("EnableArpDaemon"); if (!is_numeric($ComputersAllowNmap)) { $ComputersAllowNmap = 1; } if (!is_numeric($ComputersAllowDHCPLeases)) { $ComputersAllowDHCPLeases = 1; } if (!is_numeric($EnableArpDaemon)) { $EnableArpDaemon = 1; } $autoscan_form = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' class=legend><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('nmap.index.php');\" class=legend style='text-decoration:underline'>{allow_nmap_scanner}</a></td>\n\t\t<td valign='top'>" . Field_checkbox("ComputersAllowNmap", 1, $ComputersAllowNmap, "ComputersAllowNmapCheck()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' class=legend>{allow_parse_dhcp_leases}</td>\n\t\t<td valign='top'>" . Field_checkbox("ComputersAllowDHCPLeases", 1, $ComputersAllowDHCPLeases, "ComputersAllowDHCPLeasesCheck()") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td valign='top' class=legend>{EnableArpDaemon}</td>\n\t\t<td valign='top'>" . Field_checkbox("EnableArpDaemon", 1, $EnableArpDaemon, "EnableArpDaemonCheck()") . "</td>\n\t</tr>\t\n\t</table>\n\t\n\t"; $users = new usersMenus(); $articas = artica_import_list(); $height_artica = 200; if (strlen($articas) < 5) { $height_artica = 0; } $NMAP_INSTALLED = 1; $ARPD_INSTALLED = 1; if (!$users->nmap_installed) { $NMAP_INSTALLED = 0; } if (!$users->ARPD_INSTALLED) { $ARPD_INSTALLED = 0; } $html = "\n\t<div id='networks'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=70%>\n\t\t\t<div style='width:100%;height:265px;overflow:auto'>\n\t\t\t\t<div id='netlist'></div>\n\t\t\t\t\n\t\t\t</div>\n\t\t\t{$autoscan_form}\n\t\t\t<br>\n\t\t\t<div style='width:100%;height:{$height_artica}px;overflow:auto'>\n\t\t\t\t<div id='articas'>{$articas}</div>\n\t\t\t</div>\t\n\t\t</td>\n\t\t<td valign='top'>\n\t\t{$networsplus}\n\t\t{$importArtica}\n\t\t{$importList}\n\t\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t\n\t<script>\n\t\tfunction AddNetwork(){\n\t\t\tYahooWin3(450,'{$page}?browse-networks-add=yes','{$networks}');\n\t\t}\n\t\t\n\t\tfunction ImportComputers(ip){\n\t\t\tYahooWin3('450','{$page}?artica-import-popup=yes&ip='+ip,'{$import_artica_computers}');\n\t\t\n\t\t}\t\t\n\t\t\n\tfunction ImportListComputers(){\n\t\tYahooWin3('450','{$page}?artica-importlist-popup=yes','{$import_artica_computers}');\n\t\n\t}\n\n\t\tfunction EnableArpDaemonCheck(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(document.getElementById('EnableArpDaemon').checked){\n\t\t\tXHR.appendData('EnableArpDaemon',1);}else{XHR.appendData('EnableArpDaemon',0);}\n\t\t\tXHR.sendAndLoad('{$page}', 'GET'); \n\t\t}\t\n\t\n\t\n\t\tfunction ComputersAllowDHCPLeasesCheck(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(document.getElementById('ComputersAllowDHCPLeases').checked){\n\t\t\tXHR.appendData('ComputersAllowDHCPLeases',1);}else{XHR.appendData('ComputersAllowDHCPLeases',0);}\n\t\t\tXHR.sendAndLoad('{$page}', 'GET'); \n\t\t}\n\t\t\n\t\tfunction ComputersAllowNmapCheck(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(document.getElementById('ComputersAllowNmap').checked){\n\t\t\tXHR.appendData('ComputersAllowNmap',1);}else{XHR.appendData('ComputersAllowNmap',0);}\n\t\t\tXHR.sendAndLoad('{$page}', 'GET')\t\t\n\t\t}\n\t\t\n\t\tfunction RefreshNetworklist(){\n\t\t\tLoadAjax('netlist','{$page}?networkslist=yes');\n\t\t}\n\t\t\n\tfunction BrowsComputersRefresh(){\n\t\tvar mode='';\n\t\tvar val='';\n\t\tif(document.getElementById('mode')){mode=document.getElementById('mode').value;}\n\t\tif(document.getElementById('value')){val=document.getElementById('value').value;}\n\t\tif(document.getElementById('callback')){callback=document.getElementById('callback').value;}\n\t\tLoadAjax('computerlist','{$page}?computer-refresh=yes&tofind='+document.getElementById('query_computer').value+'&mode={$_GET["mode"]}&{$_GET["value"]}&callback={$_GET["callback"]}');\n\t\n\t}\t\t\n\t\n\tfunction CheckNmap(){\n\t\tvar NMAP_INSTALLED={$NMAP_INSTALLED};\n\t\tvar ARPD_INSTALLED={$ARPD_INSTALLED};\n\t\tdocument.getElementById('ComputersAllowNmap').disabled=true;\n\t\tdocument.getElementById('EnableArpDaemon').disabled=true;\n\t\tif(NMAP_INSTALLED==1){document.getElementById('ComputersAllowNmap').disabled=false;}\n\t\tif(ARPD_INSTALLED==1){document.getElementById('EnableArpDaemon').disabled=false;}\n\t\n\t}\n\tCheckNmap();\n\tRefreshNetworklist();\n\t</script>\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }