--- nfo/site/htdocs/index.php 2004/09/03 22:43:17 1.10 +++ nfo/site/htdocs/index.php 2004/09/04 03:21:55 1.11 @@ -4,7 +4,7 @@ --- Main index and content access page. -------------------------------------------------------------------------------- --- rabit, 01:28 24.08.2004 ---- $Id: index.php,v 1.10 2004/09/03 22:43:17 joko Exp $ +--- $Id: index.php,v 1.11 2004/09/04 03:21:55 rabit Exp $ ------------------------------------------------------------------------------*/ include('inc/common/common.php.inc'); @@ -12,66 +12,56 @@ common_benchmark_addstep('start'); //------------------------------------------------------------------------------ -//- Web authorisation: - -if(isset($_POST['un'])) { - - $common_sessiondata['userdata']['name'] = $_POST['un']; - - if(isset($_POST['pw'])) { +//- User Agent <-> 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: +//- Web authorisation: -$request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); -$request_outputtype = (isset($_GET['ot']) ? $_GET['ot'] : ''); +if(isset($_POST['un']) && isset($_POST['pw'])) { -if(isset($_GET['li'])) - $common_sessiondata['userdata']['language_id'] = intval($_GET['li']); + common_authorise($_POST['un'], $_POST['pw']); + common_benchmark_addstep('authorisation test'); -//------------------------------------------------------------------------------ -//- User Agent <-> Output Type: -$common['client']['session_enabled'] = 1; -if ($_SERVER['HTTP_USER_AGENT'] == 'M3Gate/1.2') { - $common['client']['session_enabled'] = 0; - $request_outputtype = 'wml'; } //------------------------------------------------------------------------------ -//- Variable defaults: +//- GET/POST variable encapsulation: -if(!$request_contentkey) $request_contentkey = 'Home'; +$request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); -if(!$request_outputtype) $request_outputtype = 'html'; +if(isset($_GET['li'])) + $common_sessiondata['user_prefs']['language_id'] = $_GET['li']; -if(isset($common_sessiondata['userdata']['language_id'])) { +if(isset($_GET['ot'])) + $common_sessiondata['user_prefs']['outputtype'] = $_GET['ot']; - // Set language ID from the users session data. - $language_id = $common_sessiondata['userdata']['language_id']; +if(isset($_GET['debug'])) + $common_sessiondata['user_prefs']['debug'] = $_GET['debug']; -} else { +if(isset($_GET['benchlist'])) + $common_sessiondata['user_prefs']['benchlist'] = $_GET['benchlist']; - $language_id = 1; // Default language ID. +//---------------------------------------------------------- +//- Variable defaults: -} +if(!$request_contentkey) $request_contentkey = 'Home'; 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 @@ -94,7 +84,10 @@ //------------------------------------------------------------------------------ // 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'] +); //------------------------------------------------------------------------------