Example #1
0
function reqUserId()
{
    global $_COOKIE;
    $r = redisLink();
    if (!isset($_COOKIE['requser'])) {
        return userId();
    }
    $username = $_COOKIE['requser'];
    if (($id = getIdFromUsername($username)) == -1) {
        return userId();
    }
    if ($r->sismember("uid:{$id}:allowing", userId())) {
        return $id;
    } else {
        return userId();
    }
}
Example #2
0
<?php

require "lib.php";
if (!isLoggedIn()) {
    exit;
}
if (g("username") === false || strlen(trim(g("username"))) == 0) {
    exit;
}
$username = g("username");
if (($id = getIdFromUsername($username)) != -1) {
    delAllowed(userId(), $id);
}
header("Location: /settings");
Example #3
0
<?php

require "lib.php";
Config("title", "LLOOGG Administration");
include "header.php";
if (!isAdmin()) {
    exit;
}
$username = $_POST['username'];
$uid = getIdFromUsername($username);
if ($uid == -1) {
    echo "User " . utf8entities($username) . " not found.";
} else {
    setPro($uid, 1);
    echo "User " . utf8entities($username) . " is now PRO.";
}
include "footer.php";
Example #4
0
<?php

require "../lib.php";
if (!isLoggedIn()) {
    exit;
}
if (g("username") === false || strlen(trim(g("username"))) == 0) {
    echo "ERR: Please specify the username to allow";
    exit;
}
if (isPro() || count(getAllowing()) < 1) {
    $uid = getIdFromUsername(g("username"));
    if ($uid == -1) {
        echo "ERR: The username specified does not exist";
    } else {
        addAllowed(userId(), $uid);
        echo "OK";
    }
} else {
    echo "ERR: Free accounts can only allow a single user. Upgrade to PRO in order to allow infinite users.";
}