コード例 #1
0
ファイル: _setup.php プロジェクト: nsystem1/clanscripts
$CLAN_NAME = $websiteInfo['clanname'];
$THEME = $websiteInfo['theme'];
define("THEME", $THEME);
$arrWebsiteLogoURL = parse_url($websiteInfo['logourl']);
if (!isset($arrWebsiteLogoURL['scheme']) || $arrWebsiteLogoURL['scheme'] == "") {
    $websiteInfo['logourl'] = $MAIN_ROOT . "themes/" . $THEME . "/" . $websiteInfo['logourl'];
}
$IP_ADDRESS = $_SERVER['REMOTE_ADDR'];
// Check Debug Mode
if ($websiteInfo['debugmode'] == 1) {
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT);
} else {
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT);
    //ini_set('error_reporting', E_ALL);
}
// Check for Ban
$ipbanObj = new IPBan($mysqli);
if ($ipbanObj->isBanned($IP_ADDRESS)) {
    die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "banned.php';</script>");
}
$websiteInfo['default_timezone'] = !isset($websiteInfo['default_timezone']) || $websiteInfo['default_timezone'] == "" ? "UTC" : $websiteInfo['default_timezone'];
date_default_timezone_set($websiteInfo['default_timezone']);
$hooksObj = new btHooks();
$btThemeObj = new btTheme();
$clockObj = new Clock($mysqli);
$btThemeObj->setThemeDir($THEME);
$btThemeObj->setClanName($CLAN_NAME);
$btThemeObj->initHead();
include_once BASE_DIRECTORY . "plugins/mods.php";
コード例 #2
0
 /**
  * Tests the postBan method of the controller
  */
 public function testPostBan()
 {
     $this->initTestStep();
     IPBan::truncate();
     $this->call('POST', 'admin/ban', array('ip' => '0.0.0.0'));
     $this->assertSessionHas('messages.success');
     $this->assertRedirectedTo('admin/ban');
     $this->assertEquals(IPBan::where('ip', '0.0.0.0')->count(), 1);
 }
コード例 #3
0
 /**
  * Processes POST requests for the IP banning module
  *
  * @return \Illuminate\Support\Facades\Redirect
  */
 public function postBan()
 {
     // Define validation rules
     $validator = Validator::make(Input::all(), array('ip' => 'required|ip'));
     // Run the validator
     if ($validator->passes()) {
         $ipban = new IPBan();
         $ipban->ip = Input::get('ip');
         $ipban->save();
         Session::flash('messages.success', Lang::get('admin.ip_banned'));
         return Redirect::to('admin/ban');
     } else {
         Session::flash('messages.error', $validator->messages()->all('<p>:message</p>'));
         return Redirect::to('admin/ban')->withInput();
     }
 }