| [34] | 1 | <?php |
|---|
| 2 | |
|---|
| [911] | 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 |
|---|
| [34] | 6 | |
|---|
| [911] | 7 | // leave this setting unset to auto detect using browser request header |
|---|
| [902] | 8 | // $config['lang'] = 'en-us'; |
|---|
| [123] | 9 | |
|---|
| [902] | 10 | $config['charset'] = "UTF-8"; |
|---|
| [34] | 11 | |
|---|
| [911] | 12 | // enable this for translators only |
|---|
| [902] | 13 | $config['show_todo_strings'] = false; |
|---|
| [123] | 14 | |
|---|
| [526] | 15 | // width of graph for free or usage blocks |
|---|
| [902] | 16 | $config['percent_graph_width'] = 120; |
|---|
| 17 | $config['percent_graph_type'] = 'used'; // either 'used' or 'free' |
|---|
| [517] | 18 | |
|---|
| [591] | 19 | // only enable if you have password protection for admin page |
|---|
| 20 | // enabling this option will cause user to eval() whatever code they want |
|---|
| [902] | 21 | $config['enable_eval'] = false; |
|---|
| [591] | 22 | |
|---|
| [34] | 23 | // this ob filter is applied for the cache list, not the whole page |
|---|
| [902] | 24 | function custom_ob_filter_path_nicer($list_html) |
|---|
| [34] | 25 | { |
|---|
| [902] | 26 | $list_html = ob_filter_path_nicer_default($list_html); // this function is from common.php |
|---|
| 27 | return $list_html; |
|---|
| [34] | 28 | } |
|---|
| [902] | 29 | $config['path_nicer'] = 'custom_ob_filter_path_nicer'; |
|---|
| [34] | 30 | |
|---|
| [911] | 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 |
|---|
| [34] | 36 | // this is an example only, it's won't work for you without your implemention. |
|---|
| [902] | 37 | /* |
|---|
| [34] | 38 | function check_admin_and_by_pass_xcache_http_auth() |
|---|
| 39 | { |
|---|
| 40 | require("/path/to/user-login-and-permission-lib.php"); |
|---|
| 41 | session_start(); |
|---|
| 42 | |
|---|
| [911] | 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 { |
|---|
| [34] | 56 | if (!ask_the_user_to_login()) { |
|---|
| 57 | exit; |
|---|
| 58 | } |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | return true; |
|---|
| 62 | } |
|---|
| 63 | |
|---|
| [902] | 64 | check_admin_and_by_pass_xcache_http_auth(); |
|---|
| 65 | */ |
|---|
| [34] | 66 | // }}} |
|---|
| 67 | |
|---|
| [902] | 68 | /* by pass XCache http auth |
|---|
| 69 | $_SERVER["PHP_AUTH_USER"] = "moo"; |
|---|
| [911] | 70 | $_SERVER["PHP_AUTH_PW"] = "your-xcache-password-before-md5"; |
|---|
| [902] | 71 | */ |
|---|
| 72 | |
|---|
| [34] | 73 | ?> |
|---|