| [ Index ] |
|
Code source de bblocked 0.6.5 |
1 <?php 2 /*********************************************************\ 3 ****** bblocked Config File ****** 4 ***** ***** 5 **** Copyleft (C) 2007 bblocked **** 6 *** *** 7 ** This program is free software; you can redistribute it and/or ** 8 ** modify it under the terms of the GNU General Public License ** 9 ** as published by the Free Software Foundation; either version 2 ** 10 ** of the License, or (at your option) any later version. ** 11 ** ** 12 ** This program is distributed in the hope that it will be useful, ** 13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 15 ** GNU General Public License for more details. ** 16 *** *** 17 **** **** 18 **** http://www.bblocked.org/ ***** 19 ****** ****** 20 \*********************************************************/ 21 22 23 /* Do not remove, prevents direct file access */ 24 if(!defined('BB')) 25 die(); 26 27 28 // Configuration Vars 29 30 $_config = array( 31 32 33 // Apperance configurations 34 35 'template_name' => 'sky', // Name of the template to apply to bblocked pages 36 'force_title' => 0, // Force bblocked title on proxied pages 37 'powered_by' => 1, // Adds Powered by.... 38 39 'title' => 'bblocked -:- Unleash the Web', // Title of bblocked pages 40 'powered_by_text' => '{:title:} - Powered by bblocked', // Place {:title:} where you wish the *real* title to go. 41 42 43 // General configurations 44 45 'suppress_errors' => 0, // Force bblocked to suppress as many errors as it can... even warnings about register_globals or SSL 46 'file_uploads' => 1, // Allow users to upload files through the proxy 47 'encode_urls' => 2, // 0 = none; 1 = ROT13; 2 = base64; 3 = base35 48 'rewrite_css' => 1, // Atempt to rewrite CSS URLs 49 'rewrite_script' => 1, // Atempt to rewrite JavaScript/VBScript URLs 50 'remove_script' => 0, // Remove JavaScript/VBScript 51 'unsecure_ssl' => 1, // Allow users to make request to SSL hosts even if bblocked is not on an SSL server 52 53 54 // HTTP Header configurations 55 56 'user_agent' => '', // Custom User-Agent (leave blank to uses the user's User-Agent) 57 'remove_referer' => 0, // Remove Referer header 58 'accept_cookies' => 1, // Allow sites to set cookies 59 'session_cookies' => 1, // Treat all cookie as session cookies 60 61 62 // Global Cache settings (alpha) 63 64 'enable_cache' => 0, // Enable gobal caching 65 'cache_time' => 360, // Max time to keep caches (in minutes) 66 'cache_dir' => 'cache', // Directory to keep caches in 67 68 69 // External HTTP Proxy settings 70 71 'proxy_enable' => 0, // Enable external HTTP proxing 72 'proxy_host' => '127.0.0.1', // IP address of external HTTP proxy server 73 'proxy_port' => 8080, // Server port of external HTTP proxy server 74 75 76 // Argument names 77 78 'arg_url' => 'url', // Argument to carry URL requests 79 'arg_page' => 'page', // Argument to carry page requests 80 'arg_realm' => 'realm', // Argument to carry Basic HTTP realm name 81 'arg_user' => 'username', // Argument to carry Basic HTTP username 82 'arg_pass' => 'password', // Argument to carry Basic HTTP passowrd 83 84 85 // Page type names 86 87 'page_proxy' => 'data', // Value for arg_page to define the proxy page 88 'page_frame_setup' => 'start', // Value for arg_page to define the frame setup page 89 'page_frame_header' => 'header', // Value for arg_page to define the frame header page 90 91 92 // Keyword Search settings 93 94 'search_keywords' => 1, // Use Keyword searches when domain doesn't exist 95 // Below is the URL to use for searches (* denotes where the search query is to be placed) 96 'keyword_url' => 'http://www.google.com/search?hl=en&q=*&btnI=I%27m+Feeling+Lucky&meta=', 97 98 99 // Bad Word Scrambler 100 101 'scramble_bad_words' => 1, // Scramble words that proxies would block | Use 2 for Base64 102 // Below is the list of words to scramble (seperate with a comma) 103 'bad_words' => 'arse,arsehole,asshole,bastard,berk,crap,cunt,dick,dickhead,fuck,fuckhead,gay,lesbian,penis,porn,pussy,sex,twat,wanker', 104 105 106 // Set options allowed to users 107 108 'allow_user_settings' => 0, // Allow users to set options for surfing 109 110 'user_settings' => array( 111 112 'accept_cookies' => array( 113 'type' => 'checkbox', 114 'desc' => 'Accept cookies.', 115 'force' => 0 116 ), 117 'session_cookies' => array( 118 'type' => 'checkbox', 119 'desc' => 'Treat all cookies as session cookies.', 120 'force' => 0 121 ), 122 'force_title' => array( 123 'type' => 'checkbox', 124 'desc' => 'Remove page titles.', 125 'force' => 0 126 ), 127 'remove_script' => array( 128 'type' => 'checkbox', 129 'desc' => 'Remove client-side scripts.', 130 'force' => 0 131 ), 132 'remove_referer' => array( 133 'type' => 'checkbox', 134 'desc' => 'Remove HTTP referer header.', 135 'force' => 0 136 ), 137 'encode_urls' => array( 138 'type' => 'select', 139 'values' => 'none|rot13|base64|base35', 140 'desc' => 'URL encoding', 141 'force' => 0 142 ) 143 ), 144 145 146 // Disallow IP addresses (supports single IPs, CIDR notation and subnet) 147 148 'ip_range' => array( 149 150 // Example #1... block a private IP address 151 // 10.13.5.36 152 153 154 // Example #2... block some private networks (CIDR notation) 155 // 192.168/16 156 // 10/8 157 158 159 // Example #2... block localhost IP range (subnet) 160 // 127.0.0.1:255.0.0.0 161 162 ), 163 164 165 // Directory locations 166 167 'icon_dir' => 'icons', // Location of Icon folder 168 'template_dir' => 'templates', // Location of Template folder 169 'rewrite_dir' => 'includes/rewriters', // Location of Rewrite folder 170 171 172 // Automatic configurations - best to not mess with this 173 174 'script_url' => $_SERVER['SCRIPT_NAME'], 175 'script_url_full' => (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'], 176 'script_web_path' => dirname($_SERVER['SCRIPT_NAME']), 177 'script_root_path' => str_replace('\\', '/', realpath('.')), 178 'web_root_path' => ($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : $_SERVER["SCRIPT_NAME"], 179 'bblocked_ver' => '5.6.3', 180 'bblocked_ver_nice' => 'bblocked v5.6.3', 181 'bblocked_ver_full' => 'bblocked/5.6.3' 182 ); 183 184 185 // Clean up $_config & get request page/URL 186 187 if($_config['allow_user_settings']) { 188 189 if(is_array($_SESSION['PREF'])) { 190 191 foreach($_SESSION['PREF'] as $k=>$v) 192 if((bool)$v != false) 193 $_config[$k] = $v; 194 } 195 196 $float = 'left'; 197 $_config['user_options'] = '<div style="clear: both; text-align: left; position: relative; width: 500px; margin: 12px auto 16px auto;">'; 198 199 foreach($_config['user_settings'] as $k=>$v) { 200 201 if(isset($_REQUEST[$k])) { 202 203 $user_vars=1; 204 break; 205 } 206 } 207 208 foreach($_config['user_settings'] as $k=>$v) { 209 210 if((bool)$v['force'] === true) 211 continue; 212 213 if($user_vars) 214 $_config[$k] = $_SESSION['PREF'][$k] = ($_REQUEST[$k] == 'on' ? 1 : (isset($_REQUEST[$k]) ? $_REQUEST[$k] : 0)); 215 216 unset($_POST[$k], $_GET[$k]); 217 218 $_config['user_options'] .= "<div style=\"float: {$float}; width: 50%\">"; 219 220 switch($v['type']) { 221 222 case 'checkbox': 223 $_config['user_options'] .= "<input type=\"checkbox\" name=\"{$k}\" title=\"{$v['name']}\"" . ($_config[$k] == 1 ? ' checked' : '') . "> {$v['desc']}<br />"; 224 225 break; 226 227 case 'radio': 228 $_config['user_options'] .= $v['desc'] . ': '; 229 230 foreach(explode('|', $v['value']) as $vk=>$vv) 231 $_config['user_options'] .= "<input type=\"radio\" name=\"{$k}\" value=\"{$vk}\"" . ($_config[$k] == $vk ? ' checked' : '') . ">{$vv}"; 232 233 break; 234 235 case 'select': 236 $_config['user_options'] .= "{$v['desc']}: <select name=\"{$k}\">"; 237 238 foreach(explode('|', $v['values']) as $vk=>$vv) 239 $_config['user_options'] .= "<option value=\"{$vk}\"" . ($_config[$k] == $vk ? ' selected' : '') . ">{$vv}</option>"; 240 241 $_config['user_options'] .= '</select>'; 242 break; 243 244 case 'text': 245 default: 246 $_config['user_options'] .= "{$v['desc']}<br /><input name=\"{$k}\" title=\"{$v['name']}\" />"; 247 248 break; 249 } 250 251 $_config['user_options'] .= "</div>\n"; 252 $float == 'left' ? $float = 'right' : $float = 'left'; 253 } 254 255 $_config['user_options'] .= '</div>'; 256 } 257 258 unset($_config['user_settings']); 259 260 $_config['cache_dir'] = realpath($_config['cache_dir']) . '/'; 261 $_config['template_dir'] = $_config['template_dir'] . '/' . $_config['template_name']; 262 263 $_config['request_url'] = $_REQUEST[$_config['arg_url']]; 264 $_config['request_page'] = $_REQUEST[$_config['arg_page']]; 265 266 267 // Define Constants 268 269 define('TEMPLATE_FOOTER', $_config['template_dir'] . '/temp_footer.php'); 270 define('TEMPLATE_HEADER', $_config['template_dir'] . '/temp_header.php'); 271 272 define('TEMPLATE_MAIN', $_config['template_dir'] . '/temp_main.php'); 273 define('TEMPLATE_FRAME_SET', $_config['template_dir'] . '/temp_frames_setup.php'); 274 define('TEMPLATE_FRAME_HEAD', $_config['template_dir'] . '/temp_frames_header.php'); 275 define('TEMPLATE_FRAME_NONE', $_config['template_dir'] . '/temp_no_frames.php'); 276 define('TEMPLATE_HTTP_AUTH', $_config['template_dir'] . '/temp_http_auth.php'); 277 278 require_once('include.php'); 279 280 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Tue Nov 20 20:31:26 2007 | par Balluche grâce à PHPXref 0.7 |
|