| 1 | <?php | 
| 2 | /*------------------------------------------------------------------------------ | 
| 3 | --- www.netfrag.org | 
| 4 | --- Main index and content access page. | 
| 5 | -------------------------------------------------------------------------------- | 
| 6 | --- rabit, 01:28 24.08.2004 | 
| 7 | --- $Id: index.php,v 1.6 2004/08/31 02:27:53 rabit Exp $ | 
| 8 | ------------------------------------------------------------------------------*/ | 
| 9 |  | 
| 10 | include('inc/common/common.php.inc'); | 
| 11 |  | 
| 12 | common_benchmark_addstep('start'); | 
| 13 |  | 
| 14 | //------------------------------------------------------------------------------ | 
| 15 | //- Web authorisation: | 
| 16 |  | 
| 17 | if(isset($_POST['un'])) { | 
| 18 |  | 
| 19 | $common_sessiondata['userdata']['name'] = $_POST['un']; | 
| 20 |  | 
| 21 | if(isset($_POST['pw'])) { | 
| 22 |  | 
| 23 | $common_sessiondata['userdata']['password'] = $_POST['pw']; | 
| 24 |  | 
| 25 | common_checkauthorisation(); | 
| 26 |  | 
| 27 | } | 
| 28 |  | 
| 29 | } | 
| 30 |  | 
| 31 | common_benchmark_addstep('authorisation test'); | 
| 32 |  | 
| 33 | //------------------------------------------------------------------------------ | 
| 34 | //- GET/POST variable encapsulation: | 
| 35 |  | 
| 36 | $request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); | 
| 37 | $request_outputtype = (isset($_GET['ot']) ? $_GET['ot'] : ''); | 
| 38 |  | 
| 39 | if(isset($_GET['li'])) | 
| 40 | $common_sessiondata['userdata']['language_id'] = intval($_GET['li']); | 
| 41 |  | 
| 42 | //------------------------------------------------------------------------------ | 
| 43 | //- Variable defaults: | 
| 44 |  | 
| 45 | if(!$request_contentkey) $request_contentkey = 'Home'; | 
| 46 |  | 
| 47 | if(!$request_outputtype) $request_outputtype = 'html'; | 
| 48 |  | 
| 49 | if(isset($common_sessiondata['userdata']['language_id'])) { | 
| 50 |  | 
| 51 | // Set language ID from the users session data. | 
| 52 | $language_id = $common_sessiondata['userdata']['language_id']; | 
| 53 |  | 
| 54 | } else { | 
| 55 |  | 
| 56 | $language_id = 1; // Default language ID. | 
| 57 |  | 
| 58 | } | 
| 59 |  | 
| 60 | common_benchmark_addstep('GET/POST variable processing'); | 
| 61 |  | 
| 62 | //------------------------------------------------------------------------------ | 
| 63 |  | 
| 64 | // Dispatching the output content type: | 
| 65 |  | 
| 66 | switch($request_outputtype) { | 
| 67 |  | 
| 68 | case 'wml': // WML output | 
| 69 |  | 
| 70 | /* --- Example: --- | 
| 71 |  | 
| 72 | include($common['site']['incroot'] . 'otdef/ot_wml1.php.inc'); | 
| 73 | common_benchmark_addstep('OT_WML1 included'); | 
| 74 | */ | 
| 75 |  | 
| 76 | break; | 
| 77 |  | 
| 78 | // HTML output: | 
| 79 |  | 
| 80 | case 'html': | 
| 81 |  | 
| 82 | default: | 
| 83 |  | 
| 84 | include($common['site']['incroot'] . 'otdef/ot_html1.php.inc'); | 
| 85 | common_benchmark_addstep('OT_HTML1 included'); | 
| 86 |  | 
| 87 | } | 
| 88 |  | 
| 89 | //---------------------------------------------------------- | 
| 90 | // Render output: | 
| 91 |  | 
| 92 | if(isset($otd_render)) $otd_render($request_contentkey, $language_id); | 
| 93 |  | 
| 94 | //------------------------------------------------------------------------------ | 
| 95 |  | 
| 96 | ?> |