Example #1
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.";
}
Example #2
0
><br/><br/>
Show clients user agent <input type="checkbox" name="showuseragent" value="1" <?php 
echo $showuseragent;
?>
><br/><br/>
<input type="submit" name="saveoptions" value="Save options">
<br/><br/>
</form>
<h3>Give access</h3>
It is possible to give read-only access to your stats to other LLOOGG users. You can later remove the access if you want.<br/><br/>
Allow
<input id="allowusername" type="text" name="username">
to see my stats in read only
<input type="button" name="doit" value="Allow!" onclick="allowUser()">
<?php 
$allowed = getAllowing();
if (count($allowed)) {
    echo "<h4>Allowed users</h4>";
    echo "<ul>";
    foreach ($allowed as $id) {
        echo "<li>" . utf8entities(getUsernameById($id)) . " <a href=\"rmallowed.php?username="******"\">remove</a></li>";
    }
    echo "</ul>";
}
?>
</div>
<script type="text/javascript">
function allowUserHandler(res) {
    if (res.indexOf("ERR:") != -1) {
        alert(res);
    } else {