--- nfo/site/htdocs/index.php 2004/08/30 01:48:30 1.3 +++ nfo/site/htdocs/index.php 2004/09/04 14:06:52 1.12 @@ -4,31 +4,69 @@ --- Main index and content access page. -------------------------------------------------------------------------------- --- rabit, 01:28 24.08.2004 ---- $Id: index.php,v 1.3 2004/08/30 01:48:30 rabit Exp $ +--- $Id: index.php,v 1.12 2004/09/04 14:06:52 rabit Exp $ ------------------------------------------------------------------------------*/ include('inc/common/common.php.inc'); +common_benchmark_addstep('start'); + //------------------------------------------------------------------------------ -//- GET/POST variable encapsulation: +//- User Agent <-> Output Type: + +$common['client']['session_enabled'] = 1; -$contentkeyname = (isset($_GET['ck']) ? $_GET['ck'] : ''); +if($_SERVER['HTTP_USER_AGENT'] == 'M3Gate/1.2') { -$outputtype = (isset($_GET['ot']) ? $_GET['ot'] : ''); + $common['client']['session_enabled'] = 0; + $common_sessiondata['user_prefs']['outputtype'] = 'wml'; + +} //------------------------------------------------------------------------------ +//- Web authorisation: + +if(isset($_POST['un']) && isset($_POST['pw'])) { -if(!$contentkeyname) $contentkeyname = 'Home'; + common_authorise($_POST['un'], $_POST['pw']); -if(!$outputtype) $outputtype = 'html'; + common_benchmark_addstep('authorisation test'); + +} //------------------------------------------------------------------------------ +//- GET/POST variable encapsulation: + +$request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); + +if(isset($_GET['li'])) + $common_sessiondata['user_prefs']['language_id'] = $_GET['li']; +if(isset($_GET['ot'])) + $common_sessiondata['user_prefs']['outputtype'] = $_GET['ot']; + +if(isset($_GET['debug'])) + $common_sessiondata['user_prefs']['debug'] = $_GET['debug']; + +if(isset($_GET['benchlist'])) + $common_sessiondata['user_prefs']['benchlist'] = $_GET['benchlist']; + +//---------------------------------------------------------- +//- Variable defaults: + +if(!$request_contentkey) $request_contentkey = 'Home'; + +common_benchmark_addstep('GET/POST variable processing'); + +//------------------------------------------------------------------------------ // Dispatching the output content type: -switch($outputtype) { +switch($common_sessiondata['user_prefs']['outputtype']) { + + case 'wml': // WML output - case 'xml': // XML output + include($common['site']['incroot'] . 'otdef/otd_wml1/otd_wml1.php.inc'); + common_benchmark_addstep('OTD_WML1 included'); break; @@ -38,11 +76,19 @@ default: - // Generate a HTML page: - common_page($contentkeyname); + 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, + $common_sessiondata['user_prefs']['language_id'] +); + +//------------------------------------------------------------------------------ ?>