Beispiel #1
0
<?php

include_once dirname(__FILE__) . "/frame.class.inc";
if (isset($_GET["empty-database"])) {
    database_empty();
    exit;
}
if (isset($_GET["dump-database"])) {
    database_list();
    exit;
}
function database_list()
{
    $db = "/var/milter-greylist/greylist.db";
    $inc_file = "/usr/share/artica-postfix/ressources/logs/mgrelist-db.inc";
    if (isset($_GET["db_path"])) {
        $db = base64_decode(trim($_GET["db_path"]));
        $inc_file = "/usr/share/artica-postfix/ressources/logs/mgrelist-{$_GET["hostname"]}.inc";
    }
    $datas = file_get_contents($db);
    $tbl = explode("\n", $datas);
    if (!is_array($tbl)) {
        return null;
    }
    while (list($num, $line) = each($tbl)) {
        if (trim($line) == null) {
            continue;
        }
        if (preg_match("#greylisted tuples#", $line)) {
            $KEY = "GREY";
            continue;
	include_once('ressources/class.maincf.multi.inc');
	include_once('ressources/class.status.inc');
	if(isset($_GET["org"])){$_GET["ou"]=$_GET["org"];}
	
	if(!PostFixMultiVerifyRights()){
		$tpl=new templates();
		echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
		die();exit();
	}	
	
	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["form-database"])){database_form();exit;}
	if(isset($_GET["howto"])){howto();exit;}
	if(isset($_GET["dbindex"])){database_save();exit;}
	if(isset($_GET["dbindexDelete"])){database_delete();exit;}
	if(isset($_GET["postfix-ldap-databases"])){database_list();exit;}
	
js();


function js(){
$page=CurrentPageName();
$tpl=new templates();
$title=$tpl->_ENGINE_parse_body("{remote_users_databases}");
if(is_base64_encoded($_GET["ou"])){$ou=base64_decode($_GET["ou"]);}else{$ou=$_GET["ou"];}
$hostname=$_GET["hostname"];
$add=$tpl->_ENGINE_parse_body("{add}");
$howto=$tpl->_ENGINE_parse_body("{howto}");
$html="

function remote_users_databases_load(){