[2] | 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)
|
---|
[35] | 18 | # tempo di sessione: ini_set('session.gc_maxlifetime','3600');
|
---|
[2] | 19 |
|
---|
| 20 | // Adattamento variabili superglobal
|
---|
| 21 | // Versione di php
|
---|
| 22 | $phpver = phpversion();
|
---|
| 23 |
|
---|
| 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) {
|
---|
[21] | 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))) {
|
---|
[2] | 85 | die ("Operazione non consentita");
|
---|
| 86 | }
|
---|
| 87 | }
|
---|
| 88 |
|
---|
| 89 | foreach ($_POST as $secvalue) {
|
---|
[21] | 90 | if ((preg_match("/<[^>]*onmouseover*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]script*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]*body*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]style*\"?[^>]*>/i", $secvalue))) {
|
---|
[2] | 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 |
|
---|
[230] | 120 | if (file_exists("config.php")) @require_once("config.php"); else $install="1";
|
---|
[2] | 121 |
|
---|
[230] | 122 |
|
---|
| 123 |
|
---|
[154] | 124 | # verifica se effettuata la configurazione
|
---|
[230] | 125 | if(empty($dbname) || $istall=="1") {
|
---|
| 126 | 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>");
|
---|
[154] | 127 | }
|
---|
[2] | 128 |
|
---|
[154] | 129 |
|
---|
| 130 |
|
---|
| 131 |
|
---|
| 132 |
|
---|
| 133 |
|
---|
[230] | 134 |
|
---|
[2] | 135 | $dbi=mysql_connect($dbhost, $dbuname, $dbpass) or die("Connessione non riuscita: " . mysql_error());
|
---|
| 136 | mysql_select_db($dbname)or die("Connessione non riuscita:" . mysql_error());
|
---|
[21] | 137 | mysql_query("SET NAMES 'utf8'", $dbi);
|
---|
[2] | 138 | //---10/05/2009 gestione consultazione predefinita
|
---|
| 139 | $res_config = mysql_query("select * from ".$prefix."_config ",$dbi);
|
---|
| 140 | list ($sitename,$siteurl,$site_logo,$slogan,$startdate,$adminmail,$tema,$foot,$language,$blocco
|
---|
| 141 | ,$testata,$logo,$fileout,$copyright,$versione,$patch,$id_comune,$multicomune,$flash,$displayerrors,$editor,$tema_on,$ed_user) = mysql_fetch_row($res_config);
|
---|
| 142 | $siteistat=$id_comune;
|
---|
| 143 | if (!isset($_SESSION['id_comune'])){
|
---|
| 144 | $_SESSION['sitename']=$sitename;
|
---|
| 145 | $_SESSION['siteurl']=$siteurl;
|
---|
| 146 | $_SESSION['site_logo']=$site_logo;
|
---|
| 147 | $_SESSION['slogan']=$slogan;
|
---|
| 148 | $_SESSION['startdate']=$startdate;
|
---|
| 149 | $_SESSION['adminmail']=$adminmail;
|
---|
| 150 | if ($tema=='facebook')
|
---|
| 151 | $_SESSION['tema']=$tema;
|
---|
| 152 | else $_SESSION['tema']='default';
|
---|
| 153 | $_SESSION['foot']=$foot;
|
---|
| 154 | $_SESSION['lang']=$language;
|
---|
| 155 | $_SESSION['blocco']=$blocco;
|
---|
| 156 | $_SESSION['testata']=$testata;
|
---|
| 157 | $_SESSION['logo']=$logo;
|
---|
| 158 | $_SESSION['fileout']=$fileout;
|
---|
| 159 | $_SESSION['copyright']=$copyright;
|
---|
| 160 | $_SESSION['versione']=$versione;
|
---|
| 161 | $_SESSION['patch']=$patch;
|
---|
| 162 | $_SESSION['id_comune']=$id_comune;
|
---|
| 163 | $_SESSION['multicomune']=$multicomune;
|
---|
| 164 | $_SESSION['flash']=$flash;
|
---|
| 165 | $_SESSION['displayerrors']=$displayerrors;
|
---|
| 166 | $_SESSION['editor']=$editor;
|
---|
| 167 | $_SESSION['tema_on']=$tema_on;
|
---|
| 168 | $_SESSION['ed_user']=$ed_user;
|
---|
| 169 | }
|
---|
| 170 | //fine
|
---|
| 171 | if (isset($param['aid'])) {
|
---|
| 172 | if (strlen($aid)>25 ) { die ("Nome utente troppo lungo: $aid"); }
|
---|
| 173 | if (!isset($param['id_ses']) or $param['id_ses'] != session_id()) logout();
|
---|
[21] | 174 | if (strstr( $aid," ")) { die ("Gli spazi non sono ammessi nel nome utente: $aid"); }
|
---|
[2] | 175 | if (isset($_SESSION['aid'])){
|
---|
| 176 | logout();//se hai gia' una sessione aperta non puoi postare 'aid'
|
---|
| 177 | }else{
|
---|
| 178 |
|
---|
| 179 |
|
---|
| 180 | // $pwd2=$param['pwd'];
|
---|
| 181 | $mpwd=md5($pwd2);
|
---|
| 182 |
|
---|
| 183 | // se superUserAdmin
|
---|
| 184 | ########
|
---|
| 185 | $res_comune = mysql_query("select adminsuper from ".$prefix."_authors where aid='$aid' and pwd='$mpwd'",$dbi);
|
---|
| 186 | list ($adminsuper) = mysql_fetch_row($res_comune);
|
---|
| 187 | if ($adminsuper==1) $id_comune='0';
|
---|
| 188 | elseif (is_numeric($param['id_comune']) and intval($param['id_comune'])>0) $id_comune=intval($param['id_comune']);
|
---|
| 189 | $res= mysql_query("select counter,admlanguage from ".$prefix."_authors where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune'", $dbi);
|
---|
| 190 |
|
---|
| 191 | if ($res){
|
---|
| 192 | $esiste=mysql_num_rows($res);
|
---|
| 193 |
|
---|
| 194 |
|
---|
| 195 | list ($counter,$tmplang) = mysql_fetch_row($res);
|
---|
| 196 | $counter+=1;
|
---|
| 197 | if(strlen($tmplang)==2) $language=$tmplang;
|
---|
| 198 | $resup=mysql_query("update ".$prefix."_authors set counter=$counter where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune'", $dbi);
|
---|
| 199 | if ($esiste==1) {
|
---|
| 200 | $_SESSION['dbi']=$dbi;
|
---|
| 201 | $_SESSION['aid']="$aid";
|
---|
| 202 | $_SESSION['pwd']="$mpwd";
|
---|
| 203 | $_SESSION['lang']="$language";
|
---|
| 204 | $_SESSION['id_comune']="$id_comune";
|
---|
| 205 | $_SESSION['prefix']="soraldo";
|
---|
| 206 | $_SESSION['remote']=$_SERVER['REMOTE_ADDR'];
|
---|
| 207 | $_SESSION['bgcolor1']='#ffffff';
|
---|
| 208 | $_SESSION['bgcolor2']='#c5c5c5';
|
---|
| 209 | session_regenerate_id();
|
---|
| 210 | }
|
---|
| 211 | }
|
---|
| 212 | }
|
---|
| 213 | }else{
|
---|
| 214 | $_SESSION['dbi']=$dbi;
|
---|
| 215 |
|
---|
| 216 | }
|
---|
| 217 | if (! isset($_SESSION['lang'])) $_SESSION['lang']=$language;
|
---|
| 218 | $currentlang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language;
|
---|
| 219 | #if (isset($_SESSION['lang'])) $currentlang=$_SESSION['lang']; else $currentlang='it';
|
---|
| 220 | if (isset($_SESSION['aid']))
|
---|
| 221 | {
|
---|
| 222 | //lettura sessione
|
---|
| 223 | $aid=$_SESSION['aid'];
|
---|
| 224 | $dbi=$_SESSION['dbi'];
|
---|
| 225 | $prefix=$_SESSION['prefix'];
|
---|
| 226 | $id_comune=$_SESSION['id_comune'];
|
---|
| 227 | if (isset($_GET['id_cons_gen'])) $id_cons_gen=intval($_GET['id_cons_gen']);
|
---|
| 228 | else {
|
---|
| 229 | //10/05/2009 gestione consultazione predefinita
|
---|
| 230 | $result = mysql_query("select id_cons_gen from ".$prefix."_ele_cons_comune where preferita='1' and (id_comune='$id_comune' or id_comune=0)", $dbi);
|
---|
| 231 | list($id_cons_gen) = mysql_fetch_row($result);
|
---|
| 232 | //---fine $id_cons_gen='';
|
---|
| 233 | }
|
---|
| 234 | $currentlang=$_SESSION['lang'];
|
---|
| 235 | $bgcolor1=$_SESSION['bgcolor1'];
|
---|
| 236 | $bgcolor2=$_SESSION['bgcolor2'];
|
---|
| 237 | $bgcolor1='#e7e7e7';
|
---|
| 238 | $session=$_SESSION['remote'];
|
---|
| 239 |
|
---|
| 240 | $perms=ChiSei($id_cons_gen);
|
---|
| 241 | }
|
---|
| 242 |
|
---|
| 243 |
|
---|
| 244 | /*********************************************************/
|
---|
| 245 | /* Login Function */
|
---|
| 246 | /*********************************************************/
|
---|
| 247 | function ChiSei($id_cons_gen){
|
---|
| 248 |
|
---|
| 249 | //$server=$_SERVER['REMOTE_ADDR'];
|
---|
| 250 | //$session=$_SESSION['remote'];
|
---|
| 251 | //if ($session!=$server) { die ("Problema di sessione"); };
|
---|
| 252 | $aid=$_SESSION['aid'];
|
---|
| 253 | $dbi=$_SESSION['dbi'];
|
---|
| 254 | $prefix=$_SESSION['prefix'];
|
---|
| 255 | $pwd=$_SESSION['pwd'];
|
---|
| 256 | $id_comune=$_SESSION['id_comune'];
|
---|
| 257 |
|
---|
| 258 |
|
---|
| 259 | $perms=0;
|
---|
| 260 | $result = mysql_query("select adminsuper, admincomune, adminop from ".$prefix."_authors where aid='$aid' and pwd='$pwd' and (id_comune='$id_comune' or id_comune=0)", $dbi);
|
---|
| 261 | list($adminsuper,$admincomune,$adminop) = mysql_fetch_row($result);
|
---|
| 262 | //exit;
|
---|
| 263 | if (($adminsuper==1 || $admincomune==1 || $adminop==1)) {
|
---|
| 264 | if ($adminsuper==1)
|
---|
| 265 | return 256;
|
---|
| 266 | // $ressup = mysql_query("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='0'",$dbi);
|
---|
| 267 | elseif ($adminop==1)
|
---|
| 268 | $ressup = mysql_query("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='$id_comune'",$dbi);
|
---|
| 269 | elseif ($admincomune==1) {
|
---|
| 270 | $res=mysql_query("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'",$dbi);
|
---|
| 271 | list ($id_cons)=mysql_fetch_row($res);
|
---|
| 272 | $ressup = mysql_query("select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'",$dbi);
|
---|
| 273 | }
|
---|
| 274 | if (mysql_num_rows($ressup)==1) list($perms)=mysql_fetch_row($ressup); else $perms=0;
|
---|
| 275 | return $perms;
|
---|
| 276 | } else return 0;
|
---|
| 277 | }
|
---|
| 278 |
|
---|
| 279 | function OpenTable(){
|
---|
| 280 | echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"2\" BORDER=\"0\">";
|
---|
| 281 | }
|
---|
| 282 |
|
---|
| 283 | function CloseTable(){
|
---|
| 284 | echo "</table>";
|
---|
| 285 | }
|
---|
| 286 |
|
---|
| 287 | function login() {
|
---|
| 288 | global $param,$prefix,$dbi,$multicomune,$siteistat,$language,$tema;
|
---|
| 289 | $lang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language;
|
---|
| 290 | if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']);
|
---|
[31] | 291 | if (!isset($id_comune)) $id_comune=0;
|
---|
[2] | 292 | session_regenerate_id();
|
---|
| 293 | $id_ses=session_id();
|
---|
| 294 | #die("test:$tema");
|
---|
| 295 | //include("modules/Elezioni/language/lang-$lang.php");
|
---|
| 296 | include ("header.php");
|
---|
| 297 | echo "<div align=\"middle\"><font class=\"title\"><b>"._GESTIONE."</b></font></center>";
|
---|
| 298 | echo "<br>"; # method=\"post\"
|
---|
| 299 | echo "<form name=\"login\" method=\"post\" action=\"admin.php\">"
|
---|
[80] | 300 | ."<table class=\"table-menu\">"
|
---|
[2] | 301 | ."<tr><td>"._ADMINID."</td>"
|
---|
| 302 | ."<td><input type=\"text\" NAME=\"aid\" SIZE=\"20\" MAXLENGTH=\"25\"></td></tr>"
|
---|
| 303 | ."<tr><td>"._PASSWORD."</td>"
|
---|
| 304 | ."<td><input type=\"password\" NAME=\"pwd\" SIZE=\"20\" MAXLENGTH=\"18\"></td></tr>"
|
---|
| 305 | ."<tr><td>";
|
---|
| 306 | // scelta comune
|
---|
| 307 | if($multicomune=='1'){
|
---|
| 308 | echo ""._COMUNE."</td><td>";
|
---|
| 309 | $sqlcomu="select id_comune,descrizione from ".$prefix."_ele_comuni order by descrizione asc";
|
---|
| 310 | $rescomu= mysql_query("$sqlcomu",$dbi);
|
---|
| 311 |
|
---|
| 312 | echo "<select name=\"id_comune\">";
|
---|
| 313 | while (list($id,$descrizione)=mysql_fetch_row($rescomu))
|
---|
| 314 | {
|
---|
| 315 | $sel=($id == $id_comune) ? "selected":"";
|
---|
| 316 | echo "<option value=\"$id\" $sel>$descrizione";
|
---|
| 317 | }
|
---|
| 318 | }else{
|
---|
| 319 | echo "<input type=\"hidden\" name=\"id_comune\" value=\"$siteistat\">";
|
---|
| 320 | }
|
---|
| 321 | // echo "<input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\">";
|
---|
| 322 | if(strlen($lang)==2) echo "<input type=\"hidden\" name=\"language\" value=\"$lang\">";
|
---|
| 323 | echo "</td></tr><tr><td>";
|
---|
| 324 | echo "<input type=\"hidden\" name=\"id_ses\" value=\"$id_ses\">";
|
---|
| 325 | echo "<input type=\"submit\" VALUE=\""._OK."\">"
|
---|
| 326 | ."</td></tr></table>"
|
---|
| 327 | ."</form></div>";
|
---|
| 328 |
|
---|
| 329 | include ("footer.php");
|
---|
| 330 | }
|
---|
| 331 |
|
---|
| 332 | function logout()
|
---|
| 333 | {
|
---|
| 334 | /* $lang=$_SESSION['lang'];
|
---|
| 335 | $id_comune=$_SESSION['id_comune'];
|
---|
| 336 | // setcookie ("PHPSESSID", "", time() - 3600);
|
---|
| 337 | session_cache_expire (0);
|
---|
| 338 | $_SESSION=array(); //MODIFICHE PER GESTIONE SESSIONI
|
---|
| 339 | session_unset();
|
---|
| 340 | session_destroy();
|
---|
| 341 | Header("Location: admin.php?id_comune=$id_comune&language=$lang");
|
---|
| 342 | */
|
---|
| 343 | global $siteistat;
|
---|
| 344 |
|
---|
| 345 | $ref="Location: admin.php?";
|
---|
| 346 | if (isset($_SESSION['id_comune']))
|
---|
| 347 | $id_comune=$_SESSION['id_comune'];
|
---|
| 348 | else
|
---|
| 349 | $id_comune=$siteistat;
|
---|
| 350 | $ref=$ref."id_comune=".$id_comune;
|
---|
| 351 |
|
---|
| 352 | if (isset($_SESSION['lang']))
|
---|
| 353 | $ref=$ref."&language=".$_SESSION['lang'];
|
---|
| 354 |
|
---|
| 355 | session_cache_expire (0);
|
---|
| 356 | $_SESSION=array();
|
---|
| 357 | session_unset();
|
---|
| 358 | session_destroy();
|
---|
| 359 | Header($ref);
|
---|
| 360 |
|
---|
| 361 | }
|
---|
| 362 |
|
---|
| 363 | if (isset($param['op'])) get_magic_quotes_gpc() ? $op=$param['op']:$op=addslashes($param['op']); else $op='ele';
|
---|
| 364 | //if (isset($param['op'])) $op=$param['op']; else $op='ele';
|
---|
| 365 | if (isset($_SESSION['aid']) AND $_SESSION['remote']==$_SERVER['REMOTE_ADDR']) {
|
---|
| 366 | switch($op) {
|
---|
| 367 | case "tipo":
|
---|
| 368 | include("modules/Elezioni/ele_tipi.php");
|
---|
| 369 | break;
|
---|
| 370 | case "constipi":
|
---|
| 371 | include("modules/Elezioni/ele_consultazionitipi.php");
|
---|
| 372 | break;
|
---|
| 373 | case "aggiorna":
|
---|
| 374 | include("modules/Elezioni/aggiorna.php");
|
---|
| 375 | break;
|
---|
| 376 | case "parziali":
|
---|
| 377 | include("modules/Elezioni/ele_parziali.php");
|
---|
| 378 | break;
|
---|
| 379 | case "ele":
|
---|
| 380 | include("modules/Elezioni/ele.php");
|
---|
| 381 | break;
|
---|
| 382 | case "consultazione":
|
---|
| 383 | include("modules/Elezioni/ele_consultazioni.php");
|
---|
| 384 | break;
|
---|
| 385 | case "configurazione":
|
---|
| 386 | include("modules/Elezioni/ele_configurazione.php");
|
---|
| 387 | break;
|
---|
| 388 | case "cons_comuni":
|
---|
| 389 | include("modules/Elezioni/ele_cons_comuni.php");
|
---|
| 390 | break;
|
---|
| 391 | case "confconsiglio":
|
---|
| 392 | include("modules/Elezioni/ele_confcons.php");
|
---|
| 393 | break;
|
---|
| 394 | case "inscomuni":
|
---|
| 395 | include("modules/Elezioni/ele_comuni.php");
|
---|
| 396 | break;
|
---|
| 397 | case "oper_admin":
|
---|
| 398 | include("modules/Elezioni/ele_operatori.php");
|
---|
| 399 | break;
|
---|
| 400 | case "inscollegi":
|
---|
| 401 | include("modules/Elezioni/ele_collegi.php");
|
---|
| 402 | break;
|
---|
| 403 | case "associazioni":
|
---|
| 404 | include("modules/Elezioni/ele_associazioni.php");
|
---|
| 405 | break;
|
---|
| 406 | case "operatori":
|
---|
| 407 | include("modules/Elezioni/ele_operatori.php");
|
---|
| 408 | break;
|
---|
| 409 | case "permessi":
|
---|
| 410 | include("modules/Elezioni/ele_permessi.php");
|
---|
| 411 | break;
|
---|
| 412 | case "circo":
|
---|
| 413 | include("modules/Elezioni/ele_circo.php");
|
---|
| 414 | break;
|
---|
| 415 | case "sede":
|
---|
| 416 | include("modules/Elezioni/ele_sede.php");
|
---|
| 417 | break;
|
---|
| 418 | case "sezione":
|
---|
| 419 | include("modules/Elezioni/ele_sezione.php");
|
---|
| 420 | break;
|
---|
| 421 | case "gruppo":
|
---|
| 422 | include("modules/Elezioni/ele_gruppo.php");
|
---|
| 423 | break;
|
---|
| 424 | case "rec_add_aff":
|
---|
| 425 | include("modules/Elezioni/ele_affluenze.php");
|
---|
| 426 | break;
|
---|
| 427 | case "rec_add_mod":
|
---|
| 428 | include("modules/Elezioni/ele_modelli.php");
|
---|
| 429 | break;
|
---|
| 430 | case "upgruppo":
|
---|
| 431 | include("modules/Elezioni/ele_gruppo.php");
|
---|
| 432 | break;
|
---|
| 433 | case "delimggruppo":
|
---|
| 434 | include("modules/Elezioni/ele_gruppo.php");
|
---|
| 435 | break;
|
---|
| 436 | case "lista":
|
---|
| 437 | include("modules/Elezioni/ele_lista.php");
|
---|
| 438 | break;
|
---|
| 439 | case "uplista":
|
---|
| 440 | include("modules/Elezioni/ele_lista.php");
|
---|
| 441 | break;
|
---|
| 442 | case "delimglista":
|
---|
| 443 | include("modules/Elezioni/ele_lista.php");
|
---|
| 444 | break;
|
---|
| 445 | case "candidato":
|
---|
| 446 | include("modules/Elezioni/ele_candidato.php");
|
---|
| 447 | break;
|
---|
| 448 | case "upcandidato":
|
---|
| 449 | include("modules/Elezioni/ele_candidato.php");
|
---|
| 450 | break;
|
---|
| 451 | case "delimgcandidato":
|
---|
| 452 | include("modules/Elezioni/ele_candidato.php");
|
---|
| 453 | break;
|
---|
| 454 |
|
---|
| 455 | case "voti":
|
---|
| 456 | include("modules/Elezioni/ele_voti.php");
|
---|
| 457 | break;
|
---|
| 458 | case "sezioni_voti":
|
---|
| 459 | include("modules/Elezioni/ele_voti.php");
|
---|
| 460 | break;
|
---|
| 461 | case "rec_voti":
|
---|
| 462 | include("modules/Elezioni/ele_voti.php");
|
---|
| 463 | break;
|
---|
| 464 | case "rec_voti_gruppi":
|
---|
| 465 | include("modules/Elezioni/ele_voti.php");
|
---|
| 466 | break;
|
---|
| 467 | case "rec_add_votanti":
|
---|
| 468 | include("modules/Elezioni/ele_voti.php");
|
---|
| 469 | break;
|
---|
| 470 | case "rec_finale":
|
---|
| 471 | include("modules/Elezioni/ele_voti.php");
|
---|
| 472 | break;
|
---|
| 473 | case "controllo_voti":
|
---|
| 474 | include("modules/Elezioni/controllo_voti.php");
|
---|
| 475 | break;
|
---|
| 476 | case "controllo_votanti":
|
---|
| 477 | include("modules/Elezioni/controllo_votanti.php");
|
---|
| 478 | break;
|
---|
| 479 | case "come":
|
---|
| 480 | include("modules/Elezioni/ele_come.php");
|
---|
| 481 | break;
|
---|
| 482 | case "numeri":
|
---|
| 483 | include("modules/Elezioni/ele_come.php");
|
---|
| 484 | break;
|
---|
| 485 | case "servizi":
|
---|
| 486 | include("modules/Elezioni/ele_come.php");
|
---|
| 487 | break;
|
---|
| 488 | case "link":
|
---|
| 489 | include("modules/Elezioni/ele_come.php");
|
---|
| 490 | break;
|
---|
| 491 | case "conf":
|
---|
| 492 | include("modules/Elezioni/ele_conf.php");
|
---|
| 493 | break;
|
---|
| 494 | case "stampa":
|
---|
| 495 | include("modules/Elezioni/ele_stampe.php");
|
---|
| 496 | break;
|
---|
| 497 | case "cambiopwd":
|
---|
| 498 | include("modules/Elezioni/ele_pwd.php");
|
---|
| 499 | break;
|
---|
| 500 | case "eletti":
|
---|
| 501 | include("modules/Elezioni/ele_eletti.php");
|
---|
| 502 | break;
|
---|
| 503 | case "foto":
|
---|
| 504 | include("modules/Elezioni/foto.php");
|
---|
| 505 | break;
|
---|
| 506 | case "consiglieri":
|
---|
| 507 | include("modules/Elezioni/ele_consiglieri.php");
|
---|
| 508 | break;
|
---|
| 509 | case "backup":
|
---|
| 510 | include("modules/Elezioni/backup.php");
|
---|
| 511 | break;
|
---|
| 512 | case "restore":
|
---|
| 513 | include("modules/Elezioni/restore.php");
|
---|
| 514 | break;
|
---|
| 515 | case "scarica":
|
---|
| 516 | include("modules/Elezioni/scarica.php");
|
---|
| 517 | break;
|
---|
| 518 | case "importa":
|
---|
| 519 | include("modules/Elezioni/importa.php");
|
---|
| 520 | break;
|
---|
[80] | 521 | case "widget":
|
---|
| 522 | include("modules/Elezioni/ele_widget.php");
|
---|
[2] | 523 | break;
|
---|
[139] | 524 | case "riepilogo":
|
---|
| 525 | include("modules/Elezioni/ele_riepilogo.php");
|
---|
| 526 | break;
|
---|
[2] | 527 | case "logout":
|
---|
| 528 | logout();
|
---|
| 529 | break;
|
---|
| 530 | }
|
---|
| 531 | }else {
|
---|
| 532 |
|
---|
| 533 | login();
|
---|
| 534 |
|
---|
| 535 | }
|
---|
| 536 |
|
---|
| 537 |
|
---|
| 538 | ?>
|
---|