forked from open-austin/council-connect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·123 lines (85 loc) · 2.84 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!-- index.php -->
<?php
session_start ();
if (! array_key_exists ('err', $_SESSION)) {
$_SESSION ['err'] = '';
} // end if (! array_key_exists ('err', $_SESSION))
get_header();
require_once 'Topics.php';
require_once 'User.php';
require_once 'Util.php';
require_once 'Tags.php';
require_once 'AgendaCtrl.php';
$atxcc_tp = new Topics ();
$atxcc_us = new User ();
$atxcc_tg = new Tags ();
$requestUrl = $_SERVER ['REQUEST_URI'];
// pick off trailing ?0, if present
if (preg_match ('/([^?]+)\?(.*)$/', $requestUrl, $matches)) {
$requestUrl = $matches [1];
$optionSuffix = $matches [2];
if ($optionSuffix == '0') {
$_SESSION ['err'] = '';
} // end if ($suffix == '0')
} // end if (preg_match ('/([^?]+)\?(.*)$/', $requestUrl, $matches))
$request = preg_replace ('/.*\//', "", $requestUrl);
switch ($request) {
//case '':
//$_SESSION ['err'] = '';
//$atxcc_tp -> homeInit ();
//break;
case 'home':
$_SESSION ['err'] = '';
$atxcc_tp -> homeInit ();
break;
case 'agendapage':
$_SESSION ['err'] = '';
$atxcc_tp -> topicsInit ();
break;
case 'findyourcouncildistrict':
$_SESSION ['err'] = '';
$atxcc_tp -> councilInit ();
break;
case 'councilprocess':
$_SESSION ['err'] = '';
$atxcc_tp -> councilprocessInit ();
break;
case 'about':
$atxcc_tp -> aboutInit ($_SESSION ['err']);
break;
case 'signup':
$atxcc_us->signupForm ($_SESSION ['err']);
break;
case 'alogin':
$atxcc_us->loginForm ($_SESSION ['err']);
break;
case 'alogout':
$atxcc_us->logout ();
$server = $_SERVER ['SERVER_NAME'];
$urlRedirect = 'http://' . $server . '/atxcc';
Util::redirect ($urlRedirect);
break;
case 'apassword':
$atxcc_us->changePasswordForm ($_SESSION ['err']);
break;
case 'tags':
$atxcc_tg->tagsInit ();
break;
case 'agendactrl':
if ($_SESSION ['user'] == 'atxcchot') {
$atxcc_ac = new AgendaCtrl ();
$atxcc_ac -> agendaInit ();
} else {
$atxcc_tp -> topicsInit ();
} // end if ($_SESSION ['user'] == 'atxcchot')
break;
default:
$_SESSION ['err'] = '';
$atxcc_tp -> homeInit ();
break;
#echo "'$request' not found";
#break;
} // end switch ($_SERVER ['REQUEST_URI'])
get_footer();
?>
<!-- END index.php -->