示例#1
0
 $profile = GetProfile($user_id);
 $group = GetGroup($user_id);
 $group_info = GetGRPName($group);
 //assume self
 $Privilage = 3;
 /// print_r($profile);
 echo $user_id;
 echo "<br/>";
 if (isset($_GET['UID'])) {
     if (IDValidate($_GET['UID']) == 1) {
         if ($_GET['UID'] != $_SESSION['UID']) {
             $Editable = 0;
             $user_id = $_GET['UID'];
             $profile = GetProfile($_GET['UID']);
             $group = GetGroup($_GET['UID']);
             $readerGrp = GetGroup(GetProfile($_SESSION['UID']));
             //admin has all privilage
             if ($readerGrp >= 5) {
                 $Privilage = 3;
             } else {
                 $rel = GetRelation($_GET['UID'], $_SESSION['UID']);
                 echo $rel;
                 if ($rel == 1) {
                     $Privilage = 1;
                 } else {
                     if ($rel == 3) {
                         $Privilage = 2;
                     } else {
                         $Privilage = 0;
                     }
                 }
示例#2
0
<?php

session_start();
include "DB.php";
$UID = $_SESSION['UID'];
$GRP = GetGroup($UID);
if ($GRP < 5) {
    header("Location: http://localhost/546Final/pages/index.php");
    return;
}
if (isset($_GET['QID'])) {
    Delete_Question($_GET['QID']);
    header("Location: http://localhost/546Final/pages/index.php");
}
header("Location: http://localhost/546Final/pages/index.php");
示例#3
0
<?php

session_start();
if (isset($_SESSION['login']) && $_SESSION['login'] == true) {
    //print_r($_SESSION);
} else {
    header("Location: http://localhost/546Final/pages/index.php");
}
include "../include/DB.php";
if (isset($_SESSION['login']) && $_SESSION['login'] == true) {
    $user_id = $_SESSION['UID'];
    $profile = GetProfile($user_id);
    $group = GetGroup($user_id);
    $group_info = GetGRPName($group);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Profile Edit</title>

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" rel="stylesheet">
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/profile_site.css" rel="stylesheet">

</head>
示例#4
0
function connection_list()
{
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $sock = new sockets();
    $q = new mysql();
    $database = "artica_backup";
    $t = $_GET["t"];
    $search = '%';
    $table = "radcheck";
    $page = 1;
    $data = array();
    $data['rows'] = array();
    $FORCE_FILTER = null;
    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, $database));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$FORCE_FILTER}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
        $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, $database);
    if (!$q->ok) {
        json_error_show("{$q->mysql_error}");
    }
    $data['page'] = $page;
    $data['total'] = $total;
    if (mysql_num_rows($results) == 0) {
        json_error_show("{no_member_stored_in_this_area}", 1);
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $val = 0;
        $color = "black";
        $delete = imgsimple("delete-48.png", null, "ConnectionDelete{$t}('{$ligne['id']}')");
        $GetGroup = GetGroup($ligne['username']);
        $data['rows'][] = array('id' => $ligne['id'], 'cell' => array("\n\t\t\t\t\t\t<img src='img/user-48.png'>", "<a href=\"javascript:blur();\" \n\t\t\t\t\t\tOnClick=\"javascript:Loadjs('{$MyPage}?member-id-js={$ligne['id']}&t={$t}');\" \n\t\t\t\t\t\tstyle=\"font-size:22px;text-decoration:underline;color:{$color}\">\n\t\t\t\t\t\t{$ligne['username']}</a>\n\t\t\t\t\t\t<div style='font-size:16px'><i>{$GetGroup}</i></div>\n\t\t\t\t\t\t", $delete));
    }
    echo json_encode($data);
}
function ProvisionCommunity($parentgroupid, $name, $description, $email)
{
    // First we need to ensure we have a valid user
    $userid = IsValidCommunityUser($email);
    if ($userid <= 0) {
        return -1;
    }
    // Create the group
    $groupid = CreateGroup($name, $description, 'PrivateUnlisted', $parentgroupid);
    // Add the user to the group as an owner
    CreateGroupUser($groupid, $userid, 'Owner');
    // Get the URL
    $xml = GetGroup($groupid);
    return $xml->Group->Url;
}
WLOG("Starting... Log level:{$GLOBALS["DEBUG_LEVEL"]};");
while (!feof(STDIN)) {
    $url = trim(fgets(STDIN));
    if ($url == null) {
        continue;
    }
    $clt_conn_tag = null;
    if ($GLOBALS["DEBUG_LEVEL"] > 1) {
        WLOG($url);
    }
    $array = parseURL($url);
    if ($GLOBALS["DEBUG_LEVEL"] > 1) {
        WLOG("ASK: {$array["MAC"]} = ?");
    }
    $uid = GetMacToUid($array["MAC"], $array["IPADDR"]);
    $Group = GetGroup($array["MAC"], $array["IPADDR"]);
    if ($uid != null) {
        if ($Group != null) {
            $clt_conn_tag = " clt_conn_tag={$Group} log={$Group},none";
        }
        fwrite(STDOUT, "OK user={$uid}{$clt_conn_tag}\n");
        continue;
    }
    fwrite(STDOUT, "OK\n");
}
$distanceInSeconds = round(abs(time() - $GLOBALS["STARTIME"]));
$distanceInMinutes = round($distanceInSeconds / 60);
WLOG("v1.0:" . basename(__FILE__) . " die after ({$distanceInSeconds}s/about {$distanceInMinutes}mn)");
if (isset($GLOBALS["F"])) {
    @fclose($GLOBALS["F"]);
}