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