| 1 | <?php |
|---|
| 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 |
|---|
| 5 | |
|---|
| 6 | // detected by browser |
|---|
| 7 | // $config['lang'] = 'en-us'; |
|---|
| 8 | |
|---|
| 9 | $config['charset'] = "UTF-8"; |
|---|
| 10 | |
|---|
| 11 | // translators only |
|---|
| 12 | $config['show_todo_strings'] = false; |
|---|
| 13 | |
|---|
| 14 | // width of graph for free or usage blocks |
|---|
| 15 | $config['percent_graph_width'] = 120; |
|---|
| 16 | $config['percent_graph_type'] = 'used'; // either 'used' or 'free' |
|---|
| 17 | |
|---|
| 18 | // only enable if you have password protection for admin page |
|---|
| 19 | // enabling this option will cause user to eval() whatever code they want |
|---|
| 20 | $config['enable_eval'] = false; |
|---|
| 21 | |
|---|
| 22 | // 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 | function custom_ob_filter_path_nicer($list_html) |
|---|
| 27 | { |
|---|
| 28 | $list_html = ob_filter_path_nicer_default($list_html); // this function is from common.php |
|---|
| 29 | return $list_html; |
|---|
| 30 | } |
|---|
| 31 | $config['path_nicer'] = 'custom_ob_filter_path_nicer'; |
|---|
| 32 | */ |
|---|
| 33 | |
|---|
| 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 |
|---|
| 37 | // this is an example only, it's won't work for you without your implemention. |
|---|
| 38 | /* |
|---|
| 39 | function check_admin_and_by_pass_xcache_http_auth() |
|---|
| 40 | { |
|---|
| 41 | require("/path/to/user-login-and-permission-lib.php"); |
|---|
| 42 | session_start(); |
|---|
| 43 | |
|---|
| 44 | if (!user_logined()) { |
|---|
| 45 | if (!ask_the_user_to_login()) { |
|---|
| 46 | exit; |
|---|
| 47 | } |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 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 | return true; |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | check_admin_and_by_pass_xcache_http_auth(); |
|---|
| 63 | */ |
|---|
| 64 | // }}} |
|---|
| 65 | |
|---|
| 66 | /* by pass XCache http auth |
|---|
| 67 | $_SERVER["PHP_AUTH_USER"] = "moo"; |
|---|
| 68 | $_SERVER["PHP_AUTH_PW"] = "your-xcache-password"; |
|---|
| 69 | */ |
|---|
| 70 | |
|---|
| 71 | ?> |
|---|