예제 #1
0
<?php

require_once dirname(__DIR__) . '/private/class/UserLog.php';
echo "Current: " . UserLog::getCurrentUsername($_GET['blid']);
if (isset($_GET['username'])) {
    UserLog::addEntry($_GET['blid'], $_GET['username'], $_SERVER['REMOTE_ADDR']);
}
예제 #2
0
if (isset($_REQUEST['ident']) && $_REQUEST['ident'] != "") {
    $con = ClientConnection::loadFromIdentifier($_REQUEST['ident']);
    $ret = new stdClass();
    if (!is_object($con)) {
        $ret->status = "fail";
        error_log("Auth failed for ident " . $_REQUEST['ident']);
    } else {
        error_log("Auth pass for " . $_REQUEST['ident']);
        $ret->ident = $con->getIdentifier();
        $ret->blid = $con->getBLID();
        if ($ret->blid == 118256 || $ret->blid == 43364 || $ret->blid == 21186) {
            $ret->status = "barred";
            $json = json_encode($ret, JSON_PRETTY_PRINT);
            die($json);
        }
        $ret->username = iconv("ISO-8859-1", "UTF-8", UserLog::getCurrentUsername($ret->blid));
        error_log("Username is " . $ret->username);
        $ret->admin = false;
        $ret->mod = false;
        $user = UserManager::getFromBLID($ret->blid);
        if ($user !== false) {
            $ret->beta = false;
            if ($user->inGroup("Administrator")) {
                $ret->admin = true;
                $ret->mod = true;
                $ret->beta = true;
            } else {
                if ($user->inGroup("Moderator")) {
                    $ret->mod = true;
                    $ret->beta = true;
                }
예제 #3
0
<?php

/*$_GET['aid'] = $_REQUEST['id'];
$comments = include(dirname(__DIR__) . "/../../../private/json/getPageCommentsWithUsers.php");
echo json_encode($comments, JSON_PRETTY_PRINT);*/
require_once dirname(__DIR__) . "/../../../private/class/AddonManager.php";
require_once dirname(__DIR__) . "/../../../private/class/CommentManager.php";
$aid = $_REQUEST['id'];
if (!isset($_REQUEST['page'])) {
    $page = 0;
} else {
    $page = $_REQUEST['page'];
}
$addonObject = AddonManager::getFromID($aid);
$ret = array();
$start = $page * 10;
$comments = CommentManager::getCommentIDsFromAddon($addonObject->getId(), $start, 10);
foreach ($comments as $comid) {
    $comment = CommentManager::getFromId($comid);
    $commento = new stdClass();
    $commento->id = $comment->getId();
    $commento->author = UserLog::getCurrentUsername($comment->getBLID());
    $commento->authorblid = $comment->getBlid();
    $text = str_replace("\r\n", "<br>", $comment->getComment());
    $text = str_replace("\n", "<br>", $text);
    $commento->text = $text;
    $commento->date = date("F j, g:i a", strtotime($comment->getTimeStamp()));
    $ret[] = $commento;
}
echo json_encode($ret, JSON_PRETTY_PRINT);
예제 #4
0
    $board[1] = "Client Mods";
    $board[2] = "Server Mods";
    $board[3] = "Bricks";
    $board[4] = "Cosmetics";
    $board[5] = "Gamemodes";
    $board[6] = "Tools";
    $board[7] = "Weapons";
    $board[8] = "Colorsets";
    $board[9] = "Vehicles";
    $board[10] = "Bargain Bin";
    $board[11] = "Sounds";
    $o = new stdClass();
    $o->id = $ao->getId();
    $o->name = $ao->getName();
    $o->board = $board[$ao->getBoard()];
    $un = utf8_encode(UserLog::getCurrentUsername($ao->getManagerBLID()));
    if ($un === false) {
        $un = UserManager::getFromBLID($ao->getManagerBLID())->getUsername();
    }
    $o->author = $un;
    $ar[] = $o;
}
$dlg->uploads = $ar;
$ar = array();
foreach ($recentUpdates as $r) {
    $ao = $r->getAddon();
    if (!$ao->getApproved()) {
        continue;
    }
    if ($ao->getBoard() == 10) {
        // bargain bin
예제 #5
0
$aid = $_REQUEST['id'];
if (!isset($_REQUEST['page'])) {
    $page = 0;
} else {
    $page = $_REQUEST['page'];
}
$addonObject = AddonManager::getFromID($aid);
if (isset($_REQUEST['newcomment'])) {
    if ($con->isAuthed()) {
        CommentManager::submitComment($addonObject->getId(), $con->getBlid(), stripcslashes($_REQUEST['newcomment']));
    }
}
$res = new stdClass();
$res->status = "success";
$ret = array();
$start = $page * 10;
$comments = CommentManager::getCommentIDsFromAddon($addonObject->getId(), $start, 10, 1);
foreach ($comments as $comid) {
    $comment = CommentManager::getFromId($comid);
    $commento = new stdClass();
    $commento->id = $comment->getId();
    $commento->author = utf8_encode(UserLog::getCurrentUsername($comment->getBLID()));
    $commento->authorblid = $comment->getBlid();
    $text = str_replace("\r\n", "<br>", $comment->getComment());
    $text = str_replace("\n", "<br>", $text);
    $commento->text = utf8_encode($text);
    $commento->date = date("M jS Y, g:i A", strtotime($comment->getTimeStamp()));
    $ret[] = $commento;
}
$res->comments = $ret;
echo json_encode($res, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
예제 #6
0
.list {
  margin: 0 auto;
}

.maincontainer p {
  text-align: center;
}

form {
  text-align: center;
}

</style>
<div class="maincontainer">
	<table class="list">
    <tbody>
      <tr>
        <td>Username</td>
        <td>BL_ID</td>
        <td>Version</td>
      </tr>
			<?php 
foreach ($users as $u) {
    $username = utf8_encode(UserLog::getCurrentUsername($u->blid));
    echo "<tr><td><b>" . $username . "</b></td><td>" . $u->blid . "</td><td>" . StatUsageManager::getVersionUsed($u->blid, 11) . "</td></tr>";
}
?>
		</tbody>
	</table>
</div>
예제 #7
0
?>
</td>
      </tr>
      <tr>
        <td style="padding: 10px;"><b>Version Info</b></td>
        <td><pre style="font-size: .5em"><?php 
echo json_encode($addon->getVersionInfo(), JSON_PRETTY_PRINT);
?>
</pre></td>
      </tr>
      <tr>
        <td style="padding: 10px;"><b>Authors</b></td>
        <td>
        <?php 
foreach ($addon->getAuthorInfo() as $author) {
    $name = UserLog::getCurrentUsername($author->blid);
    if ($name == false) {
        $name = "Blockhead" . $author->blid;
    }
    echo "{$name} - <i>" . $author->role . "</i><br />";
}
?>
        </td>
      </tr>
      <tr>
        <td style="padding: 10px;"><b>Tags</b></td>
        <td>

        </td>
      </tr>
    </tbody>
예제 #8
0
echo "<h2 style=\"margin-bottom: 0px;\">" . $addonObject->getName() . "</h2>";
$authors = $addonObject->getAuthorInfo();
echo "Uploaded by ";
if (sizeof($authors) == 1) {
    //$uo = new UserHandler();
    //$uo->initFromId($authors[0]->id);
    $name = UserLog::getCurrentUsername($authors[0]->blid);
    echo "<a href=\"/user/view.php?blid=" . $authors[0]->blid . "\">" . utf8_encode($name) . "</a>";
} else {
    if (sizeof($authors) == 2) {
        //we cant use UserHandler here because we may not have accounts for all
        $name1 = UserLog::getCurrentUsername($authors[0]->blid);
        if ($name1 === false) {
            $name1 = "Blockhead" . $authors[0]->blid;
        }
        $name2 = UserLog::getCurrentUsername($authors[1]->blid);
        if ($name2 === false) {
            $name2 = "Blockhead" . $authors[1]->blid;
        }
        echo "<a href=\"/user/view.php?blid=" . $authors[0]->blid . "\">" . utf8_encode($name1) . "</a>";
        echo " and ";
        echo "<a href=\"/user/view.php?blid=" . $authors[1]->blid . "\">" . utf8_encode($name2) . "</a>";
    } else {
        var_dump($authors);
        $count = sizeof($authors);
        foreach ($authors as $num => $author) {
            //$uo = new UserHandler();
            //$uo->initFromId($auth->id);
            $uo = UserManager::getFromBLID($author->blid);
            if ($count - $num == 1) {
                echo "and <a href=\"#\">" . utf8_encode($uo->getName()) . "</a>";
예제 #9
0
}
$boardObject = BoardManager::getFromID($_REQUEST['id']);
$addonIds = AddonManager::getFromBoardID($boardObject->getID(), ($page - 1) * 10, 10);
$ret = new stdClass();
$ret->addons = array();
foreach ($addonIds as $aid) {
    $addon = AddonManager::getFromID($aid);
    if ($addon->getRating() == null) {
        $rating = 0;
    } else {
        $rating = $addon->getRating();
    }
    $retboard = new stdClass();
    $retboard->id = $addon->getId();
    $retboard->name = $addon->getName();
    $user = UserLog::getCurrentUsername($addon->getManagerBLID());
    if ($user == false) {
        $uo = UserManager::getFromBlid($addon->getManagerBLID());
        if ($uo !== false) {
            $user = $uo->getUsername();
        } else {
            $user = "******";
        }
    } else {
        $user = utf8_encode($user);
    }
    $retboard->author = $user;
    $retboard->rating = $rating;
    $retboard->downloads = $addon->getDownloads("web") + $addon->getDownloads("ingame");
    $ret->addons[] = $retboard;
}
예제 #10
0
form {
  text-align: center;
}

</style>
<div class="maincontainer">
  <?php 
echo "<p>{$message}</p>";
?>
  <hr />
	<table class="list">
    <tbody>
      <tr>
        <td> </td>
        <td>Username</td>
        <td>BL_ID</td>
      </tr>
      <?php 
$members = GroupManager::getMembersByID($group->getId());
foreach ($members as $mem) {
    echo "<tr><td><img src=\"/img/icons32/user_orange.png\" /></td>";
    echo "<td><b>" . UserLog::getCurrentUsername($mem) . "</b></td>";
    echo "<td>" . $mem . "</td></tr>";
}
?>
    </tbody>
  </table>
</div>

<?php 
require_once realpath(dirname(__DIR__) . "/private/footer.php");