--- nfo/site/htdocs/index.php 2004/08/24 03:29:30 1.2 +++ nfo/site/htdocs/index.php 2004/09/05 03:09:47 1.13 @@ -1,27 +1,90 @@ - Output Type: + +$common['client']['session_enabled'] = 1; + +if($_SERVER['HTTP_USER_AGENT'] == 'M3Gate/1.2') { + + $common['client']['session_enabled'] = 0; + $common_sessiondata['user_prefs']['outputtype'] = 'wml'; + +} + +//------------------------------------------------------------------------------ +//- Web authorisation: + +if(isset($_POST['un']) && isset($_POST['pw'])) { + + common_authorise($_POST['un'], $_POST['pw']); + + common_benchmark_addstep('authorisation test'); + +} + //------------------------------------------------------------------------------ +//- GET/POST variable encapsulation: -common_pageheader(); +$request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); -common_headline('CFG Variables:'); +if(isset($_GET['li'])) + $common_sessiondata['user_prefs']['language_id'] = $_GET['li']; -common_paragraph('$documentroot = "' . $documentroot . '"'); +if(isset($_GET['ot'])) + $common_sessiondata['user_prefs']['outputtype'] = $_GET['ot']; -common_headline('$_SERVER array, readable:'); +//---------------------------------------------------------- +//- Variable defaults: -common_paragraph(nl2br(htmlentities(print_r($_SERVER, true))), 'hl'); +if(!$request_contentkey) $request_contentkey = 'Home'; + +common_benchmark_addstep('GET/POST variable processing'); + +//------------------------------------------------------------------------------ +// Dispatching the output content type: + +switch($common_sessiondata['user_prefs']['outputtype']) { + + case 'wml': // WML output + + include($common['site']['incroot'] . 'otdef/otd_wml1/otd_wml1.php.inc'); + common_benchmark_addstep('OTD_WML1 included'); + + break; + + // HTML output: + + case 'html': + + default: + + include($common['site']['incroot'] . 'otdef/otd_html1/otd_html1.php.inc'); + common_benchmark_addstep('OTD_HTML1 included'); + +} + +//------------------------------------------------------------------------------ +// Render output: -common_pagefooter(); +if(isset($otd_render)) $otd_render( + $request_contentkey, + $common_sessiondata['user_prefs']['language_id'] +); //------------------------------------------------------------------------------