/[cvs]/nfo/site/htdocs/index.php
ViewVC logotype

Annotation of /nfo/site/htdocs/index.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations)
Fri Sep 3 22:43:17 2004 UTC (20 years, 2 months ago) by joko
Branch: MAIN
Changes since 1.9: +11 -1 lines
+ added dispatcher: User Agent <-> Output Type

1 rabit 1.2 <?php
2     /*------------------------------------------------------------------------------
3     --- www.netfrag.org
4 rabit 1.3 --- Main index and content access page.
5 rabit 1.2 --------------------------------------------------------------------------------
6     --- rabit, 01:28 24.08.2004
7 joko 1.10 --- $Id: index.php,v 1.9 2004/09/03 11:12:05 joko Exp $
8 rabit 1.2 ------------------------------------------------------------------------------*/
9    
10     include('inc/common/common.php.inc');
11 rabit 1.6
12 rabit 1.7 common_benchmark_addstep('start');
13    
14 rabit 1.6 //------------------------------------------------------------------------------
15     //- Web authorisation:
16    
17     if(isset($_POST['un'])) {
18    
19     $common_sessiondata['userdata']['name'] = $_POST['un'];
20    
21     if(isset($_POST['pw'])) {
22    
23     $common_sessiondata['userdata']['password'] = $_POST['pw'];
24    
25     common_checkauthorisation();
26    
27     }
28    
29     }
30 rabit 1.2
31 rabit 1.7 common_benchmark_addstep('authorisation test');
32    
33 rabit 1.2 //------------------------------------------------------------------------------
34 rabit 1.3 //- GET/POST variable encapsulation:
35 rabit 1.2
36 rabit 1.5 $request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : '');
37     $request_outputtype = (isset($_GET['ot']) ? $_GET['ot'] : '');
38 rabit 1.2
39 rabit 1.5 if(isset($_GET['li']))
40     $common_sessiondata['userdata']['language_id'] = intval($_GET['li']);
41 rabit 1.4
42 joko 1.10
43     //------------------------------------------------------------------------------
44     //- User Agent <-> Output Type:
45     $common['client']['session_enabled'] = 1;
46     if ($_SERVER['HTTP_USER_AGENT'] == 'M3Gate/1.2') {
47     $common['client']['session_enabled'] = 0;
48     $request_outputtype = 'wml';
49     }
50    
51     //------------------------------------------------------------------------------
52 rabit 1.5 //- Variable defaults:
53    
54     if(!$request_contentkey) $request_contentkey = 'Home';
55    
56     if(!$request_outputtype) $request_outputtype = 'html';
57 rabit 1.2
58 rabit 1.5 if(isset($common_sessiondata['userdata']['language_id'])) {
59    
60     // Set language ID from the users session data.
61     $language_id = $common_sessiondata['userdata']['language_id'];
62 rabit 1.3
63 rabit 1.5 } else {
64 rabit 1.3
65 rabit 1.5 $language_id = 1; // Default language ID.
66 rabit 1.4
67 rabit 1.5 }
68 rabit 1.3
69 rabit 1.7 common_benchmark_addstep('GET/POST variable processing');
70    
71 rabit 1.3 //------------------------------------------------------------------------------
72     // Dispatching the output content type:
73    
74 rabit 1.5 switch($request_outputtype) {
75 rabit 1.3
76 rabit 1.7 case 'wml': // WML output
77    
78 rabit 1.8 include($common['site']['incroot'] . 'otdef/otd_wml1.php.inc');
79     common_benchmark_addstep('OTD_WML1 included');
80 rabit 1.3
81     break;
82    
83     // HTML output:
84    
85     case 'html':
86 rabit 1.2
87 rabit 1.3 default:
88 rabit 1.2
89 rabit 1.8 include($common['site']['incroot'] . 'otdef/otd_html1.php.inc');
90     common_benchmark_addstep('OTD_HTML1 included');
91 rabit 1.2
92 rabit 1.3 }
93 rabit 1.7
94 rabit 1.8 //------------------------------------------------------------------------------
95 rabit 1.7 // Render output:
96    
97     if(isset($otd_render)) $otd_render($request_contentkey, $language_id);
98 rabit 1.2
99     //------------------------------------------------------------------------------
100    
101     ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed