Exemplo n.º 1
0
function _git_log_exec($cmd)
{
    global $git;
    if (!isset($git)) {
        return;
    }
    $cwd = getcwd();
    if (chdir($git['path']) === false) {
        messages_add("Git: cannot chdir to git directory", MSG_ERROR);
        return;
    }
    $ret = array();
    $commit = null;
    $result = adv_exec($cmd);
    $mode = 0;
    foreach (explode("\n", $result[1]) as $r) {
        if (preg_match("/^commit (.*)/", $r, $m)) {
            $mode = 0;
            if ($commit) {
                $ret[] = $commit;
            }
            $commit = array('commit' => $m[1], 'message' => '', 'objects' => array());
        } elseif ($mode == 0 && preg_match("/^Author:\\s*(.*) <(.*)>\$/", $r, $m)) {
            $commit['author_name'] = $m[1];
            $commit['author_email'] = $m[2];
        } elseif ($mode == 0 && preg_match("/^Date:\\s*(.*)\$/", $r, $m)) {
            $d = new DateTime($m[1]);
            $commit['date'] = $d->format('c');
        } elseif ($mode == 0 && preg_match("/^    (.*)\$/", $r, $m)) {
            $commit['message'] .= $m[1];
        } elseif ($mode == 0 && preg_match("/^ ([A-Za-z0-9_]*)\\/\\{(.*)\\.json => (.*)\\.json\\}/", $r, $m)) {
            $commit['objects'][] = array($m[1], $m[3], $m[2]);
        } elseif ($mode == 0 && preg_match("/^ ([A-Za-z0-9_]*)\\/(.*)\\.json/", $r, $m)) {
            $commit['objects'][] = array($m[1], $m[2]);
        } elseif (($mode == 0 || $mode == 2) && preg_match("/^diff --git a\\/([A-Za-z0-9_]*)\\/(.*)\\.json b\\/([A-Za-z0-9_]*)\\/(.*)\\.json\$/", $r, $m)) {
            $mode = 1;
            if ($m[2] != $m[4]) {
                $commit['objects'][] = array($m[1], $m[2], $m[4], 'diff' => "");
            } else {
                $commit['objects'][] = array($m[1], $m[2], 'diff' => "");
            }
        } elseif ($mode == 1 && preg_match("/^\\@\\@/", $r)) {
            $mode = 2;
        } elseif ($mode == 2) {
            $commit['objects'][sizeof($commit['objects']) - 1]['diff'] .= "{$r}\n";
        }
    }
    if ($commit) {
        $ret[] = $commit;
    }
    chdir($cwd);
    return $ret;
}
Exemplo n.º 2
0
if ($user->AsPostfixAdministrator == false) {
    $tpl = new templates();
    echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');";
    die;
    exit;
}
if (isset($_GET["tabs"])) {
    tabs();
    exit;
}
if (isset($_GET["messages"])) {
    messages();
    exit;
}
if (isset($_GET["add"])) {
    messages_add();
    exit;
}
if (isset($_POST["upload-message"])) {
    message_upload();
    exit;
}
if (isset($_GET["messages-list"])) {
    messages_table();
    exit;
}
if (isset($_GET["messages-search"])) {
    messages_search();
    exit;
}
if (isset($_GET["show-results"])) {
Exemplo n.º 3
0
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.artica.inc');
	include_once('ressources/class.ini.inc');
	include_once('ressources/class.spamassassin.inc');
	include_once('ressources/class.mime.parser.inc');
	include_once(dirname(__FILE__).'/ressources/class.rfc822.addresses.inc');
	$user=new usersMenus();
		if($user->AsPostfixAdministrator==false){
		$tpl=new templates();
		echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
		die();exit();
	}
	
	if(isset($_GET["tabs"])){tabs();exit;}
	if(isset($_GET["messages"])){messages();exit;}
	if(isset($_GET["add"])){messages_add();exit;}
	if(isset($_POST["upload-message"])){message_upload();exit;}
	if(isset($_GET["messages-list"])){messages_list();exit;}
	if(isset($_GET["show-results"])){message_results();exit;}
	if(isset($_GET["analyze-message"])){message_analyze();exit;}
	if(isset($_GET["delete-message"])){message_delete();exit;}
	
	
js();


function js(){
	
	$tpl=new templates();
	$page=CurrentPageName();
	$title=$tpl->_ENGINE_parse_body("{APP_SPAMASSASSIN}::{message_analyze}");