--- nfo/site/htdocs/index.php 2004/09/01 09:01:44 1.7 +++ nfo/site/htdocs/index.php 2004/09/05 05:52:55 1.14 @@ -1,77 +1,58 @@ - Output Type: - $common_sessiondata['userdata']['password'] = $_POST['pw']; +$common['client']['session_enabled'] = 1; - common_checkauthorisation(); +if($_SERVER['HTTP_USER_AGENT'] == 'M3Gate/1.2') { - } + $common['client']['session_enabled'] = 0; + $common_sessiondata['user_prefs']['outputtype'] = 'wml'; } -common_benchmark_addstep('authorisation test'); - //------------------------------------------------------------------------------ //- GET/POST variable encapsulation: $request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); -$request_outputtype = (isset($_GET['ot']) ? $_GET['ot'] : ''); if(isset($_GET['li'])) - $common_sessiondata['userdata']['language_id'] = intval($_GET['li']); + $common_sessiondata['user_prefs']['language_id'] = $_GET['li']; -//------------------------------------------------------------------------------ +if(isset($_GET['ot'])) + $common_sessiondata['user_prefs']['outputtype'] = $_GET['ot']; + +//---------------------------------------------------------- //- Variable defaults: if(!$request_contentkey) $request_contentkey = 'Home'; -if(!$request_outputtype) $request_outputtype = 'html'; - -if(isset($common_sessiondata['userdata']['language_id'])) { - - // Set language ID from the users session data. - $language_id = $common_sessiondata['userdata']['language_id']; - -} else { - - $language_id = 1; // Default language ID. - -} - common_benchmark_addstep('GET/POST variable processing'); //------------------------------------------------------------------------------ - // Dispatching the output content type: -switch($request_outputtype) { +switch($common_sessiondata['user_prefs']['outputtype']) { case 'wml': // WML output -/* --- Example: --- - - include($common['site']['incroot'] . 'otdef/ot_wml1.php.inc'); - common_benchmark_addstep('OT_WML1 included'); -*/ + include($common['site']['incroot'] . 'otdef/otd_wml1/otd_wml1.php.inc'); + common_benchmark_addstep('OTD_WML1 included'); break; @@ -81,15 +62,18 @@ default: - include($common['site']['incroot'] . 'otdef/ot_html1.php.inc'); - common_benchmark_addstep('OT_HTML1 included'); + include($common['site']['incroot'] . 'otdef/otd_html1/otd_html1.php.inc'); + common_benchmark_addstep('OTD_HTML1 included'); } -//---------------------------------------------------------- +//------------------------------------------------------------------------------ // Render output: -if(isset($otd_render)) $otd_render($request_contentkey, $language_id); +if(isset($otd_render)) $otd_render( + $request_contentkey, + $common_sessiondata['user_prefs']['language_id'] +); //------------------------------------------------------------------------------