--- nfo/site/htdocs/index.php 2004/08/30 04:21:55 1.4 +++ nfo/site/htdocs/index.php 2004/08/31 02:27:53 1.6 @@ -4,33 +4,60 @@ --- Main index and content access page. -------------------------------------------------------------------------------- --- rabit, 01:28 24.08.2004 ---- $Id: index.php,v 1.4 2004/08/30 04:21:55 rabit Exp $ +--- $Id: index.php,v 1.6 2004/08/31 02:27:53 rabit Exp $ ------------------------------------------------------------------------------*/ include('inc/common/common.php.inc'); //------------------------------------------------------------------------------ -//- GET/POST variable encapsulation: +//- Web authorisation: + +if(isset($_POST['un'])) { + + $common_sessiondata['userdata']['name'] = $_POST['un']; + + if(isset($_POST['pw'])) { + + $common_sessiondata['userdata']['password'] = $_POST['pw']; + + common_checkauthorisation(); + + } + +} -$contentkeyname = (isset($_GET['ck']) ? $_GET['ck'] : ''); +//------------------------------------------------------------------------------ +//- GET/POST variable encapsulation: -$language_id = (isset($_GET['li']) ? $_GET['li'] : ''); +$request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); +$request_outputtype = (isset($_GET['ot']) ? $_GET['ot'] : ''); -$outputtype = (isset($_GET['ot']) ? $_GET['ot'] : ''); +if(isset($_GET['li'])) + $common_sessiondata['userdata']['language_id'] = intval($_GET['li']); //------------------------------------------------------------------------------ +//- Variable defaults: + +if(!$request_contentkey) $request_contentkey = 'Home'; -if(!$contentkeyname) $contentkeyname = 'Home'; +if(!$request_outputtype) $request_outputtype = 'html'; -if(!$language_id) $language_id = 1; +if(isset($common_sessiondata['userdata']['language_id'])) { -if(!$outputtype) $outputtype = 'html'; + // Set language ID from the users session data. + $language_id = $common_sessiondata['userdata']['language_id']; + +} else { + + $language_id = 1; // Default language ID. + +} //------------------------------------------------------------------------------ // Dispatching the output content type: -switch($outputtype) { +switch($request_outputtype) { case 'xml': // XML output @@ -43,7 +70,7 @@ default: // Generate a HTML page: - common_page($contentkeyname, $language_id); + common_page($request_contentkey, $language_id); }