Example #1
0
function photos_list($user, $p)
{
    $pos = 0;
    foreach ($p as $id => $r) {
        $pos++;
        if ($pos == 1) {
            $o = '';
        } elseif ($pos == count($p)) {
            $o .= ' and ';
        } else {
            $o .= ', ';
        }
        $o .= "<a href=\"http://www.flickr.com/photos/{$user}/{$id}\">{$id}</a> (" . rules_list($r) . ")";
    }
    return $o;
}
Example #2
0
    exit;
}
if (isset($_GET["service-status"])) {
    echo status_service();
    exit;
}
if (isset($_GET["rules"])) {
    echo rules();
    exit;
}
if (isset($_GET["DeleteRuleMaster"])) {
    DeleteRuleMaster();
    exit;
}
if (isset($_GET["rules-list"])) {
    echo rules_list();
    exit;
}
if (isset($_GET["rule-form"])) {
    echo rule_form();
    exit;
}
if (isset($_GET["EnablePOSTFWD2"])) {
    EnablePOSTFWD2();
    exit;
}
if (isset($_GET["reconfigure"])) {
    reconfigure();
    exit;
}
if (isset($_GET["postfwd2-action"])) {
Example #3
0
	include_once('ressources/class.maincf.multi.inc');
	
	
	if(!Isright()){
		$tpl=new templates();
		echo "alert('".$tpl->javascript_parse_text('{ERROR_NO_PRIVS}')."');";
		die();
	}
	
	if(isset($_GET["tabs"])){echo tabs();exit;}
	if(isset($_GET["status"])){echo status();exit;}
	if(isset($_GET["service-status"])){echo status_service();exit;}
	
	if(isset($_GET["rules"])){echo rules();exit;}
	if(isset($_GET["DeleteRuleMaster"])){DeleteRuleMaster();exit;}
	if(isset($_GET["rules-list"])){echo rules_list();exit;}
	if(isset($_GET["rule-form"])){echo rule_form();exit;}
	
	if(isset($_GET["EnablePOSTFWD2"])){EnablePOSTFWD2();exit;}
	if(isset($_GET["reconfigure"])){reconfigure();exit;}
	
	if(isset($_GET["postfwd2-action"])){echo postfwd2_action_form();exit;}
	if(isset($_GET["postfwd2-mod-action"])){echo postfwd2_action_edit();exit;}
	
	
	if(isset($_GET["postfwd2-item"])){echo postfwd2_item_form();exit;}
	if(isset($_GET["postfwd2-add-item"])){echo postfwd2_item_save();exit;}
	if(isset($_GET["postfwd2-delete-item"])){postfwd2_item_delete();exit;}
	if(isset($_GET["postfwd2-item-list"])){echo postfwd2_item_list();exit;}
	if(isset($_GET["item-form-selected"])){echo postfwd2_item_form_selected();exit;}
	if(isset($_GET["postfwd2Down"])){echo postfwd2Down();exit;}
Example #4
0
include_once 'ressources/class.system.network.inc';
if (posix_getuid() != 0) {
    $user = new usersMenus();
    if ($user->AsDnsAdministrator == false) {
        $tpl = new templates();
        echo $tpl->_ENGINE_parse_body("alert('{ERROR_NO_PRIVS}');");
        die;
        exit;
    }
}
if (isset($_POST["filename"])) {
    enable();
    exit;
}
if (isset($_GET["list"])) {
    rules_list();
    exit;
}
table();
function table()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $dnsmasq_address_text = $tpl->_ENGINE_parse_body("{dnsmasq_address_text}");
    $hosts = $tpl->_ENGINE_parse_body("{hosts}");
    $addr = $tpl->_ENGINE_parse_body("{addr}");
    $new_interface = $tpl->_ENGINE_parse_body("{new_interface}");
    $rulename = $tpl->_ENGINE_parse_body("{rulename}");
    $explain = $tpl->javascript_parse_text("{explain}");
    $title = $tpl->_ENGINE_parse_body("{rules}");
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.dansguardian.inc');
	header("Pragma: no-cache");	
	header("Expires: 0");
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: no-cache, must-revalidate");	
	$user=new usersMenus();
	if(!$user->AsDansGuardianAdministrator){
		$tpl=new templates();
		FATAL_ERROR_SHOW_128("{ERROR_NO_PRIVS}");
		exit;
		
	}
	if(isset($_GET["rule-js"])){rule_js();exit;}
	if(isset($_GET["delete-js"])){rule_delete_js();exit;}
	if(isset($_GET["list"])){rules_list();exit;}
	if(isset($_GET["rule-popup"])){rule_popup();exit;}
	if(isset($_POST["rule"])){rule_save();exit;}
	if(isset($_POST["delete"])){rule_delete();exit;}
	
table();


function rule_delete_js(){
	header("content-type: application/x-javascript");
	$md5=$_GET["delete-js"];
	$page=CurrentPageName();
	$tpl=new templates();
	$q=new mysql_squid_builder();
	$txt=$tpl->javascript_parse_text("{delete}");
	$rule=$tpl->javascript_parse_text("{rule}");
function group_list()
{
    //ini_set('html_errors',0);ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string','');ini_set('error_append_string','');
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql();
    $RULEID = $_GET["RULEID"];
    $t = $_GET["t"];
    $FORCE_FILTER = null;
    $search = '%';
    $table = "haproxy_acls_groups";
    $page = 1;
    $wpad = false;
    if (isset($_GET["wpad"])) {
        $_GET["FilterType"] = "WPAD";
    }
    if ($q->COUNT_ROWS($table, "artica_backup") == 0) {
        json_error_show("No data");
    }
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    $searchstring = string_to_flexquery();
    if ($searchstring != null) {
        $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$FORCE_FILTER} {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$FORCE_FILTER}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        $total = $ligne["TCOUNT"];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT *  FROM `{$table}` WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        json_error_show($q->mysql_error . "\n" . $sql);
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    if (mysql_num_rows($results) == 0) {
        json_error_show("Query return no item...{$sql}");
    }
    $haproxy = new haproxy();
    while ($ligne = mysql_fetch_assoc($results)) {
        $val = 0;
        $ligne['groupname'] = utf8_encode($ligne['groupname']);
        $GroupTypeText = $tpl->_ENGINE_parse_body($haproxy->acl_GroupType[$ligne["grouptype"]]);
        $delete = imgsimple("delete-32.png", "", "Loadjs('{$MyPage}?delete-group-js={$ligne['ID']}');");
        $editjs = "<a href=\"javascript:Blurz();\" \n\t\tOnClick=\"javascript:Loadjs('squid.acls.groups.php?AddGroup-js=yes&ID={$ligne['ID']}&table-acls-t={$t}');\"\n\t\tstyle=\"font-size:20px;text-decoration:underline\">";
        $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(*) as tcount FROM haproxy_acls_items WHERE groupid='{$ligne['ID']}'", "artica_backup"));
        $CountDeMembers = intval($ligne2["tcount"]);
        if (!$q->ok) {
            $CountDeMembers = $q->mysql_error;
        }
        if ($ligne["grouptype"] == "all") {
            $CountDeMembers = "*";
        }
        $rules_list = rules_list($ligne["ID"]);
        $data['rows'][] = array('id' => "group{$ligne['ID']}", 'cell' => array("<span style='font-size:20px;'>{$editjs}{$ligne['groupname']}</a></span>", "<span style='font-size:20px;'>{$GroupTypeText}</span>", "<span style='font-size:20px;'>{$rules_list}</span>", "<span style='font-size:20px;'>{$CountDeMembers}</span>", "<center>{$delete}</center>"));
    }
    echo json_encode($data);
}