/[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.11 - (hide annotations)
Sat Sep 4 03:21:55 2004 UTC (19 years, 10 months ago) by rabit
Branch: MAIN
Changes since 1.10: +28 -35 lines
U URL variable processing (now mostly stored in user preferences); U "outputtype" assignment by user agent modified; U Authorise function call.

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 rabit 1.11 --- $Id: index.php,v 1.10 2004/09/03 22:43:17 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 rabit 1.11 //- User Agent <-> Output Type:
16    
17     $common['client']['session_enabled'] = 1;
18    
19     if($_SERVER['HTTP_USER_AGENT'] == 'M3Gate/1.2') {
20 rabit 1.6
21 rabit 1.11 $common['client']['session_enabled'] = 0;
22     $common_sessiondata['user_prefs']['outputtype'] = 'wml';
23 rabit 1.6
24 rabit 1.11 }
25 rabit 1.6
26 rabit 1.11 //------------------------------------------------------------------------------
27     //- Web authorisation:
28 rabit 1.6
29 rabit 1.11 if(isset($_POST['un']) && isset($_POST['pw'])) {
30 rabit 1.6
31 rabit 1.11 common_authorise($_POST['un'], $_POST['pw']);
32 rabit 1.6
33 rabit 1.11 common_benchmark_addstep('authorisation test');
34 rabit 1.6
35     }
36 rabit 1.2
37     //------------------------------------------------------------------------------
38 rabit 1.3 //- GET/POST variable encapsulation:
39 rabit 1.2
40 rabit 1.5 $request_contentkey = (isset($_GET['ck']) ? $_GET['ck'] : '');
41 rabit 1.2
42 rabit 1.5 if(isset($_GET['li']))
43 rabit 1.11 $common_sessiondata['user_prefs']['language_id'] = $_GET['li'];
44    
45     if(isset($_GET['ot']))
46     $common_sessiondata['user_prefs']['outputtype'] = $_GET['ot'];
47 rabit 1.4
48 rabit 1.11 if(isset($_GET['debug']))
49     $common_sessiondata['user_prefs']['debug'] = $_GET['debug'];
50 joko 1.10
51 rabit 1.11 if(isset($_GET['benchlist']))
52     $common_sessiondata['user_prefs']['benchlist'] = $_GET['benchlist'];
53 joko 1.10
54 rabit 1.11 //----------------------------------------------------------
55 rabit 1.5 //- Variable defaults:
56    
57     if(!$request_contentkey) $request_contentkey = 'Home';
58    
59 rabit 1.7 common_benchmark_addstep('GET/POST variable processing');
60    
61 rabit 1.3 //------------------------------------------------------------------------------
62     // Dispatching the output content type:
63    
64 rabit 1.11 switch($common_sessiondata['user_prefs']['outputtype']) {
65 rabit 1.3
66 rabit 1.7 case 'wml': // WML output
67    
68 rabit 1.8 include($common['site']['incroot'] . 'otdef/otd_wml1.php.inc');
69     common_benchmark_addstep('OTD_WML1 included');
70 rabit 1.3
71     break;
72    
73     // HTML output:
74    
75     case 'html':
76 rabit 1.2
77 rabit 1.3 default:
78 rabit 1.2
79 rabit 1.8 include($common['site']['incroot'] . 'otdef/otd_html1.php.inc');
80     common_benchmark_addstep('OTD_HTML1 included');
81 rabit 1.2
82 rabit 1.3 }
83 rabit 1.7
84 rabit 1.8 //------------------------------------------------------------------------------
85 rabit 1.7 // Render output:
86    
87 rabit 1.11 if(isset($otd_render)) $otd_render(
88     $request_contentkey,
89     $common_sessiondata['user_prefs']['language_id']
90     );
91 rabit 1.2
92     //------------------------------------------------------------------------------
93    
94     ?>

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