Changeset 911 for trunk/admin/config.example.php
- Timestamp:
- 06/20/2012 03:57:51 AM (11 months ago)
- Files:
-
- 1 moved
-
trunk/admin/config.example.php (moved) (moved from trunk/admin/config.default.php) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/config.example.php
r902 r911 1 1 <?php 2 2 3 // this is default config, DO NOT modify this file 4 // copy this file and write your own config and name it as config.php 3 // DO NOT modify this file 4 // if you want to customize config, copy this file and name it as config.php 5 // upgrading your config.php when config.example.php were upgraded 5 6 6 // detected by browser7 // leave this setting unset to auto detect using browser request header 7 8 // $config['lang'] = 'en-us'; 8 9 9 10 $config['charset'] = "UTF-8"; 10 11 11 // translators only12 // enable this for translators only 12 13 $config['show_todo_strings'] = false; 13 14 … … 21 22 22 23 // this ob filter is applied for the cache list, not the whole page 23 $config['path_nicer'] = 'ob_filter_path_nicer_default';24 25 /*26 24 function custom_ob_filter_path_nicer($list_html) 27 25 { … … 30 28 } 31 29 $config['path_nicer'] = 'custom_ob_filter_path_nicer'; 32 */33 30 34 // you can simply let xcache to do the http auth 35 // but if you have your home made login/permission system, you can implement the following 36 // {{{ home made login example 31 // XCache builtin http auth is enforce for security reason 32 // if http auth is disabled, any vhost user that can upload *.php, will see all variable data cached in XCache 33 34 // but if you have your own login/permission system, you can use the following example 35 // {{{ login example 37 36 // this is an example only, it's won't work for you without your implemention. 38 37 /* … … 42 41 session_start(); 43 42 44 if (!user_logined()) { 43 if (user_logined()) { 44 user_load_permissions(); 45 if (user_is_admin()) { 46 // user is trusted after permission checks above. 47 // tell XCache about it (the only secure way to by pass XCache http auth) 48 $_SERVER["PHP_AUTH_USER"] = "moo"; 49 $_SERVER["PHP_AUTH_PW"] = "your-xcache-password-before-md5"; 50 } 51 else { 52 die("Permission denied"); 53 } 54 } 55 else { 45 56 if (!ask_the_user_to_login()) { 46 57 exit; … … 48 59 } 49 60 50 user_load_permissions();51 if (!user_is_admin()) {52 die("Permission denied");53 }54 55 // user is trusted after permission checks above.56 // tell XCache about it (the only way to by pass XCache http auth)57 $_SERVER["PHP_AUTH_USER"] = "moo";58 $_SERVER["PHP_AUTH_PW"] = "your-xcache-password";59 61 return true; 60 62 } … … 66 68 /* by pass XCache http auth 67 69 $_SERVER["PHP_AUTH_USER"] = "moo"; 68 $_SERVER["PHP_AUTH_PW"] = "your-xcache-password ";70 $_SERVER["PHP_AUTH_PW"] = "your-xcache-password-before-md5"; 69 71 */ 70 72

