1 | <?php
|
---|
2 |
|
---|
3 | /************************************************************************/
|
---|
4 | /* Eleonline - Raccolta e diffusione dei dati elettorali */
|
---|
5 | /* by Roberto Gigli & Luciano Apolito */
|
---|
6 | /* http://www.eleonline.it */
|
---|
7 | /* info@eleonline.it luciano@aniene.net rgigli@libero.it */
|
---|
8 | /************************************************************************/
|
---|
9 | /* Admin */
|
---|
10 | /* Amministrazione */
|
---|
11 | /************************************************************************/
|
---|
12 |
|
---|
13 | /* Descrizione file admin.php =
|
---|
14 | effettua il login o il rilancio alla gestione */
|
---|
15 |
|
---|
16 | define('ADMIN_FILE', true);
|
---|
17 | #$LIMITE=3; //fascia di separazione del maggioritario (15.000 abitanti)
|
---|
18 | # tempo di sessione: ini_set('session.gc_maxlifetime','3600');
|
---|
19 | global $multicomune;
|
---|
20 |
|
---|
21 | // Adattamento variabili superglobal
|
---|
22 | // Versione di php
|
---|
23 | $phpver = phpversion();
|
---|
24 | global $dbi;
|
---|
25 | // converte superglobal se php e' < 4.1.0
|
---|
26 |
|
---|
27 | if ($phpver < '4.1.0') {
|
---|
28 | $_GET = $HTTP_GET_VARS;
|
---|
29 | $_POST = $HTTP_POST_VARS;
|
---|
30 | $_SERVER = $HTTP_SERVER_VARS;
|
---|
31 | $_FILES = $HTTP_POST_FILES;
|
---|
32 | $_ENV = $HTTP_ENV_VARS;
|
---|
33 | if($_SERVER['REQUEST_METHOD'] == "POST") {
|
---|
34 | $_REQUEST = $_POST;
|
---|
35 | } elseif($_SERVER['REQUEST_METHOD'] == "GET") {
|
---|
36 | $_REQUEST = $_GET;
|
---|
37 | }
|
---|
38 | if(isset($HTTP_COOKIE_VARS)) {
|
---|
39 | $_COOKIE = $HTTP_COOKIE_VARS;
|
---|
40 | }
|
---|
41 | if(isset($HTTP_SESSION_VARS)) {
|
---|
42 | $_SESSION = $HTTP_SESSION_VARS;
|
---|
43 | }
|
---|
44 | }
|
---|
45 |
|
---|
46 | $param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST;
|
---|
47 | if (isset($param['aid'])) get_magic_quotes_gpc() ? $aid=$param['aid']:$aid=addslashes($param['aid']);
|
---|
48 | if (isset($param['pwd'])) get_magic_quotes_gpc() ? $pwd2=$param['pwd']:$pwd2=addslashes($param['pwd']);
|
---|
49 | // Additional security (Union, CLike, XSS)
|
---|
50 |
|
---|
51 | // We want to use the function stripos,
|
---|
52 | // but thats only available since PHP5.
|
---|
53 | // So we cloned the function...
|
---|
54 | if(!function_exists('stripos')) {
|
---|
55 | function stripos_clone($haystack, $needle, $offset=0) {
|
---|
56 | return strpos(strtoupper($haystack), strtoupper($needle), $offset);
|
---|
57 | }
|
---|
58 | } else {
|
---|
59 | // But when this is PHP5, we use the original function
|
---|
60 | function stripos_clone($haystack, $needle, $offset=0) {
|
---|
61 | return stripos($haystack, $needle, $offset=0);
|
---|
62 | }
|
---|
63 | }
|
---|
64 |
|
---|
65 | if(isset($_SERVER['QUERY_STRING']) && (!stripos_clone($_SERVER['QUERY_STRING'], "ad_click") || !stripos_clone($_SERVER['QUERY_STRING'], "url"))) {
|
---|
66 | $queryString = $_SERVER['QUERY_STRING'];
|
---|
67 | if (stripos_clone($queryString,'%20union%20') OR stripos_clone($queryString,'/*') OR stripos_clone($queryString,'*/union/*') OR stripos_clone($queryString,'c2nyaxb0') OR stripos_clone($queryString,'+union+') OR stripos_clone($queryString,'http://') OR (stripos_clone($queryString,'cmd=') AND !stripos_clone($queryString,'&cmd')) OR (stripos_clone($queryString,'exec') AND !stripos_clone($queryString,'execu')) OR stripos_clone($queryString,'concat')) {
|
---|
68 | die('Operazione non consentita');
|
---|
69 | }
|
---|
70 | }
|
---|
71 |
|
---|
72 |
|
---|
73 | foreach ($_GET as $sec_key => $secvalue) {
|
---|
74 | if ((preg_match("/<[^>]*script*\"?[^>]*>/i",$secvalue)) ||
|
---|
75 | (preg_match("/<[^>]*object*\"?[^>]*>/i", $secvalue)) ||
|
---|
76 | (preg_match("/<[^>]*iframe*\"?[^>]*>/i", $secvalue)) ||
|
---|
77 | (preg_match("/<[^>]*applet*\"?[^>]*>/i", $secvalue)) ||
|
---|
78 | (preg_match("/<[^>]*meta*\"?[^>]*>/i", $secvalue)) ||
|
---|
79 | (preg_match("/<[^>]*style*\"?[^>]*>/i", $secvalue)) ||
|
---|
80 | (preg_match("/<[^>]*form*\"?[^>]*>/i", $secvalue)) ||
|
---|
81 | (preg_match("/<[^>]*img*\"?[^>]*>/i", $secvalue)) ||
|
---|
82 | (preg_match("/<[^>]*onmouseover*\"?[^>]*>/i", $secvalue)) ||
|
---|
83 | (preg_match("/<[^>]*body*\"?[^>]*>/i", $secvalue)) ||
|
---|
84 | (preg_match("/\"/", $secvalue)) ||
|
---|
85 | (preg_match("/inside_mod/i", $sec_key))) {
|
---|
86 | die ("Operazione non consentita");
|
---|
87 | }
|
---|
88 | }
|
---|
89 |
|
---|
90 | foreach ($_POST as $secvalue) {
|
---|
91 | if ((preg_match("/<[^>]*onmouseover*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]script*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]*body*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]style*\"?[^>]*>/i", $secvalue))) {
|
---|
92 | die ('Operazione non consentita');
|
---|
93 | }
|
---|
94 | }
|
---|
95 |
|
---|
96 | // Posting from other servers in not allowed
|
---|
97 | // Fix by Quake
|
---|
98 | // Bug found by PeNdEjO
|
---|
99 |
|
---|
100 | if ($_SERVER['REQUEST_METHOD'] == "POST") {
|
---|
101 | if (isset($_SERVER['HTTP_REFERER'])) {
|
---|
102 | if (!stripos_clone($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) {
|
---|
103 | die('Posting da un altro server non consentito!');
|
---|
104 | }
|
---|
105 | } else {
|
---|
106 | # die('<b>Attenzione:</b> il tuo browser non puo inviare gli header HTTP_REFERER al website.<br>'.$_SERVER['HTTP_REFERER']);
|
---|
107 | }
|
---|
108 | }
|
---|
109 |
|
---|
110 |
|
---|
111 |
|
---|
112 |
|
---|
113 |
|
---|
114 |
|
---|
115 |
|
---|
116 | //===================================================================
|
---|
117 | session_name('sesadmin');
|
---|
118 | #session_start();//MODIFICHE PER GESTIONE SESSIONI
|
---|
119 | // gestione sessione
|
---|
120 | $a = session_id();
|
---|
121 | if(empty($a)) session_start();
|
---|
122 | #echo "SID: ".SID."<br>session_id(): ".session_id()."<br>COOKIE: ".$_COOKIE["PHPSESSID"];
|
---|
123 |
|
---|
124 | if (file_exists("config.php")){
|
---|
125 | $install="0"; @require_once("config.php");
|
---|
126 | }else{
|
---|
127 | $install="1";
|
---|
128 | }
|
---|
129 |
|
---|
130 | # verifica se effettuata la configurazione
|
---|
131 | if(empty($dbname) || $install=="1") {
|
---|
132 | die("<html><body><div style=\"text-align:center\"><br /><br /><img src=\"modules/Elezioni/images/logo.jpg\" alt=\"Eleonline\" title=\"Eleonline\"><br /><br /><strong>Sembra che <a href='http://www.eleonline.it' title='Eleonline'>Eleonline</a> non sia stato ancora installato.<br /><br />Puoi procedere <a href='../install/index.php'>cliccando qui</a> per iniziare l'installazione</strong></div></body></html>");
|
---|
133 | }
|
---|
134 |
|
---|
135 |
|
---|
136 |
|
---|
137 |
|
---|
138 | try{
|
---|
139 | $dbi = new PDO("mysql:host=$dbhost;charset=latin1", $dbuname, $dbpass, array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION));
|
---|
140 | $sql = "use $dbname";
|
---|
141 | $dbi->exec($sql);
|
---|
142 | }
|
---|
143 | catch(PDOException $e)
|
---|
144 | {
|
---|
145 | echo $sql . "<br>" . $e->getMessage();
|
---|
146 | }
|
---|
147 |
|
---|
148 |
|
---|
149 | # $dbi=mysql_connect($dbhost, $dbuname, $dbpass) or die("Connessione non riuscita: " . mysql_error());
|
---|
150 | # mysql_select_db($dbname)or die("Connessione non riuscita:" . mysql_error());
|
---|
151 | ## mysql_query("SET NAMES 'utf8'", $dbi);
|
---|
152 | //---10/05/2009 gestione consultazione predefinita
|
---|
153 | $sth = $dbi->prepare("select * from ".$prefix."_config");
|
---|
154 | $sth->execute();
|
---|
155 | $row = $sth->fetch(PDO::FETCH_ASSOC);
|
---|
156 | #$row = $sth->fetchAll();
|
---|
157 | $siteistat=$row['siteistat'];
|
---|
158 | if (!isset($_SESSION['id_comune'])){
|
---|
159 | $_SESSION['sitename']=$row['sitename'];
|
---|
160 | $_SESSION['siteurl']=$row['siteurl'];
|
---|
161 | $_SESSION['site_logo']=$row['site_logo'];
|
---|
162 | $_SESSION['slogan']=$row['slogan'];
|
---|
163 | $_SESSION['startdate']=$row['startdate'];
|
---|
164 | $_SESSION['adminmail']=$row['adminmail'];
|
---|
165 | if (isset($tema) and $tema=='facebook')
|
---|
166 | $_SESSION['tema']=$row['tema'];
|
---|
167 | else $_SESSION['tema']='default';
|
---|
168 | $_SESSION['foot']=$row['foot'];
|
---|
169 | $_SESSION['lang']=$row['language'];
|
---|
170 | $_SESSION['blocco']=$row['blocco'];
|
---|
171 | $_SESSION['testata']=$row['testata'];
|
---|
172 | # $_SESSION['logo']=$row['logo'];
|
---|
173 | $_SESSION['fileout']=$row['fileout'];
|
---|
174 | $_SESSION['copyright']=$row['copyright'];
|
---|
175 | $_SESSION['versione']=$row['versione'];
|
---|
176 | $_SESSION['patch']=$row['patch'];
|
---|
177 | $_SESSION['id_comune']=$row['siteistat'];
|
---|
178 | $_SESSION['multicomune']=$row['multicomune'];
|
---|
179 | $_SESSION['flash']=$row['flash'];
|
---|
180 | $_SESSION['displayerrors']=$row['displayerrors'];
|
---|
181 | $_SESSION['editor']=$row['editor'];
|
---|
182 | $_SESSION['tema_on']=$row['tema_on'];
|
---|
183 | $_SESSION['ed_user']=$row['ed_user'];
|
---|
184 | $multicomune=$row['multicomune'];
|
---|
185 | }
|
---|
186 | //fine
|
---|
187 | if (isset($param['aid'])) {
|
---|
188 | if (strlen($aid)>25 ) { die ("Nome utente troppo lungo: $aid"); }
|
---|
189 | if (!isset($param['id_ses']) or $param['id_ses'] != session_id()) logout();
|
---|
190 | if (strstr( $aid," ")) { die ("Gli spazi non sono ammessi nel nome utente: $aid"); }
|
---|
191 | if (isset($_SESSION['aid'])){
|
---|
192 | logout();//se hai gia' una sessione aperta non puoi postare 'aid'
|
---|
193 | }else{
|
---|
194 |
|
---|
195 |
|
---|
196 | // $pwd2=$param['pwd'];
|
---|
197 | $mpwd=md5($pwd2);
|
---|
198 |
|
---|
199 | // se superUserAdmin
|
---|
200 | ########
|
---|
201 | $sth = $dbi->prepare("select adminsuper from ".$prefix."_authors where aid='$aid' and pwd='$mpwd'");
|
---|
202 | $sth->execute();
|
---|
203 | $row = $sth->fetch(PDO::FETCH_ASSOC);
|
---|
204 | $adminsuper=$row['adminsuper'];
|
---|
205 | if ($adminsuper==1) $id_comune='0';
|
---|
206 | elseif (is_numeric($param['id_comune']) and intval($param['id_comune'])>0) $id_comune=intval($param['id_comune']);
|
---|
207 | $sth = $dbi->prepare("select counter,admlanguage from ".$prefix."_authors where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune'");
|
---|
208 | $sth->execute();
|
---|
209 | $esiste=$sth->rowCount();
|
---|
210 |
|
---|
211 |
|
---|
212 | if ($esiste){
|
---|
213 | $row = $sth->fetch(PDO::FETCH_ASSOC);
|
---|
214 | $counter=$row['counter'];
|
---|
215 | $tmplang=$row['admlanguage'];
|
---|
216 | $counter+=1;
|
---|
217 | if(strlen($tmplang)==2) $language=$tmplang;
|
---|
218 | $sth = $dbi->prepare("update ".$prefix."_authors set counter=$counter where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune'");
|
---|
219 | $sth->execute();
|
---|
220 | # $row = $sth->fetch(PDO::FETCH_ASSOC);
|
---|
221 |
|
---|
222 | if ($esiste==1) {
|
---|
223 | # $_SESSION['dbi']=$dbi;
|
---|
224 | $_SESSION['aid']="$aid";
|
---|
225 | $_SESSION['pwd']="$mpwd";
|
---|
226 | $_SESSION['lang']="$language";
|
---|
227 | $_SESSION['id_comune']="$id_comune";
|
---|
228 | $_SESSION['prefix']="soraldo";
|
---|
229 | $_SESSION['remote']=$_SERVER['REMOTE_ADDR'];
|
---|
230 | $_SESSION['bgcolor1']='#ffffff';
|
---|
231 | $_SESSION['bgcolor2']='#c5c5c5';
|
---|
232 | if (!isset($op)) $op='consultazione';
|
---|
233 | session_regenerate_id();
|
---|
234 | }
|
---|
235 | }
|
---|
236 | }
|
---|
237 | }else{
|
---|
238 | #$_SESSION['dbi']=$dbi;
|
---|
239 |
|
---|
240 | }
|
---|
241 | if (! isset($_SESSION['lang'])) $_SESSION['lang']=$language;
|
---|
242 | $currentlang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language;
|
---|
243 | if (isset($_SESSION['aid']))
|
---|
244 | {
|
---|
245 | //lettura sessione
|
---|
246 | $aid=$_SESSION['aid'];
|
---|
247 | #$dbi=$_SESSION['dbi'];
|
---|
248 | $prefix=$_SESSION['prefix'];
|
---|
249 | $id_comune=$_SESSION['id_comune'];
|
---|
250 | if (isset($_GET['id_cons_gen'])) $id_cons_gen=intval($_GET['id_cons_gen']);
|
---|
251 | else {
|
---|
252 | $sth = $dbi->prepare("select id_cons_gen from ".$prefix."_ele_cons_comune where preferita='1' and (id_comune='$id_comune' or id_comune=0)");
|
---|
253 | $sth->execute();
|
---|
254 | $row = $sth->fetch(PDO::FETCH_BOTH);
|
---|
255 | if($sth->rowCount())
|
---|
256 | $id_cons_gen=$row[0];
|
---|
257 | else
|
---|
258 | $id_cons_gen=0;
|
---|
259 | }
|
---|
260 | $currentlang=$_SESSION['lang'];
|
---|
261 | $bgcolor1=$_SESSION['bgcolor1'];
|
---|
262 | $bgcolor2=$_SESSION['bgcolor2'];
|
---|
263 | $bgcolor1='#e7e7e7';
|
---|
264 | $session=$_SESSION['remote'];
|
---|
265 |
|
---|
266 | $perms=ChiSei($id_cons_gen);
|
---|
267 | }
|
---|
268 |
|
---|
269 |
|
---|
270 | /*********************************************************/
|
---|
271 | /* Login Function */
|
---|
272 | /*********************************************************/
|
---|
273 | function ChiSei($id_cons_gen){
|
---|
274 | global $dbi;
|
---|
275 |
|
---|
276 | $aid=$_SESSION['aid'];
|
---|
277 | $prefix=$_SESSION['prefix'];
|
---|
278 | $pwd=$_SESSION['pwd'];
|
---|
279 | $id_comune=$_SESSION['id_comune'];
|
---|
280 |
|
---|
281 |
|
---|
282 | $perms=0;
|
---|
283 | $sql="select adminsuper, admincomune, adminop from ".$prefix."_authors where aid='$aid' and pwd='$pwd' and (id_comune='$id_comune' or id_comune=0)";
|
---|
284 | $sth = $dbi->prepare("$sql");
|
---|
285 | $sth->execute();
|
---|
286 | $row = $sth->fetch(PDO::FETCH_BOTH);
|
---|
287 |
|
---|
288 | $adminsuper=$row[0];
|
---|
289 | $admincomune=$row[1];
|
---|
290 | $adminop=$row[2];
|
---|
291 |
|
---|
292 | if (($adminsuper==1 || $admincomune==1 || $adminop==1)) {
|
---|
293 | if ($adminsuper==1)
|
---|
294 | return 256;
|
---|
295 | elseif ($adminop==1){
|
---|
296 | $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='$id_comune'");
|
---|
297 | }elseif ($admincomune==1) {
|
---|
298 | $sth = $dbi->prepare("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'");
|
---|
299 | $sth->execute();
|
---|
300 | $row = $sth->fetch(PDO::FETCH_BOTH);
|
---|
301 |
|
---|
302 | $id_cons=$row[0];
|
---|
303 | $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'");
|
---|
304 | }
|
---|
305 |
|
---|
306 | $sth->execute();
|
---|
307 | $row = $sth->fetch(PDO::FETCH_BOTH);
|
---|
308 |
|
---|
309 | if ($sth->rowCount()==1) $perms=$row[0]; else $perms=0;
|
---|
310 | return $perms;
|
---|
311 | } else return 0;
|
---|
312 | }
|
---|
313 |
|
---|
314 | function OpenTable(){
|
---|
315 | echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"2\" BORDER=\"0\">";
|
---|
316 | }
|
---|
317 |
|
---|
318 | function CloseTable(){
|
---|
319 | echo "</table>";
|
---|
320 | }
|
---|
321 |
|
---|
322 | function login() {
|
---|
323 | global $param,$prefix,$dbi,$multicomune,$siteistat,$language,$tema;
|
---|
324 | $lang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language;
|
---|
325 | if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']);
|
---|
326 | if (!isset($id_comune)) $id_comune=0;
|
---|
327 | session_regenerate_id();
|
---|
328 | $id_ses=session_id();
|
---|
329 | #die("test:$tema");
|
---|
330 | //include("modules/Elezioni/language/lang-$lang.php");
|
---|
331 | include ("header.php");
|
---|
332 | echo "<div align=\"middle\"><font class=\"title\"><b>"._GESTIONE."</b></font></center>";
|
---|
333 | echo "<br>"; # method=\"post\"
|
---|
334 | echo "<form name=\"login\" method=\"post\" action=\"admin.php\">"
|
---|
335 | ."<table class=\"table-menu\">"
|
---|
336 | ."<tr><td>"._ADMINID."</td>"
|
---|
337 | ."<td><input type=\"text\" NAME=\"aid\" SIZE=\"20\" MAXLENGTH=\"25\"></td></tr>"
|
---|
338 | ."<tr><td>"._PASSWORD."</td>"
|
---|
339 | ."<td><input type=\"password\" NAME=\"pwd\" SIZE=\"20\" MAXLENGTH=\"18\"></td></tr>"
|
---|
340 | ."<tr><td>";
|
---|
341 | // scelta comune
|
---|
342 | if($multicomune=='1'){
|
---|
343 | echo ""._COMUNE."</td><td>";
|
---|
344 | $sql="select * from ".$prefix."_ele_comuni order by descrizione asc";
|
---|
345 | $sth = $dbi->prepare("$sql");
|
---|
346 | $sth->execute();
|
---|
347 | $row = $sth->fetchAll();
|
---|
348 | echo "<select name=\"id_comune\">";
|
---|
349 | foreach($row as $comuni)
|
---|
350 | {$id=$comuni[0];$descrizione=$comuni[1];
|
---|
351 | $sel=($id == $id_comune) ? "selected":"";
|
---|
352 | echo "<option value=\"$id\" $sel>$descrizione";
|
---|
353 | }
|
---|
354 | }else{
|
---|
355 | echo "<input type=\"hidden\" name=\"id_comune\" value=\"$siteistat\">";
|
---|
356 | }
|
---|
357 | // echo "<input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\">";
|
---|
358 | if(strlen($lang)==2) echo "<input type=\"hidden\" name=\"language\" value=\"$lang\">";
|
---|
359 | echo "</td></tr><tr><td>";
|
---|
360 | echo "<input type=\"hidden\" name=\"id_ses\" value=\"$id_ses\">";
|
---|
361 | echo "<input type=\"submit\" VALUE=\""._OK."\">"
|
---|
362 | ."</td></tr></table>"
|
---|
363 | ."</form></div>";
|
---|
364 |
|
---|
365 | include ("footer.php");
|
---|
366 | }
|
---|
367 |
|
---|
368 | function logout()
|
---|
369 | {
|
---|
370 | /* $lang=$_SESSION['lang'];
|
---|
371 | $id_comune=$_SESSION['id_comune'];
|
---|
372 | // setcookie ("PHPSESSID", "", time() - 3600);
|
---|
373 | session_cache_expire (0);
|
---|
374 | $_SESSION=array(); //MODIFICHE PER GESTIONE SESSIONI
|
---|
375 | session_unset();
|
---|
376 | session_destroy();
|
---|
377 | Header("Location: admin.php?id_comune=$id_comune&language=$lang");
|
---|
378 | */
|
---|
379 | global $siteistat;
|
---|
380 |
|
---|
381 | $ref="Location: admin.php?";
|
---|
382 | if (isset($_SESSION['id_comune']))
|
---|
383 | $id_comune=$_SESSION['id_comune'];
|
---|
384 | else
|
---|
385 | $id_comune=$siteistat;
|
---|
386 | $ref=$ref."id_comune=".$id_comune;
|
---|
387 |
|
---|
388 | if (isset($_SESSION['lang']))
|
---|
389 | $ref=$ref."&language=".$_SESSION['lang'];
|
---|
390 |
|
---|
391 | $_SESSION=array();
|
---|
392 | session_unset();
|
---|
393 | session_destroy();
|
---|
394 | session_cache_expire (0);
|
---|
395 | Header($ref);
|
---|
396 |
|
---|
397 | }
|
---|
398 |
|
---|
399 |
|
---|
400 | #echo "op:".$param['op']." -- aid:".$_SESSION['aid']."remote:".$_SESSION['remote']."REMOTE:".$_SERVER['REMOTE_ADDR'];
|
---|
401 | if (isset($param['op'])) get_magic_quotes_gpc() ? $op=$param['op']:$op=addslashes($param['op']); else $op='ele';
|
---|
402 | //if (isset($param['op'])) $op=$param['op']; else $op='ele';
|
---|
403 | if (isset($_SESSION['aid']) AND $_SESSION['remote']==$_SERVER['REMOTE_ADDR']) {
|
---|
404 | switch($op) {
|
---|
405 | case "tipo":
|
---|
406 | include("modules/Elezioni/ele_tipi.php");
|
---|
407 | break;
|
---|
408 | case "constipi":
|
---|
409 | include("modules/Elezioni/ele_consultazionitipi.php");
|
---|
410 | break;
|
---|
411 | case "aggiorna":
|
---|
412 | include("modules/Elezioni/aggiorna.php");
|
---|
413 | break;
|
---|
414 | case "parziali":
|
---|
415 | include("modules/Elezioni/ele_parziali.php");
|
---|
416 | break;
|
---|
417 | case "ele":
|
---|
418 | include("modules/Elezioni/ele.php");
|
---|
419 | break;
|
---|
420 | case "consultazione":
|
---|
421 | include("modules/Elezioni/ele_consultazioni.php");
|
---|
422 | break;
|
---|
423 | case "configurazione":
|
---|
424 | include("modules/Elezioni/ele_configurazione.php");
|
---|
425 | break;
|
---|
426 | case "cons_comuni":
|
---|
427 | include("modules/Elezioni/ele_cons_comuni.php");
|
---|
428 | break;
|
---|
429 | case "confconsiglio":
|
---|
430 | include("modules/Elezioni/ele_confcons.php");
|
---|
431 | break;
|
---|
432 | case "inscomuni":
|
---|
433 | include("modules/Elezioni/ele_comuni.php");
|
---|
434 | break;
|
---|
435 | case "oper_admin":
|
---|
436 | include("modules/Elezioni/ele_operatori.php");
|
---|
437 | break;
|
---|
438 | case "inscollegi":
|
---|
439 | include("modules/Elezioni/ele_collegi.php");
|
---|
440 | break;
|
---|
441 | case "associazioni":
|
---|
442 | include("modules/Elezioni/ele_associazioni.php");
|
---|
443 | break;
|
---|
444 | case "operatori":
|
---|
445 | include("modules/Elezioni/ele_operatori.php");
|
---|
446 | break;
|
---|
447 | case "permessi":
|
---|
448 | include("modules/Elezioni/ele_permessi.php");
|
---|
449 | break;
|
---|
450 | case "circo":
|
---|
451 | include("modules/Elezioni/ele_circo.php");
|
---|
452 | break;
|
---|
453 | case "sede":
|
---|
454 | include("modules/Elezioni/ele_sede.php");
|
---|
455 | break;
|
---|
456 | case "sezione":
|
---|
457 | include("modules/Elezioni/ele_sezione.php");
|
---|
458 | break;
|
---|
459 | case "gruppo":
|
---|
460 | include("modules/Elezioni/ele_gruppo.php");
|
---|
461 | break;
|
---|
462 | case "rec_add_aff":
|
---|
463 | include("modules/Elezioni/ele_affluenze.php");
|
---|
464 | break;
|
---|
465 | case "rec_add_mod":
|
---|
466 | include("modules/Elezioni/ele_modelli.php");
|
---|
467 | break;
|
---|
468 | case "upgruppo":
|
---|
469 | include("modules/Elezioni/ele_gruppo.php");
|
---|
470 | break;
|
---|
471 | case "delimggruppo":
|
---|
472 | include("modules/Elezioni/ele_gruppo.php");
|
---|
473 | break;
|
---|
474 | case "lista":
|
---|
475 | include("modules/Elezioni/ele_lista.php");
|
---|
476 | break;
|
---|
477 | case "uplista":
|
---|
478 | include("modules/Elezioni/ele_lista.php");
|
---|
479 | break;
|
---|
480 | case "delimglista":
|
---|
481 | include("modules/Elezioni/ele_lista.php");
|
---|
482 | break;
|
---|
483 | case "candidato":
|
---|
484 | include("modules/Elezioni/ele_candidato.php");
|
---|
485 | break;
|
---|
486 | case "upcandidato":
|
---|
487 | include("modules/Elezioni/ele_candidato.php");
|
---|
488 | break;
|
---|
489 | case "delimgcandidato":
|
---|
490 | include("modules/Elezioni/ele_candidato.php");
|
---|
491 | break;
|
---|
492 |
|
---|
493 | case "voti":
|
---|
494 | include("modules/Elezioni/ele_voti.php");
|
---|
495 | break;
|
---|
496 | case "sezioni_voti":
|
---|
497 | include("modules/Elezioni/ele_voti.php");
|
---|
498 | break;
|
---|
499 | case "rec_voti":
|
---|
500 | include("modules/Elezioni/ele_voti.php");
|
---|
501 | break;
|
---|
502 | case "rec_voti_gruppi":
|
---|
503 | include("modules/Elezioni/ele_voti.php");
|
---|
504 | break;
|
---|
505 | case "rec_add_votanti":
|
---|
506 | include("modules/Elezioni/ele_voti.php");
|
---|
507 | break;
|
---|
508 | case "rec_finale":
|
---|
509 | include("modules/Elezioni/ele_voti.php");
|
---|
510 | break;
|
---|
511 | case "controllo_voti":
|
---|
512 | include("modules/Elezioni/controllo_voti.php");
|
---|
513 | break;
|
---|
514 | case "controllo_votanti":
|
---|
515 | include("modules/Elezioni/controllo_votanti.php");
|
---|
516 | break;
|
---|
517 | case "come":
|
---|
518 | include("modules/Elezioni/ele_come.php");
|
---|
519 | break;
|
---|
520 | case "numeri":
|
---|
521 | include("modules/Elezioni/ele_come.php");
|
---|
522 | break;
|
---|
523 | case "servizi":
|
---|
524 | include("modules/Elezioni/ele_come.php");
|
---|
525 | break;
|
---|
526 | case "link":
|
---|
527 | include("modules/Elezioni/ele_come.php");
|
---|
528 | break;
|
---|
529 | case "conf":
|
---|
530 | include("modules/Elezioni/ele_conf.php");
|
---|
531 | break;
|
---|
532 | case "stampa":
|
---|
533 | include("modules/Elezioni/ele_stampe.php");
|
---|
534 | break;
|
---|
535 | case "cambiopwd":
|
---|
536 | include("modules/Elezioni/ele_pwd.php");
|
---|
537 | break;
|
---|
538 | case "eletti":
|
---|
539 | include("modules/Elezioni/ele_eletti.php");
|
---|
540 | break;
|
---|
541 | case "foto":
|
---|
542 | include("modules/Elezioni/foto.php");
|
---|
543 | break;
|
---|
544 | case "consiglieri":
|
---|
545 | include("modules/Elezioni/ele_consiglieri.php");
|
---|
546 | break;
|
---|
547 | case "backup":
|
---|
548 | include("modules/Elezioni/backup.php");
|
---|
549 | break;
|
---|
550 | case "restore":
|
---|
551 | include("modules/Elezioni/restore.php");
|
---|
552 | break;
|
---|
553 | case "scarica":
|
---|
554 | include("modules/Elezioni/scarica.php");
|
---|
555 | break;
|
---|
556 | case "importa":
|
---|
557 | include("modules/Elezioni/importa.php");
|
---|
558 | break;
|
---|
559 | case "widget":
|
---|
560 | include("modules/Elezioni/ele_widget.php");
|
---|
561 | break;
|
---|
562 | case "riepilogo":
|
---|
563 | include("modules/Elezioni/ele_riepilogo.php");
|
---|
564 | break;
|
---|
565 | case "riepilogovoti":
|
---|
566 | include("modules/Elezioni/ele_riepilogovoti.php");
|
---|
567 | break;
|
---|
568 | case "logout":
|
---|
569 | logout();
|
---|
570 | break;
|
---|
571 | }
|
---|
572 |
|
---|
573 | }else {
|
---|
574 |
|
---|
575 | login();
|
---|
576 |
|
---|
577 | }
|
---|
578 |
|
---|
579 | ?>
|
---|