Пример #1
0
<?php

require_once dirname(__DIR__) . '/private/class/GroupManager.php';
$group = GroupManager::getFromName("Beta");
if ($group === false) {
    GroupManager::createGroupWithLeaderBLID("Beta", "Closed beta", "ff0000", "gear", 9789);
    $group = GroupManager::getFromName("Beta");
}
if (isset($_POST['action'])) {
    if ($_POST['action'] == "add") {
        $res = GroupManager::addBLIDToGroupID($_POST['blid'], $group->getId());
        if ($res) {
            echo "Added " . $_POST['blid'] . "<hr />";
        } else {
            echo "Failed to add " . $_POST['blid'] . "<hr />";
        }
    }
}
$members = GroupManager::getMembersByID($group->getId());
foreach ($members as $mem) {
    echo $mem . "<br />";
}
?>
<hr />
<form action="" method="post">
  <input type="hidden" name="action" value="add" />
  <input type="text" name="blid" />
  <input type="submit" value="Add" />
</form>
Пример #2
0
    }
} else {
    if ($user->inGroup("Reviewer") || $user->inGroup("Moderator") || $user->inGroup("Administrator")) {
        $message = "Welcome back, reviewer, moderator, and/or administrator! You can find the latest download <a href=\"/api/beta/System_BlocklandGlass.zip\">here</a>!";
    } else {
        if ($user->inGroup("Beta")) {
            $message = "Welcome back, tester! You can find the latest download <a href=\"/api/beta/System_BlocklandGlass.zip\">here</a>!";
        } else {
            if ($closed === true) {
                $message = "We are not currently looking for testers.";
            } else {
                if ($group->getMemberCount() >= $cap) {
                    $message = "The private testing is currently full. Try again later.";
                } else {
                    if (isset($_POST['submit']) && $_POST['submit'] == "Join") {
                        $res = GroupManager::addBLIDToGroupID($user->getBlid(), $group->getId());
                        if ($res) {
                            $message = "Welcome to Glass Live private testing! You can download the latest version <a href=\"/api/beta/System_BlocklandGlass.zip\">here</a>";
                        } else {
                            $message = "Error joining";
                        }
                    } else {
                        $message = "There's currently <b>" . ($cap - $group->getMemberCount()) . '</b> spots left!<br />' . '<form action="" method="post" /><input type="submit" value="Join" name="submit"/></form>';
                    }
                }
            }
        }
    }
}
?>
<style>