/** * @param $topicId * @param $input */ public function edit($topicId, $input) { // Edit topic's title $data = ['title' => $input['title']]; // Edit topic's tag if (\Bouncer::hasPermission('forums.tag') and \Input::get('tag')) { $data['tag'] = \Input::get('tag'); } // Edit topic $this->topicRepo->updateTopic($topicId, $data); }
public static function load(array $options = array()) { self::setOptions($options); Bouncer::addRule('ip_infos', array('Bouncer_Rules_Httpbl', 'ipInfos')); Bouncer::addRule('browser_identity', array('Bouncer_Rules_Httpbl', 'test')); Bouncer::addRule('robot_identity', array('Bouncer_Rules_Httpbl', 'test')); }
/** * Return if no access * * @param $permission * @param $entity * @return bool */ protected function noAccess($permission, $entity) { if (\Bouncer::hasPermission($permission)) { return false; } return $this->noAccessReturn($entity); }
/** * Run the database seeds. * * @return void */ public function run() { Season::create(['name' => date('Y') . '-' . (date('y') + 1)]); Program::create(['name' => 'Beginner Bible Bowl', 'abbreviation' => 'Beginner', 'slug' => 'beginner', 'registration_fee' => '25.00', 'min_grade' => 2, 'max_grade' => 5]); Program::create(['name' => 'Teen Bible Bowl', 'abbreviation' => 'Teen', 'slug' => 'teen', 'registration_fee' => '35.00', 'min_grade' => 6, 'max_grade' => 12]); GroupType::create(['name' => 'Christian School']); GroupType::create(['name' => 'Homeschool']); GroupType::create(['name' => 'Church']); GroupType::create(['name' => 'Other']); ParticipantType::create(['name' => 'Team']); ParticipantType::create(['name' => 'Player']); ParticipantType::create(['name' => 'Quizmaster']); ParticipantType::create(['name' => 'Spectator - Adult', 'description' => 'Single adult']); ParticipantType::create(['name' => 'Spectator - Family', 'description' => 'Up to 2 adults and children who are not players']); EventType::create(['participant_type_id' => ParticipantType::TEAM, 'name' => 'Round Robin']); EventType::create(['participant_type_id' => ParticipantType::PLAYER, 'name' => 'Quote Bee']); EventType::create(['participant_type_id' => ParticipantType::TEAM, 'name' => 'Double Elimination']); EventType::create(['participant_type_id' => ParticipantType::PLAYER, 'name' => 'BuzzOff']); EventType::create(['participant_type_id' => ParticipantType::PLAYER, 'name' => 'King of the Hill']); Bouncer::allow(Role::ADMIN)->to([Ability::VIEW_REPORTS, Ability::MANAGE_ROLES, Ability::MANAGE_USERS, Ability::MANAGE_GROUPS, Ability::MANAGE_PLAYERS, Ability::CREATE_TOURNAMENTS, Ability::SWITCH_ACCOUNTS, Ability::MANAGE_SETTINGS]); Bouncer::allow(Role::BOARD_MEMBER)->to(Ability::VIEW_REPORTS); Bouncer::allow(Role::HEAD_COACH)->to([Ability::MANAGE_ROSTER, Ability::MANAGE_TEAMS]); Role::create(['name' => Role::COACH, 'mailchimp_interest_id' => '29a52dd6fc']); Role::create(['name' => Role::LEAGUE_COORDINATOR, 'mailchimp_interest_id' => '9b90dc8bdd']); Role::create(['name' => Role::QUIZMASTER, 'mailchimp_interest_id' => 'fe3a183033']); Bouncer::allow(Role::QUIZMASTER); Bouncer::allow(Role::GUARDIAN)->to(Ability::REGISTER_PLAYERS); Role::where('name', Role::HEAD_COACH)->update(['mailchimp_interest_id' => 'be4c459134']); Role::where('name', Role::GUARDIAN)->update(['mailchimp_interest_id' => '0f83e0f312']); $howDidYouHearAbout = RegistrationSurveyQuestion::create(['question' => 'How did you hear about Bible Bowl?', 'order' => 1]); $howDidYouHearAbout->answers()->saveMany([app(RegistrationSurveyAnswer::class, [['answer' => 'Friend', 'order' => '1']]), app(RegistrationSurveyAnswer::class, [['answer' => 'Church brochure/bulletin', 'order' => '2']]), app(RegistrationSurveyAnswer::class, [['answer' => 'Homeschool convention', 'order' => '3']]), app(RegistrationSurveyAnswer::class, [['answer' => 'TV', 'order' => '4']]), app(RegistrationSurveyAnswer::class, [['answer' => 'Web Advertisement', 'order' => '5']]), app(RegistrationSurveyAnswer::class, [['answer' => 'Internet', 'order' => '6']]), app(RegistrationSurveyAnswer::class, [['answer' => 'Other', 'order' => '7']])]); $mostInfluential = RegistrationSurveyQuestion::create(['question' => 'Which of the following were most influential in your decision to join Bible Bowl?', 'order' => 2]); $mostInfluential->answers()->saveMany([app(RegistrationSurveyAnswer::class, [['answer' => "Friend's recommendation", 'order' => '1']]), app(RegistrationSurveyAnswer::class, [['answer' => 'Attending a practice/demo/meeting', 'order' => '2']]), app(RegistrationSurveyAnswer::class, [['answer' => 'Learning about it on the web site', 'order' => '3']]), app(RegistrationSurveyAnswer::class, [['answer' => 'Homeschool curriculum potential', 'order' => '4']]), app(RegistrationSurveyAnswer::class, [['answer' => 'Other', 'order' => '5']])]); }
/** * Edit post * * @return $this|\Illuminate\Http\RedirectResponse */ public function postEdit() { if (!\Bouncer::hasPermissionOrIsOwner('forums.posts.edit', $this->post)) { return $this->cantEditPost(); } // Edit post return $this->editPostRequest->edit($this, \Input::all(), $this->post); }
/** * Run the database seeds. * * @return void */ public function run() { Bouncer::allow('role-user-users')->to(['user-list', 'user-view']); Bouncer::allow('role-user-manage')->to(['user-list', 'user-view', 'user-edit', 'user-create']); Bouncer::allow('role-user-admin')->to(['user-list', 'user-view', 'user-edit', 'user-create', 'user-remove', 'user-permissions']); $userAdmin = App\User::find(1); $userAdmin->assign('role-user-admin'); }
/** * @group acl * * Test the block feature off a user. * - Has the correct permission. * * 1 = Block * 0 = Unblock */ public function testBlockHandlingCorrectUser() { $user = factory(App\User::class)->create(); Bouncer::assign('admin')->to($user); $route = $this->actingAs($user); $route->visit('/acl/block/1/' . $user->id); $route->seeStatusCode(200); $route->seeInDatabase('users', ['id' => $user->id, 'status' => 1]); }
/** * @test */ public function canDeletePlayer() { $player = Player::first(); $player->guardian->players()->where('players.id', '!=', $player->id)->delete(); $this->assertTrue($player->guardian->isAn(Role::GUARDIAN)); $this->visit('/admin/players/' . $player->id)->press('Delete Player')->see('Player has been deleted'); Bouncer::refresh(); $this->assertTrue($player->guardian->isNotAn(Role::GUARDIAN)); }
/** * Create post * * @param array $input * @param $topic * @param $user * @param bool $add * @return \Illuminate\Http\RedirectResponse|object */ public function create($input, $topic, $user, $add = true) { // Create post $data = ['markdown' => $input['content'], 'html' => \Purifier::clean(\Markdown::text($input['content'])), 'topic_id' => $topic->id, 'user_id' => $user->id]; if (\Bouncer::hasPermission('devresponse') and \Input::get('devresponse') == 1) { $data['developer_response'] = true; } $post = $this->postRepo->create($data); return $post; }
/** * @test */ public function canTransferOwnership() { $guardian = User::where('email', DatabaseSeeder::GUARDIAN_EMAIL)->firstOrFail(); $this->assertTrue($guardian->isNotAn(Role::HEAD_COACH)); $this->assertTrue($this->group->owner->isAn(Role::HEAD_COACH)); $this->visit('/admin/groups/' . $this->group->id)->click('Transfer Ownership')->see('Transfer Ownership: ' . $this->group->name)->select($guardian->id, 'user_id')->press('Transfer')->see('Ownership has been transferred'); Bouncer::refresh(); $this->assertTrue($guardian->isAn(Role::HEAD_COACH)); $this->assertTrue(Group::findOrFail($this->group->id)->isOwner($guardian)); }
/** * Run the database seeds. * * @return void */ public function run() { // Truncate method. \DB::statement('SET foreign_key_checks=0'); User::truncate(); \DB::statement('SET foreign_key_checks=1'); // Insert $user = new User(); $user->name = 'Tim Joosten'; $user->email = '*****@*****.**'; $user->status = 0; $user->password = bcrypt('root1995!'); $user->api_token = str_random(60); if ($user->save()) { $account = User::find($user->id); Bouncer::assign('admin')->to($account); Bouncer::refreshFor($account); } }
/** * Run the database seeds. * * @return void */ public function run() { //Crea en la db los roles y permisos por defecto Bouncer::allow('admin')->to('create_user'); Bouncer::allow('admin')->to('edit_user', User::class); Bouncer::allow('admin')->to('delete_user', User::class); Bouncer::allow('admin')->to('view_users'); Bouncer::allow('admin')->to('delete_logs'); Bouncer::allow('admin')->to('view_logs'); //asignar el rol al usuario administrador $user = DB::table('users')->where('email', '*****@*****.**')->value('id'); Bouncer::assign('admin')->to($user); //Inserta el rol user DB::table('roles')->insert(['name' => 'user', 'created_at' => Carbon::now()]); //Create 50 users factory(App\User::class, 50)->create()->each(function ($u) { $u->assign('user'); }); }
/** * Run the database seeds. * * @return void */ public function run() { foreach ($this->employeeAbilities() as $doThis) { \Bouncer::allow('employee')->to($doThis); } foreach ($this->OwnerAbilities() as $doThis) { \Bouncer::allow('owner')->to($doThis); } foreach ($this->adminAbilities() as $doThis) { \Bouncer::allow('admin')->to($doThis); } $owners = User::whereTitle('owner')->get(); foreach ($owners as $owner) { $owner->assign('owner'); } User::all()->each(function ($employee) { $employee->assign('employee'); }); }
function onAction() { global $application; $request = $_POST; $_state = modApiFunc("License", "checkLicense"); $licenseInfo = modApiFunc("License", "getLicenseInfo", $_state); if (class_exists('ZipArchive')) { $this->marketplace_server = $application->getAppIni('MARKETPLACE_SERVER'); $data = array('license' => $licenseInfo["license_key"], 'store_url' => $_SERVER['HTTP_HOST'] . $_SERVER['CONTEXT_PREFIX'], 'store_version' => PRODUCT_VERSION_NUMBER); loadCoreFile('bouncer.php'); $bnc = new Bouncer(); $bnc->setMethod('POST'); $bnc->setPOSTstring($bnc->prepareDATAstring($data)); $bnc->setURL($this->marketplace_server . "/download_extension.php?asc_action=SendLatestCoreFile"); $bnc->setProto('HTTPS'); $result = $bnc->RunRequest(); $response = $result['body']; if ($response != false && $bnc->responseCode < 400) { if (strpos($response, "ERR_") === 0) { modApiFunc("Session", "set", "ErrorMessage", $response); } else { $file = fopen($application->getAppIni('PATH_CACHE_DIR') . "avactis-upgrade.zip", 'w+'); fwrite($file, $response); fclose($file); $core_response = modApiFunc("Extension_Manager", "upgradeCore"); if (strpos($core_response, "ERR_") === 0) { modApiFunc("Session", "set", "ErrorMessage", $core_response); } else { CCacheFactory::clearAll(); $request = new Request(); $request->setView(CURRENT_REQUEST_URL); $application->redirect($request); } } } else { $error = "ERR_MARKETPLACE_NOT_AVAILABLE"; modApiFunc("Session", "set", "ErrorMessage", $error); } } else { $error = "ERR_CHK_ZIP_OR_PERMISSIONS"; modApiFunc("Session", "set", "ErrorMessage", $error); } }
function _process_request(&$xml_request, &$default_response) { $xml_request = urlencode($xml_request); loadCoreFile('bouncer.php'); $bnc = new Bouncer(); $bnc->setMethod(UPDATESERVER_METHOD); $bnc->setURL(UPDATESERVER_PROTO . '://' . UPDATESERVER_HOST_PATH . '?xml=' . $xml_request); switch (UPDATESERVER_METHOD) { case "GET": $bnc->setURL(UPDATESERVER_PROTO . '://' . UPDATESERVER_HOST_PATH . '?xml=' . $xml_request); break; case "POST": $bnc->setURL(UPDATESERVER_PROTO . '://' . UPDATESERVER_HOST_PATH); $bnc->setPOSTstring($bnc->prepareDATAstring(array("xml" => $xml_request))); break; } $result = $bnc->RunRequest(); if ($result == false) { return false; } //die(print_r($result['body'], true)); loadCoreFile('obj_xml.php'); $xml = new xml_doc($result['body']); //die(print_r($result['body'], true)); $xml->parse(); if (!is_object($xml->document)) { return false; } //die(print_r($xml->document,true)); foreach ($default_response as $key => $val) { $xml_tag = $xml->document->findChild($key); if ($xml_tag != FALSE) { $default_response[$key] = $xml_tag->contents; } } //die(print_r($default_response,true)); return $default_response; }
function output() { global $application; $request = $application->getInstance('Request'); $ext_name = $request->getValueByKey('ext_name'); $update = $request->getValueByKey('update'); $reset = $request->getValueByKey('reset'); $upgrade = $request->getValueByKey('upgrade'); $isReset = isset($reset) ? true : false; $isUpgrade = isset($upgrade) ? true : false; if ($isReset) { $this->resetExtensionDetails($ext_name); return; } if (isset($ext_name)) { $extensionDetail = $this->getExtensionDetail($ext_name); if ($extensionDetail == false) { loadCoreFile('bouncer.php'); $bnc = new Bouncer(); $bnc->setMethod('POST'); $data = modApiFunc("Extension_Manager", 'getLicenseDetail'); $data['ext_name'] = $ext_name; if (isset($update)) { $data['previous'] = $isUpgrade; } $bnc->setPOSTstring($bnc->prepareDATAstring($data)); $bnc->setURL($application->getAppIni('MARKETPLACE_SERVER') . '/download_extension.php?asc_action=GetExtensionDetails'); $bnc->setProto('HTTPS'); $result = $bnc->RunRequest(); if ($result != false && $bnc->responseCode < 400) { $response = unserialize($result['body']); if (isset($response) && !empty($response)) { $this->setExtensionDetails($ext_name, $response); return $response; } return $this->noOutput('A server connection error has occurred. Please try again in a few moments'); } } else { return $extensionDetail; } } $this->noOutput(); }
function onAction() { global $application; $request = $_POST; $extension_name = $request["extn_name"]; $_state = modApiFunc("License", "checkLicense"); $licenseInfo = modApiFunc("License", "getLicenseInfo", $_state); $data = array('license' => $licenseInfo["license_key"], 'store_url' => $_SERVER['HTTP_HOST'] . $_SERVER['CONTEXT_PREFIX'], 'extn_name' => $extension_name, 'store_version' => PRODUCT_VERSION_NUMBER); $marketplace_server = $application->getAppIni('MARKETPLACE_SERVER'); loadCoreFile('bouncer.php'); $bnc = new Bouncer(); $bnc->setMethod('POST'); $bnc->setPOSTstring($bnc->prepareDATAstring($data)); $bnc->setURL($marketplace_server . "/download_extension.php?asc_action=SendExtension"); $bnc->setProto('HTTPS'); $result = $bnc->RunRequest(); $response = $result['body']; if ($response != false && $bnc->responseCode < 400) { if (strpos($response, "ERR_") === 0) { modApiFunc("Session", "set", "ErrorMessage", $response); //return $response['err_msg']; } else { $file = fopen($application->getAppIni(PATH_CACHE_DIR) . $extension_name . ".zip", 'w+'); fwrite($file, $response); fclose($file); $installed = modApiFunc("Extension_Manager", "installExtension", $extension_name); if ($installed) { modApiFunc("Session", "set", "InstallMessage", "1"); CCacheFactory::clearAll(); $request = new Request(); $request->setView(CURRENT_REQUEST_URL); $request->setKey('identifier', 'ExtensionManager_ListView'); $application->redirect($request); } else { modApiFunc("Session", "set", "ErrorMessage", "ERR_CHK_ZIP_OR_PERMISSIONS"); } } } else { modApiFunc("Session", "set", "ErrorMessage", "ERR_MARKETPLACE_NOT_AVAILABLE"); } }
function _makeTest($test_number, $coming_answer) { $this->updateTestRewriteBase($test_number); $req = new Request(); $base_url = $req->getURL(); $base_url = preg_replace("/\\/[^\\/]*\$/", "", $base_url); $test_url = $base_url . '/mod_rewrite_test_' . sprintf("%02d", $test_number) . '/test.html'; echo "{$test_url}\n"; loadCoreFile('bouncer.php'); $bnc = new Bouncer(); $bnc->setMethod("GET"); $bnc->setHTTPversion("1.0"); $bnc->setURL($test_url); echo date("Y-m-d H:i:s", time()) . "\n"; $res = $bnc->RunRequest(); echo date("Y-m-d H:i:s", time()) . "\n"; if ($res != false) { if (trim($res["body"]) == $coming_answer) { return true; } } return false; }
function __makeTestHttpsRequest($get_array, $url) { loadCoreFile('bouncer.php'); $bnc = new Bouncer(); if (!$bnc->isSSLavailable()) { return "SSL_not_available"; } $bnc->setMethod('GET'); $bnc->setGETstring($bnc->prepareDATAstring($get_array)); $bnc->setURL($url); $result = $bnc->RunRequest(); if (is_array($result) && isset($result["body"]) && strstr($result["body"], "YES")) { return true; } else { return false; } }
function getLatestCoreVer() { global $application; $_state = modApiFunc("License", "checkLicense"); $licenseInfo = modApiFunc("License", "getLicenseInfo", $_state); if ($licenseInfo["license_key"] == LICENSE_KEY_UNDEFINED) { $result['body'] = PRODUCT_VERSION_NUMBER; } if ($this->isMarketplaceUpdateRequired()) { $this->marketplace_server = $application->getAppIni('MARKETPLACE_SERVER'); $data = array('license' => $licenseInfo["license_key"], 'store_url' => urlencode(modApiFunc('Request', 'selfURL')), 'store_version' => PRODUCT_VERSION_NUMBER); loadCoreFile('bouncer.php'); $bnc = new Bouncer(); $bnc->setMethod('POST'); $bnc->setPOSTstring($bnc->prepareDATAstring($data)); $bnc->setURL($this->marketplace_server . "/download_extension.php?asc_action=GetLatestCoreVersion"); $bnc->setProto('HTTPS'); $result = $bnc->RunRequest(); if ($result != false && $bnc->responseCode < 400) { $latest_core_version = $result['body']; /* Update Latest core version */ $params = array('group_name' => 'AVACTIS_LATEST_VERSION', 'param_name' => 'AVACTIS_LATEST_VERSION', 'value' => $latest_core_version); execQuery('UPDATE_SETTINGS_PARAM_VALUE', $params); return $latest_core_version; } } //Error while calling marketplace or TTL not expired then return from database $result = execQuery('SELECT_SETTINGS_PARAM_BASE_INFO', array('group_name' => 'AVACTIS_LATEST_VERSION', 'param_name' => 'AVACTIS_LATEST_VERSION')); $latest_core_version = $result[0]['param_current_value']; return $latest_core_version; }
<?php include 'bouncer.php'; if ($_POST != null) { $bouncer = new Bouncer(); $bouncer->checkGuestList($_POST['name']); $bouncer->checkAge($_POST['age']); // $alert[] = Bouncer::checkGuestList($_POST['name']); // $alert[] = Bouncer::checkAge($_POST['age']); } ?> <html> <head> <meta charset="UTF-8"> <title>The Club</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="club-entrance"> <h2>Welcome to THE CLUB</h2> <?php if (isset($bouncer->alert)) { foreach ($bouncer->alert as $message) { echo '<p class="alert">' . $message . '</p>'; } } ?> <form action="club.php" method="POST"> <label for="name">Enter Name:</label> <input type="text" name="name"> <label for="age">Enter Age:</label>
public static function load() { Bouncer::addRule('request', array('Bouncer_Rules_Request', 'request_headers')); }
function sendRequest($HTTPSURL) { loadCoreFile('bouncer.php'); $bnc = new Bouncer(); $bnc->setMethod('GET'); $bnc->setGETstring($bnc->prepareDATAstring(array("request" => "is_connection_available"))); $bnc->setURL($HTTPSURL . "avactis-system/admin/test_connection.php"); $result = $bnc->RunRequest(); $URL_correct = false; if (is_array($result) && isset($result["body"]) && strstr($result["body"], "YES")) { $URL_correct = true; } return $URL_correct; }
public static function backend() { if (empty(self::$_backendInstance)) { switch (self::$_backend) { case 'memcache': require_once dirname(__FILE__) . '/Backend/Memcache.php'; $options = array('prefix' => self::$_prefix); if (!empty(self::$_servers)) { $options['servers'] = self::$_servers; } self::$_backendInstance = new Bouncer_Backend_Memcache($options); break; case 'redis': case 'phpredis': $options = array('namespace' => self::$_prefix); if (!empty(self::$_servers)) { $options['servers'] = array(); foreach (self::$_servers as $host) { if (strpos($host, '@')) { list($password, $host) = explode('@', $host); if (strpos($password, ':')) { list($username, $password) = explode(':', $password); } } $port = 6379; if (strpos($host, ':')) { list($host, $port) = explode(':', $host); } $timeout = 1; $readTimeout = 1; $options['servers'][] = compact('host', 'port', 'username', 'password', 'timeout', 'readTimeout'); } } if (self::$_backend == 'phpredis') { require_once dirname(__FILE__) . '/Backend/PhpRedis.php'; self::$_backendInstance = new Bouncer_Backend_PhpRedis($options); } else { require_once dirname(__FILE__) . '/Backend/Redis.php'; self::$_backendInstance = new Bouncer_Backend_Redis($options); } break; } } return self::$_backendInstance; }
/** * */ function output() { global $application; $request = new Request(); $request->setView('HTTPSSettings'); $request->setAction('UpdateHTTPSSettings'); $formAction = $request->getURL(); loadCoreFile('bouncer.php'); $bnc = new Bouncer(); if (!$bnc->isSSLavailable()) { $this->SSLAvailable = false; } if (modApiFunc("Session", "is_set", "SessionPost")) { $HTTPSSettings = modApiFunc("Session", "get", "SessionPost"); modApiFunc("Session", "un_set", "SessionPost"); if (isset($HTTPSSettings["hasCloseScript"]) && $HTTPSSettings["hasCloseScript"] == "true") { modApiFunc("application", "closeChild_UpdateTop"); return; } if ($HTTPSSettings["Message"] != "") { $HTTPSSettings["Message"] = $this->MessageResources->getMessage($HTTPSSettings["Message"]); } } else { $HTTPSSettings = modApiFunc("HTTPS", "getHTTPSSettings"); $HTTPSSettings["Message"] = ""; if ($HTTPSSettings["URLS"]["HTTPS_URL"] == "") { if (($URL = modApiFunc("HTTPS", "tryToFindHttpsUrl")) == "SSL_not_available") { $this->SSLAvailable = false; } else { $HTTPSSettings["URLS"]["HTTPS_URL"] = $URL; } $HTTPSSettings["FirstTimeSettings"] = "true"; } else { $HTTPSSettings["FirstTimeSettings"] = "false"; } } $HTTPSSettings['Message'] = $this->checkPerms(); if ($HTTPSSettings["Message"] != "") { $HTTPSSettings["Message"] = $this->MessageResources->getMessage($HTTPSSettings["Message"]); } $template_contents = array("FormAction" => $formAction, "HTTPSURL" => strtr($HTTPSSettings["URLS"]["HTTPS_URL"], array("https://" => "")), "All" => $HTTPSSettings["SECURE_SECTIONS"]["AllAdminArea"] ? "checked" : "", "SignIn_AdminMembers" => $HTTPSSettings["SECURE_SECTIONS"]["SignIn_AdminMembers"] ? "checked" : "", "Orders_Customers" => $HTTPSSettings["SECURE_SECTIONS"]["Orders_Customers"] ? "checked" : "", "Payment_Shipping" => $HTTPSSettings["SECURE_SECTIONS"]["Payment_Shipping"] ? "checked" : "", "Message" => $HTTPSSettings["Message"], "FirstTimeSettings" => $HTTPSSettings["FirstTimeSettings"], "SaveButton" => $this->SSLAvailable ? "block" : "none", "CheckButton" => $this->SSLAvailable ? "none" : "block", "SSLAvailable" => $this->SSLAvailable ? "true" : "false", "CZHTTPSSettings" => $this->outputCZLayoutHTTPSSettings(), "ResultMessageRow" => $this->outputResultMessage()); $this->_Template_Contents = $template_contents; $application->registerAttributes($this->_Template_Contents); return modApiFunc('TmplFiller', 'fill', "https/https_settings/", "container.tpl.html", array()); }
<?php error_reporting(E_ALL & ~E_DEPRECATED); require_once 'include/config.php'; include 'include/Database.php'; include 'include/Bouncer.php'; foreach ($controllers as $controller) { include 'controller/' . $controller . 'Controller.php'; } try { $db = new Database($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name'], $config['db_pref']); $bouncer = new Bouncer($db, $config['master_pass']); $db = $bouncer->guard(); $front = new DefaultController(); if (isset($_REQUEST['site'])) { $controller = ucfirst(strtolower($_REQUEST['site'])) . 'Controller'; } else { $controller = ''; } if (class_exists($controller)) { $front = new $controller(); } $front->run($db, $bouncer); } catch (Exception $e) { $template = $twig->loadTemplate('error.twig'); echo $template->render(array('error' => htmlspecialchars($e->getMessage()))); }
function __getRateFromWebServiceX($from, $to) { loadCoreFile('bouncer.php'); $bnc = new Bouncer(); $bnc->setHTTPversion("1.0"); $bnc->setMethod("GET"); $bnc->setURL("http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate"); $bnc->setSocketReadTimeout(10); $get_params = array("FromCurrency" => $from, "ToCurrency" => $to); $bnc->setGETstring($bnc->prepareDATAstring($get_params)); $res = $bnc->RunRequest(); if ($res != false) { $xml = $res["body"]; loadCoreFile('obj_xml.php'); $parser = new xml_doc($xml); $parser->parse(); foreach ($parser->xml_index as $node) { if ($node->name = "DOUBLE") { $rate = $node->contents; if ($rate == 0) { $rate = false; } $this->__addRequestToTimeline('www.webservicex.net', $from, $to, $rate, $bnc, $res); return $rate; } } } $this->__addRequestToTimeline('www.webservicex.net', $from, $to, false, $bnc, $res); return false; }
public static function load() { Bouncer::addRule('browser_identity', array('Bouncer_Rules_Fingerprint', 'analyseIdentity')); Bouncer::addRule('robot_identity', array('Bouncer_Rules_Fingerprint', 'analyseIdentity')); }
public static function load() { Bouncer::addRule('agent_infos', array('Bouncer_Rules_Bbclone', 'agentInfos')); // Bouncer::addRule('ip_infos', array('Bouncer_Rules_Bbclone', 'ipInfos')); }
public static function load() { Bouncer::addRule('browser_identity', array('Bouncer_Rules_Browser', 'browser_identity')); Bouncer::addRule('request', array('Bouncer_Rules_Browser', 'browser_request')); }