379 eval($cmd); |
379 eval($cmd); |
380 } |
380 } |
381 |
381 |
382 profiler_log('Finished base_classes_initted hook'); |
382 profiler_log('Finished base_classes_initted hook'); |
383 |
383 |
384 // For special and administration pages, sometimes there is a "preloader" function that must be run |
|
385 // before the session manager and/or path manager get the init signal. Call it here. |
|
386 $p = RenderMan::strToPageId($paths->get_pageid_from_url()); |
|
387 if( ( $p[1] == 'Admin' || $p[1] == 'Special' ) && function_exists('page_'.$p[1].'_'.$p[0].'_preloader')) |
|
388 { |
|
389 call_user_func('page_'.$p[1].'_'.$p[0].'_preloader'); |
|
390 } |
|
391 |
|
392 profiler_log('Checked for preloader'); |
|
393 |
|
394 // One quick security check... |
384 // One quick security check... |
395 if ( !is_valid_ip($_SERVER['REMOTE_ADDR']) ) |
385 if ( !is_valid_ip($_SERVER['REMOTE_ADDR']) ) |
396 { |
386 { |
397 die('SECURITY: spoofed IP address: ' . htmlspecialchars($_SERVER['REMOTE_ADDR'])); |
387 die('SECURITY: spoofed IP address: ' . htmlspecialchars($_SERVER['REMOTE_ADDR'])); |
398 } |
388 } |
399 |
389 |
|
390 // For special and administration pages, sometimes there is a "preloader" function that must be run |
|
391 // before the session manager and/or path manager get the init signal. Call it here. |
|
392 $title = get_title(true); |
|
393 list($page_id, $namespace) = RenderMan::strToPageID($title); |
|
394 list($page_id_top) = explode('/', $page_id); |
|
395 $fname = "page_{$namespace}_{$page_id_top}_preloader"; |
|
396 if( ( $namespace == 'Admin' || $namespace == 'Special' ) && function_exists($fname)) |
|
397 { |
|
398 call_user_func($fname); |
|
399 } |
|
400 |
|
401 profiler_log('Checked for (and ran, if applicable) preloader'); |
|
402 |
400 // All checks passed! Start the main components up. |
403 // All checks passed! Start the main components up. |
401 $session->start(); |
404 $session->start(); |
402 |
405 |
403 // Add all of our built in special pages |
406 // Add all of our built in special pages |
404 foreach ( array('SpecialUserFuncs', 'SpecialPageFuncs', 'SpecialAdmin', 'SpecialCSS', 'SpecialUpDownload', 'SpecialSearch', 'PrivateMessages', 'SpecialGroups', 'SpecialLog') as $plugin ) |
407 foreach ( array('SpecialUserFuncs', 'SpecialPageFuncs', 'SpecialAdmin', 'SpecialCSS', 'SpecialUpDownload', 'SpecialSearch', 'PrivateMessages', 'SpecialGroups', 'SpecialLog') as $plugin ) |