Changeset 1042
- Timestamp:
- 05/20/06 16:28:27 (7 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 7 modified
-
CHANGELOG (modified) (1 diff)
-
wifidog/classes/GenericObject.php (modified) (1 diff)
-
wifidog/classes/Server.php (modified) (5 diffs)
-
wifidog/cron/page.php (modified) (1 diff)
-
wifidog/include/common.php (modified) (5 diffs)
-
wifidog/include/path_defines_base.php (modified) (4 diffs)
-
wifidog/media/base_theme/stylesheet.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/CHANGELOG
r1039 r1042 1 2006-05-20 Benoit Grégoire <bock@step.polymtl.ca> 2 * page.php: Fix bugs in various files preventing the system from working from the command line. 3 1 4 2006-05-20 Benoit Grégoire <bock@step.polymtl.ca> 2 5 * More install script fixes: Phlickr wouldn't install, and the permissions of wifidog/tmp/smarty/cache weren't checked. -
trunk/wifidog-auth/wifidog/classes/GenericObject.php
r1031 r1042 45 45 * Load content classes 46 46 */ 47 require_once('classes/Content.php');48 47 49 48 /** -
trunk/wifidog-auth/wifidog/classes/Server.php
r1013 r1042 46 46 */ 47 47 require_once('classes/GenericObject.php'); 48 require_once('classes/User.php');49 48 50 49 /** … … 208 207 public static function getCurrentServer($siltent = false) 209 208 { 209 if(empty($_SERVER['SERVER_NAME'])) 210 { 211 return null; //We were probably called from the command line 212 } 210 213 // Define globals 211 214 global $db; … … 390 393 public static function processCreateNewObjectUI() 391 394 { 395 require_once('classes/User.php'); 392 396 // Init values 393 397 $_retVal = null; … … 775 779 public function processAdminUI() 776 780 { 781 require_once('classes/User.php'); 777 782 if (!User::getCurrentUser()->isSuperAdmin()) { 778 783 throw new Exception(_('Access denied!')); … … 823 828 public function delete(&$errmsg) 824 829 { 825 // Define globals 830 require_once('classes/User.php'); 831 // Define globals 826 832 global $db; 827 833 -
trunk/wifidog-auth/wifidog/cron/page.php
r947 r1042 45 45 * Load required files 46 46 */ 47 47 48 require_once(dirname(__FILE__) . '/../include/common.php'); 48 49 -
trunk/wifidog-auth/wifidog/include/common.php
r1031 r1042 50 50 * Include configuration file 51 51 */ 52 /** search parent directory hierarchy for a file */ 53 function cmnSearchParentDirectories($dirname, $searchfor) { 54 $pieces = explode(DIRECTORY_SEPARATOR, $dirname); 55 $is_absolute = substr($dirname, 0, 1) === DIRECTORY_SEPARATOR ? 1 : 0; 56 57 for ($i = count($pieces); $i > $is_absolute; $i --) { 58 $filename = implode(DIRECTORY_SEPARATOR, array_merge(array_slice($pieces, 0, $i), array ($searchfor))); 59 if (file_exists($filename)) 60 return $filename; 61 } 62 63 return false; 64 } 65 function cmnRequireConfig($config_file = 'config.php') { 66 global $AVAIL_LOCALE_ARRAY; // so that nobody has to change their custom config.php 67 $config_path = cmnSearchParentDirectories(dirname(__FILE__), $config_file); 68 if (!empty ($config_path)) 69 require_once ($config_path); 70 } 52 71 cmnRequireConfig(); 53 72 … … 82 101 require_once('classes/Dependencies.php'); 83 102 require_once('classes/Server.php'); 84 103 echo "test\n"; 85 104 global $db; 86 105 … … 108 127 109 128 /** 110 * Set paths 111 */ 129 * Set the URL paths, but only if we are NOT called from the command line 130 */ 131 if (defined('SYSTEM_PATH')) 132 { 112 133 require_once('path_defines_url_content.php'); 134 } 113 135 114 136 /* Constant shared with the gateway … … 210 232 } 211 233 212 /** search parent directory hierarchy for a file */ 213 function cmnSearchParentDirectories($dirname, $searchfor) { 214 $pieces = explode(DIRECTORY_SEPARATOR, $dirname); 215 $is_absolute = substr($dirname, 0, 1) === DIRECTORY_SEPARATOR ? 1 : 0; 216 217 for ($i = count($pieces); $i > $is_absolute; $i --) { 218 $filename = implode(DIRECTORY_SEPARATOR, array_merge(array_slice($pieces, 0, $i), array ($searchfor))); 219 if (file_exists($filename)) 220 return $filename; 221 } 222 223 return false; 224 } 234 225 235 226 236 /** join file path pieces together */ … … 310 320 311 321 return false; // package was not found 312 }313 314 function cmnRequireConfig($config_file = 'config.php') {315 global $AVAIL_LOCALE_ARRAY; // so that nobody has to change their custom config.php316 $config_path = cmnSearchParentDirectories(dirname(__FILE__), $config_file);317 if (!empty ($config_path))318 require_once ($config_path);319 322 } 320 323 -
trunk/wifidog-auth/wifidog/include/path_defines_base.php
r1035 r1042 68 68 */ 69 69 70 70 71 /* 71 72 * Tests ... 72 73 * 73 74 74 echo '$_SERVER[\'DOCUMENT_ROOT\']: ' . $_SERVER['DOCUMENT_ROOT'] . '<br/>'; 75 75 // Not always available on Windows … … 93 93 echo "<br/>"; 94 94 95 *96 *97 *98 99 95 // This will never work for subdirectories 100 96 $path_tmp = strstr($_SERVER['SCRIPT_FILENAME'], $_SERVER['PHP_SELF']); … … 107 103 */ 108 104 109 if (!defined('SYSTEM_PATH') || !defined('WIFIDOG_ABS_FILE_PATH')) { 110 /** 111 * Detect wifidog-auth directory base 112 */ 113 105 if (!defined('WIFIDOG_ABS_FILE_PATH')) { 114 106 // the name of this file's parent directory is the wifidog root. 115 107 // that's a constant, ok, unless this file moves up or down in the hierarchy. 116 108 $wifidog_base = dirname(dirname(__FILE__)); 117 109 define('WIFIDOG_ABS_FILE_PATH', $wifidog_base . "/"); 110 } 111 if (!defined('SYSTEM_PATH') && isset($_SERVER['REQUEST_URI'])) { 112 /** 113 * Detect wifidog-auth directory base, but only if we are NOT called from the 114 * command line 115 */ 118 116 $browser_url = $_SERVER['SCRIPT_NAME']; // browser url to the script 119 117 $apache_path = $_SERVER['SCRIPT_FILENAME']; // system path to the very same script 120 while ($browser_url != "" && $browser_url != "/" && $apache_path != $wifidog_base) {118 while ($browser_url != "" && $browser_url != "/" && $apache_path != WIFIDOG_ABS_FILE_PATH) { 121 119 // find the URI that maps to the wifidog base. 122 // figure out the difference between the browser's url, the file system path, and $wifidog_base,120 // figure out the difference between the browser's url, the file system path, and WIFIDOG_ABS_FILE_PATH, 123 121 // piece by piece, starting on the right. 124 122 // The point at which they diverge defines our DOCUMENT_ROOT and SYSTEM_PATH … … 139 137 if ($browser_url == "" || substr($browser_url,-1,1) != '/') $browser_url .= '/'; 140 138 if (!defined('SYSTEM_PATH')) define('SYSTEM_PATH', $browser_url); 139 } 141 140 142 //if (!defined('WIFIDOG_ABS_FILE_PATH')) define('WIFIDOG_ABS_FILE_PATH', $apache_path . "/");143 if (!defined('WIFIDOG_ABS_FILE_PATH')) define('WIFIDOG_ABS_FILE_PATH', $wifidog_base . "/");144 }145 141 146 142 /* 147 143 * Debug output 148 144 * 149 150 145 echo "SYSTEM_PATH: " . SYSTEM_PATH . "<br/>"; 151 146 echo "WIFIDOG_ABS_FILE_PATH: " . WIFIDOG_ABS_FILE_PATH . "<br/>"; 152 147 exit; 153 154 148 * 155 149 * End of debug output -
trunk/wifidog-auth/wifidog/media/base_theme/stylesheet.css
r1037 r1042 5 5 margin: 0px; 6 6 padding: 0px; 7 font-family: arial, sans-serif;7 font-family: sans-serif;; 8 8 color: black; 9 9 font-size: 0.8em; … … 152 152 } 153 153 154 /* NOT GOOT ENOUGH, doesn't work with explorer. Best solution is to override in description and sponsor */155 #main_area_middle>.user_ui_main_outer {156 background: #E9F6FF;157 margin: 1em 0em 1em 0em;158 padding: 1em;159 border: 1px solid #B4DFFF;160 color: #3D586B;161 }162 154 #main_area_bottom { 163 155 margin: 1em; … … 464 456 .user_ui_container { 465 457 display: block; 458 background: #E9F6FF; 459 color: #3D586B; 466 460 } 467 461 .user_ui_title { 468 462 display: block; 469 font-size: medium; 470 font-weight: bold; 471 472 color: #46a43a; 473 border : 1px solid #46a43a; 474 background-color : #daedd8; 463 font-size: 1em; 464 font-weight: bold; 465 } 466 #main_area_middle .user_ui_container { 467 475 468 } 476 469 .user_ui_title a {
