Exemplo n.º 1
0
function restore_db_file()
{
    $file = $_GET["restore-db-file"];
    $sock = new sockets();
    $datas = $sock->getfile("RecoveryLdapFile:{$file}");
    $tbl = explode("\n", $datas);
    $table = "<table style='width:100%'>";
    while (list($num, $ligne) = each($tbl)) {
        if (trim($ligne) == null) {
            continue;
        }
        $table = $table . "<tr " . CellRollOver_jaune() . ">\n\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t<td><code style='font-size:10px'>{$ligne}</code></td>\n\t\t</tr>";
    }
    $table = "<div style='width:99%;height:300px;overflow:auto'>{$table}</table></div>";
    $table = RoundedLightWhite($table);
    $html = "<H1>{restore_ldap_database} {$file}</H1>\n\t{$table}";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 2
0
function main_update(){
	$sock=new sockets();
	$datas=trim($sock->getFrameWork('cmd.php?aptcheck=yes'));
	$html=main_tabs()."<table style='width:100%'>
	<tr>
	<td valign='top'>
	<H5>{system_update}</H5>";
	
	if(preg_match('#nb:([0-9]+)\s+#is',$datas,$re)){
		$html=$html . RoundedLightYellow("
		<table style='width:100%'>
		<tr>
			<td valign='top' width=1%><img src='img/48-infos.png'></td>
			<td valign='top'>
				<p style='font-size:12px;font-weight:bold'>{$re[1]}&nbsp;{packages_to_upgrade}</p>
			</td>
		</tr>
		</table>");
		$datas=str_replace($re[0],'',$datas);
	}
	
	$html=$html."</td>
	<td valign='top'>".update_Apply_install()."</td>
	</tr>
	</table>";
	
	$tbl=explode("\n",$datas);
	$t="<table style='width:100%'>";
	
	
	while (list ($num, $ligne) = each ($tbl) ){
		if(trim($ligne)<>null){
				$uri="<a href='#' OnClick=\"javascript:PackageInfos('$ligne')\">";
			$t=$t."
			<tr ". CellRollOver_jaune().">
			<td width=1%><img src='img/fw_bold.gif'></td>
			<td width=99% nowrap>$uri$ligne</a></td>
			</tr>";
		}
		
	}
	
	$t=$t . "</table>";
	$t="<div style='width:100%;height:200px;overflow:auto'>$t</div>";
	$t=RoundedLightWhite($t);
	$tpl=new templates();
	return $tpl->_ENGINE_parse_body("$html$t");
	
	
}
Exemplo n.º 3
0
function hostname(){
$nic=new networking();
$nameserver=$nic->arrayNameServers;
$dns_text="<table class=form>";


if(is_array($nameserver)){
	while (list ($num, $val) = each ($nameserver) ){
		$val=trim($val);
		$dns_text=$dns_text."<tr " . CellRollOver_jaune().">
			<td width=1%><img src='img/fw_bold.gif'>
			<td class=legend nowrap>{nameserver}:</td>
			<td width=99% nowrap><strong style='font-size:11px'>$val</strong></td>
			<td width=1%>" . imgtootltip('ed_delete.gif','{delete}',"DeleteDNS('$val');")."</td>
			</tr>";
		
		
	}
}

$dns_text=$dns_text."
<tr>
<td align='right' colspan=4><hr>". button("{add}","AddDNSServer();")."</td>
</tr>
</table>
<br>
<input type='hidden' name='ChangeHostName' id='ChangeHostName' value='{ChangeHostName}'>





<table class=form>
<tr>
	<td class=legend>{hostname}:</td>
	<td><strong style='font-size:12px'><strong>$nic->hostname</strong></td>
	<td width=1%>". button("{apply}","ChangeHostName('$nic->hostname');")."</td>
</tr>
</table>";

$tpl=new templates();
echo $tpl->_ENGINE_parse_body($dns_text);
}
Exemplo n.º 4
0
function main_events_artica_events()
{
    $sock = new sockets();
    $datas = $sock->getfile('aptarticaevents');
    $tbl = explode("\n", $datas);
    if (!is_array($tbl)) {
        return null;
    }
    $tbl = array_reverse($tbl);
    $t = "<table style='width:100%'>";
    while (list($num, $ligne) = each($tbl)) {
        if (trim($ligne) == null) {
            continue;
        }
        $ligne = htmlspecialchars($ligne);
        $t = $t . "\n\t\t\t<tr " . CellRollOver_jaune() . ">\n\t\t\t<td width=1% valign='top'><img src='img/fw_bold.gif'></td>\n\t\t\t<td width=99%><code>{$ligne}</code></a></td>\n\t\t\t</tr>";
    }
    $t = "<div style='width:100%;height:200px;overflow:auto'>{$t}</table></div>";
    $t = RoundedLightWhite($t);
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body("{$t}");
}
Exemplo n.º 5
0
function postfix_regex()
{
    $reg = new main_header_check();
    $hash = $reg->main_table;
    $start = $_GET["start"];
    $end = $_GET["end"];
    $page_number = round(count($hash) / 10);
    if (isset($_GET["search"])) {
        $tofind = $_GET["search"];
        $tbl = $hash;
        unset($hash);
        while (list($num, $ligne) = each($tbl)) {
            if (preg_match("#{$tofind}#", $ligne)) {
                $hash[$num] = $ligne;
                $end = $num;
            }
        }
    }
    if (!is_numeric($start)) {
        $start = 0;
    }
    if (!is_numeric($end)) {
        $end = 10;
    }
    if ($_GET["search"] == null) {
        if (!is_numeric($_GET["page"])) {
            if (isset($_COOKIE["ARTICA-POSTFIX-REGEX-PAGE"])) {
                $_GET["page"] = $_COOKIE["ARTICA-POSTFIX-REGEX-PAGE"];
            }
        }
    }
    if (is_numeric($_GET["page"])) {
        $start = $_GET["page"] * 10;
        $end = $start + 10;
    }
    $html = "\n\t<input type='hidden' id='delete_headers_regex_text' value='{delete_headers_regex_text}'>\n\t<input type='hidden' id='import_headers_regex_text' value='{import_headers_regex_text}'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td><strong>" . count($hash) . " {rules},&nbsp;{$page_number} {pages}&nbsp;&nbsp;&laquo;{page}&nbsp;{$_GET["page"]}&raquo;</strong></td>\n\t<td align='right'>\n\t\t<a href=\"javascript:import_headers_regex()\">\n\t\t{import_headers_regex}</a>&nbsp;" . imgtootltip("icon_newest_reply.gif", '{import_headers_regex}', "import_headers_regex()") . "\n\t</td>\n\t<td align='right'>\n\t\t<a href=\"javascript:delete_headers_regex()\">\n\t\t{delete_headers_regex}</a>&nbsp;" . imgtootltip("x.gif", '{delete_headers_regex}', "delete_headers_regex()") . "\n\t</td>\n\t\t\n\t\n\n\t<td align='right'>" . imgtootltip("add-18.gif", "{add}", "edit_postfix_regex_rule()") . "</td></tr>\n\t</table>";
    if (is_array($hash)) {
        $html = $html . "\n\t\t<table style width:99%' class=table_form>\n\t\t<tr style='background-color:#CCCCCC'>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t\t<td><strong>{pattern}</strong></td>\n\t\t<td><strong>{action}</strong></td>\n\t\t<td><strong>{event}</strong></td>\n\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t\n\t\t";
        for ($i = $start; $i <= $end; $i++) {
            $ligne = $hash[$i];
            if (trim($ligne != null)) {
                $array = $reg->ParseRegexLine($ligne);
                $pattern = $array[0];
                $log = $array[2];
                $pattern = wordwrap($pattern, 50, '<br>', 1);
                $log = wordwrap($array[2], 45, '<br>', 1);
                $html = $html . "\n\t\t\t\t<tr " . CellRollOver_jaune() . ">\n\t\t\t\t\t<td width=1% valign='top'><img src='img/fw_bold.gif'></td>\n\t\t\t\t\t<td width=1% valign='top'>" . texttooltip($i, '{edit}', "edit_postfix_regex_rule({$i})") . "</td>\n\t\t\t\t\t<td nowrap valign='top'>" . texttooltip($pattern, '{edit}', "edit_postfix_regex_rule({$i})") . "</td>\n\t\t\t\t\t<td valign='top'>{$array[1]}</td>\n\t\t\t\t\t<td nowrap valign='top'>{$log}</td>\n\t\t\t\t\t<td nowrap valign='top'>" . imgtootltip("x.gif", "{delete}", "PostfixRegexDelete({$i})") . "</td>\n\t\t\t\t</tr>\n\t\t\t";
            }
        }
    }
    $html = $html . "</table>";
    if ($page_number > 1) {
        $nextpage = $_GET["page"] + 1;
        $revpage = $_GET["page"] - 1;
        if ($nextpage > $page_number) {
            $nextpage = $page_number;
        }
        if ($revpage < 0) {
            $revpage = 0;
        }
        $toolbox = "<br><table style='width:100%'>\n\t\t<tr>\n\t\t<td width=1% nowrap><strong>{go_to_page}</strong>:&nbsp;</td>\n\t\t<td align='left'>\n\t\t\t" . texttooltip("&laquo;&laquo;", "{backward}", "sLoadAjax('postfix_regex','smtp.rules.php?load=pregex&page={$revpage}')") . "&nbsp;\n\t\t<input type='text' id='postfixregexgotopage' value='{$_GET["page"]}' OnKeyPress=\"javascript:postfix_regex_page(event);\" style='width:50px'>\n\t\t&nbsp;" . texttooltip("&raquo;&raquo;", "{forward}", "sLoadAjax('postfix_regex','smtp.rules.php?load=pregex&page={$nextpage}')") . "&nbsp;\n\t\t</td>\n\t\t<td width=1% nowrap><strong>{search_string}</strong>:&nbsp;</td>\n\t\t<td align='left'><input type='text' id='postfixregexsearch' value='{$_GET["search"]}' OnKeyPress=\"javascript:postfix_regex_search_page(event);\" style='width:170px'></td>\n\t\t</tr>\n\t\t</table>";
    }
    $tpl = new templates();
    return RoundedLightWhite($tpl->_ENGINE_parse_body($html) . "<br>" . $toolbox);
}
Exemplo n.º 6
0
function main_page(){
	
	$master=new master_cf();
	$class="class=legend style='font-size:12px;text-align:left' ";
	if(!is_array($master->array_services)){$master=new master_cf();}
	if(!is_array($master->array_services)){return "<H1>Fatal error !</H1>";}
	
	$table="<table style='width:100%'>
	<tr>
		<th nowrap>{name}</th>
		<th nowrap>{service_name}</th>
		<th nowrap>&nbsp;</th>
		<th nowrap>{SERVICE_TYPE}</th>
		<th nowrap>{COMMAND}</th>
		<th nowrap>{OPTIONS}</th>
		<td>". imgtootltip("add-18.gif",'{add_postfix_service}',"PostfixServiceInfo('')")."</td>
	</tr>
	";
	
	while (list ($num, $val) = each ($master->array_services) ){
		$delete=imgtootltip('ed_delete.gif','{delete}',"DeleteMasterService('{$val["KEY"]}')");
		if($master->standard_services[$val["SERVICE"]]){
			$realname="{service_{$val["SERVICE"]}}";
			$explain=help_icon("{service_{$val["SERVICE"]}_text}");
			$delete=null;
		}else{$realname="{$val["SERVICE"]}";$explain=null;}
		
		$KEY=$val["KEY"];
		
		
		if (is_array($master->array_full[$KEY]["OPTIONS"])){
			while (list ($index, $opt) = each ($master->array_full[$KEY]["OPTIONS"]) ){
				if(trim($opt)<>null){
					$count=$count+1;
					if(strlen($opt)>27){$opt=substr($opt,0,27)."...";}
					$options=$options."<div><code>$opt</cod></div>";
					}
				$opt=null;}
		}
		
		if($count==0){$options=null;}
		
		$js="OnClick=\"javascript:PostfixServiceInfo('{$val["KEY"]}','{$master->array_full[$KEY]["SERVICE_NAME"]}');\" 
		OnMouseOver=\"javascript:this.style.cursor='pointer'\" 
		OnMouseOut=\"javascript:this.style.cursor='default'\"";
		
		$table=$table."
			<tr " . CellRollOver_jaune().">
				<td nowrap valign='top' $class width=1% nowrap $js>$realname</td>	
				<td nowrap valign='top' $class width=1% nowrap $js>{$master->array_full[$KEY]["SERVICE_NAME"]}</td>
				<td valign='top' width=1%>$explain</td>
				<td valign='top' $class width=1% $js>{$master->array_full[$KEY]["TYPE"]}</td>
				<td valign='top' $class width=1% nowrap $js>{$master->array_full[$KEY]["COMMAND"]}</td>
				<td valign='top' width=90% $js>$options</td>
				<td valign='top' $class width=1%>$delete</td>
		 </tr>";
		$options=null;
		$count=0;
		
	}
	
	$table=$table."</table>";
	
	$html="<H1>master.cf</h1>".main_tabs()."
	<div style='width:100%;height:450px;overflow-y:auto'>
	$table
	</div>
	";
	
	
	$tpl=new templates();
	return $tpl->_ENGINE_parse_body($html);
	
	
	
	
	
	
}
Exemplo n.º 7
0
function main_disk_persopath_list()
{
    $artica = new backup();
    if (!is_array($artica->perso_path)) {
        return null;
    }
    $html = "<table style='widht:100%'>";
    while (list($num, $val) = each($artica->perso_path)) {
        $html = $html . "<tr " . CellRollOver_jaune() . ">\n\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t<td width=99%><code>{$val}</code>\n\t\t<td width=1%>" . imgtootltip('ed_delete.gif', '{delete}', "DeletePersoPath('{$num}');") . "</td>\n\t\t</tr>\n\t\n\t";
    }
    $html = $html . "</table>";
    $tpl = new templates();
    return RoundedLightGrey($tpl->_ENGINE_parse_body($html));
}
Exemplo n.º 8
0
function syslogs()
{
    if ($_GET["lines"] == null) {
        $_GET["lines"] = 50;
    }
    $users->syslogng_installed = false;
    $users = new usersMenus();
    if (!$users->syslogng_installed) {
        if ($users->EnableMysqlFeatures == 0) {
            echo graph();
            exit;
        }
    }
    $q = new syslogs();
    $q->BuildNecessaryTables();
    $q->q_daemons = $_GET["q_daemons"];
    $q->limit_end = $_GET["q_lines"];
    $q->q_search = $_GET["q_search"];
    $daemon = Field_array_Hash($q->GetDaemons(), 'q_daemons', $_GET["q_daemons"], 'sysevents_query()');
    $form = "<table style=\"width:100%\">\n\t<tr>\n\t<td align='right'><strong>Daemon:</strong></td>\n\t<td>{$daemon}</td>\n\t<td align='right'><strong>{search}:</strong></td>\n\t<td>" . Field_text('q_search', $_GET["q_search"], 'width:150px', null, 'sysevents_query()') . "</td>\t\n\t<td align='right'><strong>{lines_number}:</strong></td>\n\t<td>" . Field_text('q_lines', $_GET["q_lines"], 'width:40px', null, 'sysevents_query()') . "</td>\n\t<td>" . imgtootltip('icon_refresh-20.gif', '{refresh}', 'sysevents_query()') . "</td>\n\t\t\n\t</tr>\n\t</table>";
    $form = "<br>" . RoundedLightGrey($form);
    $html = "\n\t<input type='hidden' id='switch' value='{$_GET["main"]}'>\n\t\n\t\n\t<table style=\"width:100%\">\n\t\n\t";
    $tpl = new templates();
    $r = $q->build_query();
    $count = 0;
    $style = "style='border-bottom:1px dotted #CCCCCC'";
    while ($ligne = @mysql_fetch_array($r, MYSQL_ASSOC)) {
        $ligne["msg"] = htmlentities($ligne["msg"]);
        $html = $html . "<tr " . CellRollOver_jaune() . ">\n\t\t<td width=1% valign='top' {$style}><img src='img/fw_bold.gif'></td>\n\t\t<td width=1% nowrap valign='top' {$style}>{$ligne["date"]}</td>\n\t\t<td {$style}>{$ligne["msg"]}</td>\n\t\t<td width=1% nowrap valign='top' {$style}>{$ligne["program"]}</td>\n\t\t</tr>";
        $count = $count + 1;
        if ($count > 500) {
            $error = "\n\t\t\t<tr>\n\t\t\t\t<td width=1% valign='top' styme='border-bottom:1px dotted red'><img src='img/fw_bold.gif'></td>\n\t\t\t\t<td colspan=3 style='color:red;font-weight:bold;border-bottom:1px dotted red'>{too_many_lines_exceed}:500</td>\n\t\t\t</tr>";
            $html = $tpl->_ENGINE_parse_body($error) . $html;
            break;
        }
    }
    $html = $html . "</table>";
    $html = $tpl->_ENGINE_parse_body($form) . "<br>{$html}";
    echo $html;
}
Exemplo n.º 9
0
function hostname()
{
    $nic = new networking();
    $nameserver = $nic->arrayNameServers;
    $dns_text = "<table style='width:100%;border:1px solid #5B5B5B;padding:3px;margin:3px;background-color:#E3E3E3'>";
    if (is_array($nameserver)) {
        while (list($num, $val) = each($nameserver)) {
            $val = trim($val);
            $dns_text = $dns_text . "<tr " . CellRollOver_jaune() . ">\n\t\t\t<td width=1%><img src='img/fw_bold.gif'>\n\t\t\t<td class=legend nowrap>{nameserver}:</td>\n\t\t\t<td width=99% nowrap><strong style='font-size:11px'>{$val}</strong></td>\n\t\t\t<td width=1%>" . imgtootltip('ed_delete.gif', '{delete}', "DeleteDNS('{$val}');") . "</td>\n\t\t\t</tr>";
        }
    }
    $dns_text = $dns_text . "\n<tr>\n<td align='right' colspan=4><input type='button' OnClick=\"javascript:AddDNSServer();\" value='{add}&raquo;'></td>\n</tr>\n</table>\n<br>\n<input type='hidden' name='ChangeHostName' id='ChangeHostName' value='{ChangeHostName}'>\n<input type='hidden' name='AddDNSServer' id='AddDNSServer' value='{AddDNSServer}'>\n<input type='hidden' name='DeleteDNS' id='DeleteDNS' value='{DeleteDNS}'>\n\n\n\n\n<table style='width:100%;border:1px solid #5B5B5B;padding:3px;margin:3px;background-color:#E3E3E3'>\n<tr>\n\t<td class=legend>{hostname}:</td>\n\t<td><strong style='font-size:12px'><strong>{$nic->hostname}</strong></td>\n\t<td width=1%><input type='button' OnClick=\"javascript:ChangeHostName('{$nic->hostname}');\" value='{edit}&nbsp;&raquo;'></td>\n</tr>\n</table>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($dns_text);
}
Exemplo n.º 10
0
 }
 switch (strtolower($ligne["TYPE"])) {
     case "pass":
         $roll = CellRollOver();
         $color = "black";
         break;
     case "not modified":
         $roll = CellRollOver();
         $color = "black";
         break;
     case "moved temporarily":
         $roll = CellRollOver();
         $color = "black";
         break;
     default:
         $roll = CellRollOver_jaune() . " style='color:#B70C25'";
         $color = "#B70C25";
         break;
 }
 $sitename = texttooltip($ligne["sitename"], "{$ligne["uri"]}<br>{$ligne["remote_ip"]}", null, null, 0, "font-weight:bold;color:{$color}");
 $ligne["TYPE"] = texttooltip($ligne["TYPE"], $ligne["REASON"], null, null, 0, "font-weight:bold;color:{$color}");
 $time = $ligne["tdate"];
 $QuerySize = $ligne["QuerySize"];
 if ($QuerySize == null) {
     $QuerySize = "-";
 } else {
     $QuerySize = FormatBytes($QuerySize / 1024);
 }
 $mailfrom = $ligne["CLIENT"];
 if (preg_match("#[0-9]+\\.[0-9]+\\.[0-9]+#", $mailfrom)) {
     if ($GLOBALS["gethostbyaddr"][$mailfrom] == null) {
Exemplo n.º 11
0
function GreyCheckConnect_popup()
{
    if (isset($_GET["edit"])) {
        GreyCheckConnect_edit();
        exit;
    }
    $chk = new jchkmail();
    $html = "<H1>{Greylisting}</H1>\n\t<p class=caption>{Greylisting_text}</p>\n\t<div style='width:100%;text-align:right'>\n\t\t<input type='button' OnClick=\"javascript:GreyCheckConnectEdit(-1);\" value='{add}&nbsp;&raquo;'>\n\t</div>\t\n\t";
    if (is_array($chk->GreyCheckConnect)) {
        $table = "\n\t<div style='width:100%;height:300px;overflow:auto'>\n\t<table style='width:100%'>\n\t<tr>\n\t<th>&nbsp;</th>\n\t<th>{pattern}</th>\n\t<th>{action}</th>\n\t<th>&nbsp;</th>\n\t<th>&nbsp;</th>\n\t</tr>\n\t\n\t";
        while (list($num, $line) = each($chk->GreyCheckConnect)) {
            $table = $table . "<tr " . CellRollOver_jaune() . ">\n\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t<td " . CellRollOver("GreyCheckConnectEdit('{$num}')") . " width=90%><strong>{$num}</strong>\n\t\t<td width=1% nowrap><strong>{gl_{$line[0]}}</td>\n\t\t<td width=1% nowrap><strong>{{$line[1]}}</td>\n\t\t<td width=1%>" . imgtootltip('ed_delete.gif', '{delete}', "GreyCheckConnect_del('{$num}');") . "</td>\n\t\t</tr>\n\t\t";
        }
        $table = $table . "</table></div>";
        $table = RoundedLightWhite($table);
        $html = $html . $table;
        $tpl = new templates();
        echo $tpl->_ENGINE_parse_body($html, "postfix.index.php");
    }
}
Exemplo n.º 12
0
$numberofSites=mysql_num_rows($results);
	while($ligne=mysql_fetch_array($results,MYSQL_ASSOC)){
		$count=$count+1;
		$Country=$ligne["country"];
		$country_img=GetFlags($Country);
		
		
		
		if($ligne["TYPE"]==null){$ligne["TYPE"]="PASS";}
		if(preg_match("#EXCEPTION#",$ligne["TYPE"])){$ligne["TYPE"]="PASS";}
		
		switch (strtolower($ligne["TYPE"])) {
			case "pass":$roll=CellRollOver();$color="black";break;
			case "not modified":$roll=CellRollOver();$color="black";break;
			case "moved temporarily":$roll=CellRollOver();$color="black";break;
			default:$roll=CellRollOver_jaune() ." style='color:#B70C25'";$color="#B70C25";break;
		}
		
		$sitename=texttooltip($ligne["sitename"],"{$ligne["uri"]}<br>{$ligne["remote_ip"]}",null,null,0,"font-weight:bold;color:$color");
		$ligne["TYPE"]=texttooltip($ligne["TYPE"],$ligne["REASON"],null,null,0,"font-weight:bold;color:$color");		
		$time=$ligne["tdate"];
		$QuerySize=$ligne["QuerySize"];
		if($QuerySize==null){$QuerySize="-";}else{$QuerySize=FormatBytes($QuerySize/1024);}
		
		
		$mailfrom=$ligne["CLIENT"];
		
		
		if(preg_match("#[0-9]+\.[0-9]+\.[0-9]+#",$mailfrom)){
			if($GLOBALS["gethostbyaddr"][$mailfrom]==null){
				$newname=gethostbyaddr($mailfrom);