Ignore:
Timestamp:
2012-06-20T03:57:51+02:00 (2 years ago)
Author:
moo
Message:

adding back example file

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/admin/config.example.php

    r910 r911  
    11<?php 
    22 
    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 
    56 
    6 // detected by browser 
     7// leave this setting unset to auto detect using browser request header 
    78// $config['lang'] = 'en-us'; 
    89 
    910$config['charset'] = "UTF-8"; 
    1011 
    11 // translators only 
     12// enable this for translators only 
    1213$config['show_todo_strings'] = false; 
    1314 
     
    2122 
    2223// this ob filter is applied for the cache list, not the whole page 
    23 $config['path_nicer'] = 'ob_filter_path_nicer_default'; 
    24  
    25 /* 
    2624function custom_ob_filter_path_nicer($list_html) 
    2725{ 
     
    3028} 
    3129$config['path_nicer'] = 'custom_ob_filter_path_nicer'; 
    32 */ 
    3330 
    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 
    3736// this is an example only, it's won't work for you without your implemention. 
    3837/* 
     
    4241    session_start(); 
    4342 
    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 { 
    4556        if (!ask_the_user_to_login()) { 
    4657            exit; 
     
    4859    } 
    4960 
    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"; 
    5961    return true; 
    6062} 
     
    6668/* by pass XCache http auth 
    6769$_SERVER["PHP_AUTH_USER"] = "moo"; 
    68 $_SERVER["PHP_AUTH_PW"] = "your-xcache-password"; 
     70$_SERVER["PHP_AUTH_PW"] = "your-xcache-password-before-md5"; 
    6971*/ 
    7072 
Note: See TracChangeset for help on using the changeset viewer.