Example #1
0
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.ldap.inc');
	include_once('ressources/class.users.menus.inc');

	$user=new usersMenus();
	if($user->AsSystemAdministrator==false){
		$tpl=new templates();
		echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
		die();exit();
	}

	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["add-form"])){popup_add();exit;}
	if(isset($_GET["ip_addr"])){popup_save();exit;}
	if(isset($_GET["refresh"])){echo getlist();exit;}
	if(isset($_GET["del"])){popup_delete();exit;}
	if(isset($_GET["add-etc-hosts-p"])){Paragraphe_add();exit;}
	if(isset($_GET["DisableEtcHosts"])){DisableEtcHosts_save();exit;}
	js();
	
	
function js(){
	$page=CurrentPageName();
	$tpl=new templates();
	$title=$tpl->_ENGINE_parse_body("{etc_hosts}");
	$title2=$tpl->_ENGINE_parse_body("{add_new_entry}");
	$html="
	
	function etc_host_show(){
			YahooWin3(740,'$page?popup=yes','$title');
	}
Example #2
0
    die;
}
if (isset($_GET["ip"])) {
    popup_add();
    exit;
}
if (isset($_GET["popup"])) {
    popup();
    exit;
}
if (isset($_GET["list"])) {
    echo popup_list();
    exit;
}
if (isset($_GET["delip"])) {
    popup_delete();
    exit;
}
js();
function js()
{
    $page = CurrentPageName();
    $prefix = str_replace('.', '_', $page);
    $prefix = str_replace('-', '', $prefix);
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body('{APP_DHCP_ROUTES_CONF}');
    $html = "\n\tvar {$prefix}timeout=0;\n\tvar {$prefix}timerID  = null;\n\tvar {$prefix}tant=0;\n\tvar {$prefix}reste=0;\t\n\n\n\tfunction {$prefix}LoadPage(){\n\t\tRTMMail(650,'{$page}?popup=yes','{$title}');\n\t}\n\t\nvar x_AddRouteDHCPD= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\tLoadAjax('dhcpdroutes','{$page}?list=yes');\n}\t\t\n\t\n\t\n\tfunction AddRouteDHCPD(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('ip',document.getElementById('dhcpd_ip').value);\n\t\tXHR.appendData('netmask',document.getElementById('dhcpd_netmask').value);\n\t\tXHR.appendData('gateway',document.getElementById('dhcpd_gateway').value);\n\t\tdocument.getElementById('dhcpdroutes').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_AddRouteDHCPD);\t\n\t}\n\t\n\tfunction DHCPDeleteRoute(ip){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('delip',ip);\n\t\tdocument.getElementById('dhcpdroutes').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_AddRouteDHCPD);\t\t\n\t}\n\t\n\t{$prefix}LoadPage();";
    echo $html;
}
function popup_add()
{
Example #3
0
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.ldap.inc');
	include_once('ressources/class.users.menus.inc');

	$user=new usersMenus();
	if($user->AsSystemAdministrator==false){
		$tpl=new templates();
		echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
		die();exit();
	}

	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["add-form"])){popup_add();exit;}
	if(isset($_POST["ip_addr"])){host_add();exit;}
	if(isset($_GET["refresh"])){echo getlist();exit;}
	if(isset($_POST["host-delete"])){popup_delete();exit;}
	if(isset($_GET["table"])){table();exit;}
	if(isset($_GET["add-etc-hosts-p"])){Paragraphe_add();exit;}
	if(isset($_GET["DisableEtcHosts"])){DisableEtcHosts_save();exit;}
	if(isset($_GET["hosts-search"])){hosts_search();exit;}
	if(isset($_POST["rebuild"])){rebuild();exit;}
	js();
	
	
function js(){
	$page=CurrentPageName();
	$tpl=new templates();
	header("content-type: application/x-javascript");
	$title=$tpl->_ENGINE_parse_body("{etc_hosts}");
	echo "YahooWin3(800,'$page?popup=yes','$title',true);";