|
Last change
on this file since 605 was
605,
checked in by moo, 4 years ago
|
|
eol-style
|
-
Property svn:eol-style set to
native
|
|
File size:
1.2 KB
|
| Rev | Line | |
|---|
| [33] | 1 | <?php |
|---|
| 2 | |
|---|
| [124] | 3 | // this is an example only |
|---|
| 4 | // write your own config and name it as config.php |
|---|
| [33] | 5 | |
|---|
| [124] | 6 | // detected by browser |
|---|
| 7 | // $lang = 'en-us'; |
|---|
| 8 | |
|---|
| [33] | 9 | $charset = "UTF-8"; |
|---|
| [124] | 10 | |
|---|
| 11 | // developers only |
|---|
| 12 | $show_todo_strings = false; |
|---|
| 13 | |
|---|
| [33] | 14 | // $include_paths = array("/www/my-php-project/"); |
|---|
| 15 | // $exclude_paths = array("/www/my-php-project/tmp/"); |
|---|
| 16 | $syntaxhiglight = true; |
|---|
| 17 | $usecache = false; |
|---|
| 18 | //// $datadir is default to ini_get("xcache.coveragedump_directory") |
|---|
| 19 | // $datadir = ''; |
|---|
| 20 | |
|---|
| 21 | function ob_filter_path_nicer($o) |
|---|
| 22 | { |
|---|
| [172] | 23 | $sep = DIRECTORY_SEPARATOR; |
|---|
| [525] | 24 | $o = str_replace($_SERVER['DOCUMENT_ROOT'], "{DOCROOT}" . (substr($d, -1) == $sep ? $sep : ""), $o); |
|---|
| [172] | 25 | $xcachedir = realpath(dirname(__FILE__) . "$sep..$sep"); |
|---|
| 26 | $o = str_replace($xcachedir . $sep, "{XCache}$sep", $o); |
|---|
| 27 | if ($sep == '/') { |
|---|
| 28 | $o = str_replace("/home/", "{H}/", $o); |
|---|
| 29 | } |
|---|
| [33] | 30 | return $o; |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| [124] | 33 | // implement your auth here if needed |
|---|
| 34 | // {{{ home made login example |
|---|
| 35 | // this is an example only, it's won't work for you without your implemention. |
|---|
| 36 | function check_admin_auth() |
|---|
| 37 | { |
|---|
| 38 | require("/path/to/user-login-and-permission-lib.php"); |
|---|
| 39 | session_start(); |
|---|
| 40 | |
|---|
| 41 | if (!user_logined()) { |
|---|
| 42 | if (!ask_the_user_to_login()) { |
|---|
| 43 | exit; |
|---|
| 44 | } |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | user_load_permissions(); |
|---|
| 48 | if (!user_is_admin()) { |
|---|
| 49 | die("Permission denied"); |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | return true; |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | // uncomment: |
|---|
| 56 | // check_admin_auth() |
|---|
| 57 | // }}} |
|---|
| 58 | |
|---|
| [33] | 59 | ?> |
|---|
Note: See
TracBrowser
for help on using the repository browser.