1 |
<?php |
<?php $ID = substr( |
2 |
/*------------------------------------------------------------------------------ |
/*------------------------------------------------------------------------------ |
3 |
--- www.netfrag.org |
--- www.netfrag.org |
4 |
--- Main index and content access page. |
--- Main index and content access page. |
5 |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
6 |
--- rabit, 01:28 24.08.2004 |
--- rabit, 01:28 24.08.2004 |
|
--- $Id$ |
|
7 |
------------------------------------------------------------------------------*/ |
------------------------------------------------------------------------------*/ |
8 |
|
'$Id$' |
9 |
|
//------------------------------------------------------------------------------ |
10 |
|
, 5, -2); |
11 |
|
//------------------------------------------------------------------------------ |
12 |
|
|
13 |
include('inc/common/common.php.inc'); |
include('inc/common/common.php.inc'); |
14 |
|
|
15 |
common_benchmark_addstep('start'); |
common_benchmark_addstep('start'); |
16 |
|
|
17 |
//------------------------------------------------------------------------------ |
//------------------------------------------------------------------------------ |
18 |
//- Web authorisation: |
//- User Agent <-> Output Type: |
19 |
|
|
20 |
if(isset($_POST['un'])) { |
$common['client']['session_enabled'] = 1; |
21 |
|
|
22 |
$common_sessiondata['userdata']['name'] = $_POST['un']; |
if($_SERVER['HTTP_USER_AGENT'] == 'M3Gate/1.2') { |
23 |
|
|
24 |
|
$common['client']['session_enabled'] = 0; |
25 |
|
$common_sessiondata['user_prefs']['outputtype'] = 'wml'; |
26 |
|
|
27 |
|
} |
28 |
|
|
29 |
if(isset($_POST['pw'])) { |
//------------------------------------------------------------------------------ |
30 |
|
//- Web authorisation: |
31 |
|
|
32 |
$common_sessiondata['userdata']['password'] = $_POST['pw']; |
if(isset($_POST['un']) && isset($_POST['pw'])) { |
33 |
|
|
34 |
common_checkauthorisation(); |
common_authorise($_POST['un'], $_POST['pw']); |
35 |
|
|
36 |
} |
common_benchmark_addstep('authorisation test'); |
37 |
|
|
38 |
} |
} |
39 |
|
|
|
common_benchmark_addstep('authorisation test'); |
|
|
|
|
40 |
//------------------------------------------------------------------------------ |
//------------------------------------------------------------------------------ |
41 |
//- GET/POST variable encapsulation: |
//- GET/POST variable encapsulation: |
42 |
|
|
43 |
$request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); |
$request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : ''); |
|
$request_outputtype = (isset($_GET['ot']) ? $_GET['ot'] : ''); |
|
44 |
|
|
45 |
if(isset($_GET['li'])) |
if(isset($_GET['li'])) |
46 |
$common_sessiondata['userdata']['language_id'] = intval($_GET['li']); |
$common_sessiondata['user_prefs']['language_id'] = $_GET['li']; |
47 |
|
|
48 |
//------------------------------------------------------------------------------ |
if(isset($_GET['ot'])) |
49 |
|
$common_sessiondata['user_prefs']['outputtype'] = $_GET['ot']; |
50 |
|
|
51 |
|
//---------------------------------------------------------- |
52 |
//- Variable defaults: |
//- Variable defaults: |
53 |
|
|
54 |
if(!$request_contentkey) $request_contentkey = 'Home'; |
if(!$request_contentkey) $request_contentkey = 'Home'; |
55 |
|
|
|
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. |
|
|
|
|
|
} |
|
|
|
|
56 |
common_benchmark_addstep('GET/POST variable processing'); |
common_benchmark_addstep('GET/POST variable processing'); |
57 |
|
|
58 |
//------------------------------------------------------------------------------ |
//------------------------------------------------------------------------------ |
|
|
|
59 |
// Dispatching the output content type: |
// Dispatching the output content type: |
60 |
|
|
61 |
switch($request_outputtype) { |
switch($common_sessiondata['user_prefs']['outputtype']) { |
62 |
|
|
63 |
case 'wml': // WML output |
case 'wml': // WML output |
64 |
|
|
65 |
/* --- Example: --- |
include($common['site']['incroot'] . 'otdef/otd_wml1/otd_wml1.php.inc'); |
66 |
|
common_benchmark_addstep('OTD_WML1 included'); |
|
include($common['site']['incroot'] . 'otdef/ot_wml1.php.inc'); |
|
|
common_benchmark_addstep('OT_WML1 included'); |
|
|
*/ |
|
67 |
|
|
68 |
break; |
break; |
69 |
|
|
73 |
|
|
74 |
default: |
default: |
75 |
|
|
76 |
include($common['site']['incroot'] . 'otdef/ot_html1.php.inc'); |
include($common['site']['incroot'] . 'otdef/otd_html1/otd_html1.php.inc'); |
77 |
common_benchmark_addstep('OT_HTML1 included'); |
common_benchmark_addstep('OTD_HTML1 included'); |
78 |
|
|
79 |
} |
} |
80 |
|
|
81 |
//---------------------------------------------------------- |
//------------------------------------------------------------------------------ |
82 |
// Render output: |
// Render output: |
83 |
|
|
84 |
if(isset($otd_render)) $otd_render($request_contentkey, $language_id); |
if(isset($otd_render)) $otd_render( |
85 |
|
$request_contentkey, |
86 |
|
$common_sessiondata['user_prefs']['language_id'] |
87 |
|
); |
88 |
|
|
89 |
//------------------------------------------------------------------------------ |
//------------------------------------------------------------------------------ |
90 |
|
|