Beispiel #1
0
    exit;
}
if (isset($_GET["warnings"])) {
    warnings_js();
    exit;
}
if (isset($_GET["warnings-popup"])) {
    warnings_popup();
    exit;
}
if (isset($_GET["main_admin_tabs"])) {
    echo main_admin_tabs();
    exit;
}
if (isset($_GET["json-error-js"])) {
    json_error_js();
    exit;
}
if (isset($_GET["json-error-popup"])) {
    json_error_popup();
    exit;
}
if (isset($_GET["StartStopService-js"])) {
    StartStopService_js();
    exit;
}
if (isset($_GET["StartStopService-popup"])) {
    StartStopService_popup();
    exit;
}
if (isset($_GET["StartStopService-perform"])) {
function members_list()
{
    $tpl = new templates();
    $q = new mysql();
    $MyPage = CurrentPageName();
    $table = "activedirectoryusers";
    $database = "artica_backup";
    $page = 1;
    $FORCE_FILTER = "AND gpid={$_GET["gpid"]}";
    if ($q->COUNT_ROWS($table, $database) == 0) {
        json_error_js($tpl->_ENGINE_parse_body("TABLE:{$table}<br>{error_no_datas}"));
    }
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY `{$_POST["sortname"]}` {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    if ($_POST["query"] != null) {
        $_POST["query"] = "*{$_POST["query"]}*";
        $_POST["query"] = str_replace("**", "*", $_POST["query"]);
        $_POST["query"] = str_replace("*", "%", $_POST["query"]);
        $search = $_POST["query"];
        if (strpos(" {$search}", "%") > 0) {
            $FILTER = "AND (`{$_POST["qtype"]}` LIKE '{$search}') {$FORCE_FILTER}";
        }
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FILTER}{$FORCE_FILTER}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
    } else {
        if ($FORCE_FILTER != null) {
            $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$FORCE_FILTER}";
            $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
            $total = $ligne["TCOUNT"];
        } else {
            $total = $q->COUNT_ROWS($table, $database);
        }
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    if ($FILTER == null) {
        $FILTER = $FORCE_FILTER;
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT * FROM {$table} WHERE 1 {$FILTER} {$ORDER} {$limitSql}";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    $results = $q->QUERY_SQL($sql, $database);
    if (!$q->ok) {
        json_error_show("{$q->mysql_error}");
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $ligne["group"] = utf8_decode($ligne["group"]);
        $data['rows'][] = array('id' => $ligne["uid"], 'cell' => array("<img src='img/user-32.png'>", "<span style='font-size:16px;font-weight:bold'>{$ligne["uid"]}</span>"));
    }
    echo json_encode($data);
}
function squid_compile_list(){
	$page=CurrentPageName();
	$users=new usersMenus();
	$tpl=new templates();
	$sock=new sockets();
	$array=unserialize(base64_decode($sock->getFrameWork("squid.php?compile-list=yes")));
	
	
	if(count($array)==0){json_error_js("Compilation list is not an array");}
	
	

	if($_POST["query"]<>null){
		$_POST["query"]=str_replace(".", "\.", $_POST["query"]);
		$_POST["query"]=str_replace("*", ".*?", $_POST["query"]);
		$search=$_POST["query"];
	}
	if (isset($_POST['rp'])) {$rp = $_POST['rp'];}	
	

	
	$pageStart = ($page-1)*$rp;
	$limitSql = "LIMIT $pageStart, $rp";
	
	
	
	$data = array();
	$data['page'] = 1;

	$data['rows'] = array();
	
	$c=0;
	while (list ($num, $val) = each ($array)){
		$searchR=true;
		if($search<>null){
			if(!preg_match("#$search#i", $num)){$searchR=false;}
			if(preg_match("#$search#i", $val)){$searchR=true;}
		}
		if(!$searchR){continue;}
		$c++;
		$md5S=md5($num);
		if($val==null){$val="&nbsp;";}
		
			$data['rows'][] = array(
				'id' => $md5S,
				'cell' => array(
					"<span style='font-size:15px'>$num</span>","<span style='font-size:15px'>$val</span>"
					)
				);		
		}
	
		
		$data['total'] = $c;
	echo json_encode($data);		
}