| 9 | 
  | 
  | 
| 10 | 
 include('inc/common/common.php.inc'); | 
 include('inc/common/common.php.inc'); | 
| 11 | 
  | 
  | 
| 12 | 
  | 
 common_benchmark_addstep('start'); | 
| 13 | 
  | 
  | 
| 14 | 
 //------------------------------------------------------------------------------ | 
 //------------------------------------------------------------------------------ | 
| 15 | 
 //- GET/POST variable encapsulation: | 
 //- User Agent <-> Output Type: | 
| 16 | 
  | 
  | 
| 17 | 
 $request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); | 
 $common['client']['session_enabled'] = 1; | 
 | 
 $request_outputtype = (isset($_GET['ot']) ? $_GET['ot'] : ''); | 
  | 
| 18 | 
  | 
  | 
| 19 | 
 if(isset($_GET['li'])) | 
 if($_SERVER['HTTP_USER_AGENT'] == 'M3Gate/1.2') { | 
 | 
  $common_sessiondata['userdata']['language_id'] = intval($_GET['li']); | 
  | 
 | 
  | 
  | 
 | 
 //------------------------------------------------------------------------------ | 
  | 
 | 
 //- Variable defaults: | 
  | 
| 20 | 
  | 
  | 
| 21 | 
 if(!$request_contentkey) $request_contentkey = 'Home'; | 
   $common['client']['session_enabled'] = 0; | 
| 22 | 
  | 
   $common_sessiondata['user_prefs']['outputtype'] = 'wml'; | 
| 23 | 
  | 
  | 
| 24 | 
 if(!$request_outputtype) $request_outputtype = 'html'; | 
 } | 
| 25 | 
  | 
  | 
| 26 | 
 if(isset($common_sessiondata['userdata']['language_id'])) { | 
 //------------------------------------------------------------------------------ | 
| 27 | 
  | 
 //- Web authorisation: | 
| 28 | 
  | 
  | 
| 29 | 
   // Set language ID from the users session data. | 
 if(isset($_POST['un']) && isset($_POST['pw'])) { | 
 | 
   $language_id = $common_sessiondata['userdata']['language_id']; | 
  | 
| 30 | 
  | 
  | 
| 31 | 
 } else { | 
   common_authorise($_POST['un'], $_POST['pw']); | 
| 32 | 
  | 
  | 
| 33 | 
   $language_id = 1; // Default language ID. | 
   common_benchmark_addstep('authorisation test'); | 
| 34 | 
  | 
  | 
| 35 | 
 } | 
 } | 
| 36 | 
  | 
  | 
| 37 | 
 //------------------------------------------------------------------------------ | 
 //------------------------------------------------------------------------------ | 
| 38 | 
  | 
 //- GET/POST variable encapsulation: | 
| 39 | 
  | 
  | 
| 40 | 
  | 
 $request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); | 
| 41 | 
  | 
  | 
| 42 | 
  | 
 if(isset($_GET['li'])) | 
| 43 | 
  | 
  $common_sessiondata['user_prefs']['language_id'] = $_GET['li']; | 
| 44 | 
  | 
  | 
| 45 | 
  | 
 if(isset($_GET['ot'])) | 
| 46 | 
  | 
  $common_sessiondata['user_prefs']['outputtype'] = $_GET['ot']; | 
| 47 | 
  | 
  | 
| 48 | 
  | 
 if(isset($_GET['debug'])) | 
| 49 | 
  | 
  $common_sessiondata['user_prefs']['debug'] = $_GET['debug']; | 
| 50 | 
  | 
  | 
| 51 | 
  | 
 if(isset($_GET['benchlist'])) | 
| 52 | 
  | 
  $common_sessiondata['user_prefs']['benchlist'] = $_GET['benchlist']; | 
| 53 | 
  | 
  | 
| 54 | 
  | 
 //---------------------------------------------------------- | 
| 55 | 
  | 
 //- Variable defaults: | 
| 56 | 
  | 
  | 
| 57 | 
  | 
 if(!$request_contentkey) $request_contentkey = 'Home'; | 
| 58 | 
  | 
  | 
| 59 | 
  | 
 common_benchmark_addstep('GET/POST variable processing'); | 
| 60 | 
  | 
  | 
| 61 | 
  | 
 //------------------------------------------------------------------------------ | 
| 62 | 
 // Dispatching the output content type: | 
 // Dispatching the output content type: | 
| 63 | 
  | 
  | 
| 64 | 
 switch($request_outputtype) { | 
 switch($common_sessiondata['user_prefs']['outputtype']) { | 
| 65 | 
  | 
  | 
| 66 | 
  | 
   case 'wml': // WML output | 
| 67 | 
  | 
  | 
| 68 | 
   case 'xml': // XML output | 
     include($common['site']['incroot'] . 'otdef/otd_wml1.php.inc'); | 
| 69 | 
  | 
     common_benchmark_addstep('OTD_WML1 included'); | 
| 70 | 
  | 
  | 
| 71 | 
     break; | 
     break; | 
| 72 | 
  | 
  | 
| 76 | 
  | 
  | 
| 77 | 
   default: | 
   default: | 
| 78 | 
  | 
  | 
| 79 | 
     // Generate a HTML page: | 
     include($common['site']['incroot'] . 'otdef/otd_html1.php.inc'); | 
| 80 | 
     common_page($request_contentkey, $language_id); | 
     common_benchmark_addstep('OTD_HTML1 included'); | 
| 81 | 
  | 
  | 
| 82 | 
 } | 
 } | 
| 83 | 
  | 
  | 
| 84 | 
 //------------------------------------------------------------------------------ | 
 //------------------------------------------------------------------------------ | 
| 85 | 
  | 
 // Render output: | 
| 86 | 
  | 
  | 
| 87 | 
  | 
 if(isset($otd_render)) $otd_render( | 
| 88 | 
  | 
  $request_contentkey, | 
| 89 | 
  | 
  $common_sessiondata['user_prefs']['language_id'] | 
| 90 | 
  | 
 ); | 
| 91 | 
  | 
  | 
| 92 | 
  | 
 //------------------------------------------------------------------------------ | 
| 93 | 
  | 
  | 
| 94 | 
 ?> | 
 ?> |