Changeset 1568 for trunk/include/common.inc.php
- Timestamp:
- Oct 20, 2006, 4:17:53 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/common.inc.php
r1502 r1568 133 133 or die ( "Could not connect to database" ); 134 134 135 // 136 // Setup gallery wide options, if this fails then we output a CRITICAL_ERROR 137 // since basic gallery information is not available 138 // 139 load_conf_from_db(); 140 141 include(PHPWG_ROOT_PATH.'include/user.inc.php'); 142 143 144 // language files 145 include_once(get_language_filepath('common.lang.php')); 146 if (defined('IN_ADMIN') and IN_ADMIN) 147 { 148 include_once(get_language_filepath('admin.lang.php')); 149 } 150 151 // only now we can set the localized username of the guest user (and not in 152 // include/user.inc.php) 153 if ($user['is_the_guest']) 154 { 155 $user['username'] = $lang['guest']; 156 } 157 158 // template instance 159 $template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], $user['theme'] ); 160 161 if ($conf['gallery_locked']) 162 { 163 $header_msgs[] = $lang['gallery_locked_message']; 164 165 if ( basename($_SERVER["SCRIPT_FILENAME"]) != 'identification.php' 166 and !is_admin() ) 167 { 168 //next line required if PATH_INFO (no ? in url) but won't work for scripts outside PWG 169 $page['root_path'] = cookie_path(); 170 echo $lang['gallery_locked_message'] 171 .'<a href="'.get_root_url().'identification.php">.</a>'; 172 exit(); 173 } 174 } 175 176 if ($user['is_the_guest'] and !$conf['guest_access'] 177 and !in_array( basename($_SERVER['SCRIPT_FILENAME']), 178 array('identification.php', 179 'password.php', 180 'register.php' 181 ) 182 ) 183 ) 184 { 185 //next line required if PATH_INFO (no ? in url) but won't work for scripts outside PWG 186 $page['root_path'] = cookie_path(); 187 redirect (get_root_url().'identification.php'); 188 } 189 135 190 if ($conf['check_upgrade_feed'] 136 191 and defined('PHPWG_IN_UPGRADE') … … 150 205 if (count(array_diff($existing, $applied)) > 0) 151 206 { 207 //next line required if PATH_INFO (no ? in url) but won't work for scripts outside PWG 208 $page['root_path'] = cookie_path(); 152 209 $header_msgs[] = 'Some database upgrades are missing, ' 153 .'<a href="'.PHPWG_ROOT_PATH.'upgrade_feed.php">upgrade now</a>'; 154 } 155 } 156 157 // 158 // Setup gallery wide options, if this fails then we output a CRITICAL_ERROR 159 // since basic gallery information is not available 160 // 161 load_conf_from_db(); 162 163 include(PHPWG_ROOT_PATH.'include/user.inc.php'); 164 165 // language files 166 include_once(get_language_filepath('common.lang.php')); 167 168 if (defined('IN_ADMIN') and IN_ADMIN) 169 { 170 include_once(get_language_filepath('admin.lang.php')); 171 } 172 173 if ($conf['gallery_locked']) 174 { 175 $header_msgs[] = $lang['gallery_locked_message'] 176 . '<a href="'.PHPWG_ROOT_PATH.'identification.php">.</a>'; 177 178 if ( basename($_SERVER["PHP_SELF"]) != 'identification.php' 179 and !is_admin() ) 180 { 181 echo( $lang['gallery_locked_message'] ); 182 exit(); 183 } 184 } 185 186 // only now we can set the localized username of the guest user (and not in 187 // include/user.inc.php) 188 if ($user['is_the_guest']) 189 { 190 $user['username'] = $lang['guest']; 191 } 192 193 // include template/theme configuration 194 if (defined('IN_ADMIN') and IN_ADMIN) 195 { 196 list($user['template'], $user['theme']) = 197 explode 198 ( 199 '/', 200 isset($conf['default_admin_layout']) ? $conf['default_admin_layout'] 201 : $user['template'] 202 ); 203 // TODO : replace $conf['admin_layout'] by $user['admin_layout'] 204 } 205 else 206 { 207 list($user['template'], $user['theme']) = explode('/', $user['template']); 208 } 209 // TODO : replace initial $user['template'] by $user['layout'] 210 211 include( 212 PHPWG_ROOT_PATH 213 .'template/'.$user['template'] 214 .'/theme/'.$user['theme'] 215 .'/themeconf.inc.php' 216 ); 210 .'<a href="'.get_root_url().'upgrade_feed.php">upgrade now</a>'; 211 } 212 } 217 213 218 214 if (is_adviser()) … … 220 216 $header_msgs[] = $lang['adviser_mode_enabled']; 221 217 } 222 223 // template instance224 $template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template']);225 218 226 219 if (count($header_msgs) > 0)
Note: See TracChangeset
for help on using the changeset viewer.