コード例 #1
0
    
    GlobalBan is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    GlobalBan is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with GlobalBan.  If not, see <http://www.gnu.org/licenses/>.
*/
require_once ROOTDIR . "/include/database/class.BanQueries.php";
$banQueries = new BanQueries();
$bannedUsers = $banQueries->downloadActiveBans(true, false);
// Cycle through each user and create the keygroup
foreach ($bannedUsers as $bannedUser) {
    $now = time();
    // In seconds
    $expireDateSeconds = $bannedUser->getExpireDateSeconds();
    $banTime = 0;
    // Determine how much longer the ban is based on the expire date
    if ($expireDateSeconds > 0) {
        $banTime = $now - $expireDateSeconds;
    }
    if ($banTime > -1) {
        echo "banid " . floor($banTime / 60) . " " . $bannedUser->getSteamId() . "\n";
    }
}
コード例 #2
0
if ($saveSQL == 1) {
    $saveSQL = true;
} else {
    $saveSQL = false;
}
if ($saveSQL) {
    $filename = $config->siteName . "_banned_users.xml";
    header("Content-type: text/xml charset=UTF-8");
} else {
    $filename = $config->siteName . "_banned_users.cfg";
    header("Content-type: text/plain");
}
$header = "Content-Disposition: attachment; filename=\"" . $filename . "\"";
header($header);
$banQueries = new BanQueries();
$bannedUsers = $banQueries->downloadActiveBans($all, $demosOnly);
function strleft($s1, $s2)
{
    return substr($s1, 0, strpos($s1, $s2));
}
function selfURL()
{
    $s = empty($_SERVER["HTTPS"]) ? '' : $_SERVER["HTTPS"] == "on" ? "s" : "";
    $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/") . $s;
    $port = $_SERVER["SERVER_PORT"] == "80" ? "" : ":" . $_SERVER["SERVER_PORT"];
    return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
}
$url = selfURL();
$url = substr($url, 0, strrpos($url, "/")) . "/";
if ($saveSQL) {
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";