[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');
|
---|
[332] | 19 | global $multicomune;
|
---|
[2] | 20 |
|
---|
| 21 | // Adattamento variabili superglobal
|
---|
| 22 | // Versione di php
|
---|
| 23 | $phpver = phpversion();
|
---|
[255] | 24 | global $dbi;
|
---|
[2] | 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) {
|
---|
[21] | 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))) {
|
---|
[2] | 86 | die ("Operazione non consentita");
|
---|
| 87 | }
|
---|
| 88 | }
|
---|
| 89 |
|
---|
| 90 | foreach ($_POST as $secvalue) {
|
---|
[21] | 91 | if ((preg_match("/<[^>]*onmouseover*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]script*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]*body*\"?[^>]*>/i", $secvalue)) || (preg_match("/<[^>]style*\"?[^>]*>/i", $secvalue))) {
|
---|
[2] | 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');
|
---|
[255] | 118 | #session_start();//MODIFICHE PER GESTIONE SESSIONI
|
---|
[2] | 119 | // gestione sessione
|
---|
[255] | 120 | $a = session_id();
|
---|
| 121 | if(empty($a)) session_start();
|
---|
| 122 | #echo "SID: ".SID."<br>session_id(): ".session_id()."<br>COOKIE: ".$_COOKIE["PHPSESSID"];
|
---|
[2] | 123 |
|
---|
[246] | 124 | if (file_exists("config.php")){
|
---|
| 125 | $install="0"; @require_once("config.php");
|
---|
| 126 | }else{
|
---|
| 127 | $install="1";
|
---|
| 128 | }
|
---|
[2] | 129 |
|
---|
[154] | 130 | # verifica se effettuata la configurazione
|
---|
[246] | 131 | if(empty($dbname) || $install=="1") {
|
---|
[230] | 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>");
|
---|
[154] | 133 | }
|
---|
[2] | 134 |
|
---|
[154] | 135 |
|
---|
| 136 |
|
---|
| 137 |
|
---|
[253] | 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 | }
|
---|
[154] | 147 |
|
---|
| 148 |
|
---|
[253] | 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);
|
---|
[2] | 152 | //---10/05/2009 gestione consultazione predefinita
|
---|
[253] | 153 | $sth = $dbi->prepare("select * from ".$prefix."_config");
|
---|
| 154 | $sth->execute();
|
---|
[255] | 155 | $row = $sth->fetch(PDO::FETCH_ASSOC);
|
---|
| 156 | #$row = $sth->fetchAll();
|
---|
[254] | 157 | $siteistat=$row['siteistat'];
|
---|
[2] | 158 | if (!isset($_SESSION['id_comune'])){
|
---|
[253] | 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'];
|
---|
[258] | 165 | if (isset($tema) and $tema=='facebook')
|
---|
[253] | 166 | $_SESSION['tema']=$row['tema'];
|
---|
[2] | 167 | else $_SESSION['tema']='default';
|
---|
[253] | 168 | $_SESSION['foot']=$row['foot'];
|
---|
| 169 | $_SESSION['lang']=$row['language'];
|
---|
| 170 | $_SESSION['blocco']=$row['blocco'];
|
---|
| 171 | $_SESSION['testata']=$row['testata'];
|
---|
[255] | 172 | # $_SESSION['logo']=$row['logo'];
|
---|
[253] | 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'];
|
---|
[255] | 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'];
|
---|
[332] | 184 | $multicomune=$row['multicomune'];
|
---|
[254] | 185 | }
|
---|
[2] | 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();
|
---|
[21] | 190 | if (strstr( $aid," ")) { die ("Gli spazi non sono ammessi nel nome utente: $aid"); }
|
---|
[2] | 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 | ########
|
---|
[254] | 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';
|
---|
[2] | 206 | elseif (is_numeric($param['id_comune']) and intval($param['id_comune'])>0) $id_comune=intval($param['id_comune']);
|
---|
[254] | 207 | $sth = $dbi->prepare("select counter,admlanguage from ".$prefix."_authors where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune'");
|
---|
| 208 | $sth->execute();
|
---|
[291] | 209 | $esiste=$sth->rowCount();
|
---|
| 210 |
|
---|
[2] | 211 |
|
---|
[291] | 212 | if ($esiste){
|
---|
| 213 | $row = $sth->fetch(PDO::FETCH_ASSOC);
|
---|
[254] | 214 | $counter=$row['counter'];
|
---|
| 215 | $tmplang=$row['admlanguage'];
|
---|
[2] | 216 | $counter+=1;
|
---|
| 217 | if(strlen($tmplang)==2) $language=$tmplang;
|
---|
[254] | 218 | $sth = $dbi->prepare("update ".$prefix."_authors set counter=$counter where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune'");
|
---|
| 219 | $sth->execute();
|
---|
[255] | 220 | # $row = $sth->fetch(PDO::FETCH_ASSOC);
|
---|
[254] | 221 |
|
---|
[2] | 222 | if ($esiste==1) {
|
---|
[255] | 223 | # $_SESSION['dbi']=$dbi;
|
---|
[2] | 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';
|
---|
[269] | 231 | $_SESSION['bgcolor2']='#c5c5c5';
|
---|
| 232 | if (!isset($op)) $op='consultazione';
|
---|
[2] | 233 | session_regenerate_id();
|
---|
| 234 | }
|
---|
| 235 | }
|
---|
| 236 | }
|
---|
| 237 | }else{
|
---|
[255] | 238 | #$_SESSION['dbi']=$dbi;
|
---|
[2] | 239 |
|
---|
[255] | 240 | }
|
---|
[2] | 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'];
|
---|
[255] | 247 | #$dbi=$_SESSION['dbi'];
|
---|
[2] | 248 | $prefix=$_SESSION['prefix'];
|
---|
[254] | 249 | $id_comune=$_SESSION['id_comune'];
|
---|
[2] | 250 | if (isset($_GET['id_cons_gen'])) $id_cons_gen=intval($_GET['id_cons_gen']);
|
---|
| 251 | else {
|
---|
[254] | 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();
|
---|
[255] | 254 | $row = $sth->fetch(PDO::FETCH_BOTH);
|
---|
| 255 | $id_cons_gen=$row[0];
|
---|
[2] | 256 | }
|
---|
| 257 | $currentlang=$_SESSION['lang'];
|
---|
| 258 | $bgcolor1=$_SESSION['bgcolor1'];
|
---|
| 259 | $bgcolor2=$_SESSION['bgcolor2'];
|
---|
| 260 | $bgcolor1='#e7e7e7';
|
---|
| 261 | $session=$_SESSION['remote'];
|
---|
| 262 |
|
---|
| 263 | $perms=ChiSei($id_cons_gen);
|
---|
| 264 | }
|
---|
| 265 |
|
---|
| 266 |
|
---|
| 267 | /*********************************************************/
|
---|
| 268 | /* Login Function */
|
---|
| 269 | /*********************************************************/
|
---|
| 270 | function ChiSei($id_cons_gen){
|
---|
[255] | 271 | global $dbi;
|
---|
[2] | 272 |
|
---|
| 273 | $aid=$_SESSION['aid'];
|
---|
| 274 | $prefix=$_SESSION['prefix'];
|
---|
| 275 | $pwd=$_SESSION['pwd'];
|
---|
| 276 | $id_comune=$_SESSION['id_comune'];
|
---|
| 277 |
|
---|
| 278 |
|
---|
| 279 | $perms=0;
|
---|
[257] | 280 | $sql="select adminsuper, admincomune, adminop from ".$prefix."_authors where aid='$aid' and pwd='$pwd' and (id_comune='$id_comune' or id_comune=0)";
|
---|
| 281 | $sth = $dbi->prepare("$sql");
|
---|
| 282 | $sth->execute();
|
---|
| 283 | $row = $sth->fetch(PDO::FETCH_BOTH);
|
---|
[254] | 284 |
|
---|
| 285 | $adminsuper=$row[0];
|
---|
| 286 | $admincomune=$row[1];
|
---|
| 287 | $adminop=$row[2];
|
---|
| 288 |
|
---|
[2] | 289 | if (($adminsuper==1 || $admincomune==1 || $adminop==1)) {
|
---|
| 290 | if ($adminsuper==1)
|
---|
| 291 | return 256;
|
---|
[254] | 292 | elseif ($adminop==1){
|
---|
| 293 | $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='$id_comune'");
|
---|
| 294 | }elseif ($admincomune==1) {
|
---|
| 295 | $sth = $dbi->prepare("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'");
|
---|
| 296 | $sth->execute();
|
---|
| 297 | $row = $sth->fetch(PDO::FETCH_BOTH);
|
---|
| 298 |
|
---|
| 299 | $id_cons=$row[0];
|
---|
| 300 | $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'");
|
---|
[2] | 301 | }
|
---|
[254] | 302 |
|
---|
| 303 | $sth->execute();
|
---|
| 304 | $row = $sth->fetch(PDO::FETCH_BOTH);
|
---|
| 305 |
|
---|
| 306 | if ($sth->rowCount()==1) $perms=$row[0]; else $perms=0;
|
---|
[2] | 307 | return $perms;
|
---|
| 308 | } else return 0;
|
---|
| 309 | }
|
---|
| 310 |
|
---|
| 311 | function OpenTable(){
|
---|
| 312 | echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"2\" BORDER=\"0\">";
|
---|
| 313 | }
|
---|
| 314 |
|
---|
| 315 | function CloseTable(){
|
---|
| 316 | echo "</table>";
|
---|
| 317 | }
|
---|
| 318 |
|
---|
| 319 | function login() {
|
---|
| 320 | global $param,$prefix,$dbi,$multicomune,$siteistat,$language,$tema;
|
---|
| 321 | $lang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language;
|
---|
| 322 | if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']);
|
---|
[31] | 323 | if (!isset($id_comune)) $id_comune=0;
|
---|
[2] | 324 | session_regenerate_id();
|
---|
| 325 | $id_ses=session_id();
|
---|
| 326 | #die("test:$tema");
|
---|
| 327 | //include("modules/Elezioni/language/lang-$lang.php");
|
---|
| 328 | include ("header.php");
|
---|
| 329 | echo "<div align=\"middle\"><font class=\"title\"><b>"._GESTIONE."</b></font></center>";
|
---|
| 330 | echo "<br>"; # method=\"post\"
|
---|
| 331 | echo "<form name=\"login\" method=\"post\" action=\"admin.php\">"
|
---|
[80] | 332 | ."<table class=\"table-menu\">"
|
---|
[2] | 333 | ."<tr><td>"._ADMINID."</td>"
|
---|
| 334 | ."<td><input type=\"text\" NAME=\"aid\" SIZE=\"20\" MAXLENGTH=\"25\"></td></tr>"
|
---|
| 335 | ."<tr><td>"._PASSWORD."</td>"
|
---|
| 336 | ."<td><input type=\"password\" NAME=\"pwd\" SIZE=\"20\" MAXLENGTH=\"18\"></td></tr>"
|
---|
| 337 | ."<tr><td>";
|
---|
| 338 | // scelta comune
|
---|
| 339 | if($multicomune=='1'){
|
---|
| 340 | echo ""._COMUNE."</td><td>";
|
---|
[332] | 341 | $sql="select * from ".$prefix."_ele_comuni order by descrizione asc";
|
---|
| 342 | $sth = $dbi->prepare("$sql");
|
---|
| 343 | $sth->execute();
|
---|
| 344 | $row = $sth->fetchAll();
|
---|
[2] | 345 | echo "<select name=\"id_comune\">";
|
---|
[255] | 346 | foreach($row as $comuni)
|
---|
| 347 | {$id=$comuni[0];$descrizione=$comuni[1];
|
---|
[2] | 348 | $sel=($id == $id_comune) ? "selected":"";
|
---|
| 349 | echo "<option value=\"$id\" $sel>$descrizione";
|
---|
| 350 | }
|
---|
| 351 | }else{
|
---|
| 352 | echo "<input type=\"hidden\" name=\"id_comune\" value=\"$siteistat\">";
|
---|
| 353 | }
|
---|
| 354 | // echo "<input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\">";
|
---|
| 355 | if(strlen($lang)==2) echo "<input type=\"hidden\" name=\"language\" value=\"$lang\">";
|
---|
| 356 | echo "</td></tr><tr><td>";
|
---|
| 357 | echo "<input type=\"hidden\" name=\"id_ses\" value=\"$id_ses\">";
|
---|
| 358 | echo "<input type=\"submit\" VALUE=\""._OK."\">"
|
---|
| 359 | ."</td></tr></table>"
|
---|
| 360 | ."</form></div>";
|
---|
| 361 |
|
---|
| 362 | include ("footer.php");
|
---|
| 363 | }
|
---|
| 364 |
|
---|
| 365 | function logout()
|
---|
| 366 | {
|
---|
| 367 | /* $lang=$_SESSION['lang'];
|
---|
| 368 | $id_comune=$_SESSION['id_comune'];
|
---|
| 369 | // setcookie ("PHPSESSID", "", time() - 3600);
|
---|
| 370 | session_cache_expire (0);
|
---|
| 371 | $_SESSION=array(); //MODIFICHE PER GESTIONE SESSIONI
|
---|
| 372 | session_unset();
|
---|
| 373 | session_destroy();
|
---|
| 374 | Header("Location: admin.php?id_comune=$id_comune&language=$lang");
|
---|
| 375 | */
|
---|
| 376 | global $siteistat;
|
---|
| 377 |
|
---|
| 378 | $ref="Location: admin.php?";
|
---|
| 379 | if (isset($_SESSION['id_comune']))
|
---|
| 380 | $id_comune=$_SESSION['id_comune'];
|
---|
| 381 | else
|
---|
| 382 | $id_comune=$siteistat;
|
---|
| 383 | $ref=$ref."id_comune=".$id_comune;
|
---|
| 384 |
|
---|
| 385 | if (isset($_SESSION['lang']))
|
---|
| 386 | $ref=$ref."&language=".$_SESSION['lang'];
|
---|
| 387 |
|
---|
| 388 | $_SESSION=array();
|
---|
| 389 | session_unset();
|
---|
| 390 | session_destroy();
|
---|
[291] | 391 | session_cache_expire (0);
|
---|
[2] | 392 | Header($ref);
|
---|
| 393 |
|
---|
| 394 | }
|
---|
| 395 |
|
---|
[255] | 396 |
|
---|
| 397 | #echo "op:".$param['op']." -- aid:".$_SESSION['aid']."remote:".$_SESSION['remote']."REMOTE:".$_SERVER['REMOTE_ADDR'];
|
---|
[2] | 398 | if (isset($param['op'])) get_magic_quotes_gpc() ? $op=$param['op']:$op=addslashes($param['op']); else $op='ele';
|
---|
| 399 | //if (isset($param['op'])) $op=$param['op']; else $op='ele';
|
---|
| 400 | if (isset($_SESSION['aid']) AND $_SESSION['remote']==$_SERVER['REMOTE_ADDR']) {
|
---|
| 401 | switch($op) {
|
---|
| 402 | case "tipo":
|
---|
| 403 | include("modules/Elezioni/ele_tipi.php");
|
---|
| 404 | break;
|
---|
| 405 | case "constipi":
|
---|
| 406 | include("modules/Elezioni/ele_consultazionitipi.php");
|
---|
| 407 | break;
|
---|
| 408 | case "aggiorna":
|
---|
| 409 | include("modules/Elezioni/aggiorna.php");
|
---|
| 410 | break;
|
---|
| 411 | case "parziali":
|
---|
| 412 | include("modules/Elezioni/ele_parziali.php");
|
---|
| 413 | break;
|
---|
| 414 | case "ele":
|
---|
| 415 | include("modules/Elezioni/ele.php");
|
---|
| 416 | break;
|
---|
| 417 | case "consultazione":
|
---|
| 418 | include("modules/Elezioni/ele_consultazioni.php");
|
---|
| 419 | break;
|
---|
| 420 | case "configurazione":
|
---|
| 421 | include("modules/Elezioni/ele_configurazione.php");
|
---|
| 422 | break;
|
---|
| 423 | case "cons_comuni":
|
---|
| 424 | include("modules/Elezioni/ele_cons_comuni.php");
|
---|
| 425 | break;
|
---|
| 426 | case "confconsiglio":
|
---|
| 427 | include("modules/Elezioni/ele_confcons.php");
|
---|
| 428 | break;
|
---|
| 429 | case "inscomuni":
|
---|
| 430 | include("modules/Elezioni/ele_comuni.php");
|
---|
| 431 | break;
|
---|
| 432 | case "oper_admin":
|
---|
| 433 | include("modules/Elezioni/ele_operatori.php");
|
---|
| 434 | break;
|
---|
| 435 | case "inscollegi":
|
---|
| 436 | include("modules/Elezioni/ele_collegi.php");
|
---|
| 437 | break;
|
---|
| 438 | case "associazioni":
|
---|
| 439 | include("modules/Elezioni/ele_associazioni.php");
|
---|
| 440 | break;
|
---|
| 441 | case "operatori":
|
---|
| 442 | include("modules/Elezioni/ele_operatori.php");
|
---|
| 443 | break;
|
---|
| 444 | case "permessi":
|
---|
| 445 | include("modules/Elezioni/ele_permessi.php");
|
---|
| 446 | break;
|
---|
| 447 | case "circo":
|
---|
| 448 | include("modules/Elezioni/ele_circo.php");
|
---|
| 449 | break;
|
---|
| 450 | case "sede":
|
---|
| 451 | include("modules/Elezioni/ele_sede.php");
|
---|
| 452 | break;
|
---|
| 453 | case "sezione":
|
---|
| 454 | include("modules/Elezioni/ele_sezione.php");
|
---|
| 455 | break;
|
---|
| 456 | case "gruppo":
|
---|
| 457 | include("modules/Elezioni/ele_gruppo.php");
|
---|
| 458 | break;
|
---|
| 459 | case "rec_add_aff":
|
---|
| 460 | include("modules/Elezioni/ele_affluenze.php");
|
---|
| 461 | break;
|
---|
| 462 | case "rec_add_mod":
|
---|
| 463 | include("modules/Elezioni/ele_modelli.php");
|
---|
| 464 | break;
|
---|
| 465 | case "upgruppo":
|
---|
| 466 | include("modules/Elezioni/ele_gruppo.php");
|
---|
| 467 | break;
|
---|
| 468 | case "delimggruppo":
|
---|
| 469 | include("modules/Elezioni/ele_gruppo.php");
|
---|
| 470 | break;
|
---|
| 471 | case "lista":
|
---|
| 472 | include("modules/Elezioni/ele_lista.php");
|
---|
| 473 | break;
|
---|
| 474 | case "uplista":
|
---|
| 475 | include("modules/Elezioni/ele_lista.php");
|
---|
| 476 | break;
|
---|
| 477 | case "delimglista":
|
---|
| 478 | include("modules/Elezioni/ele_lista.php");
|
---|
| 479 | break;
|
---|
| 480 | case "candidato":
|
---|
| 481 | include("modules/Elezioni/ele_candidato.php");
|
---|
| 482 | break;
|
---|
| 483 | case "upcandidato":
|
---|
| 484 | include("modules/Elezioni/ele_candidato.php");
|
---|
| 485 | break;
|
---|
| 486 | case "delimgcandidato":
|
---|
| 487 | include("modules/Elezioni/ele_candidato.php");
|
---|
| 488 | break;
|
---|
| 489 |
|
---|
| 490 | case "voti":
|
---|
| 491 | include("modules/Elezioni/ele_voti.php");
|
---|
| 492 | break;
|
---|
| 493 | case "sezioni_voti":
|
---|
| 494 | include("modules/Elezioni/ele_voti.php");
|
---|
| 495 | break;
|
---|
| 496 | case "rec_voti":
|
---|
| 497 | include("modules/Elezioni/ele_voti.php");
|
---|
| 498 | break;
|
---|
| 499 | case "rec_voti_gruppi":
|
---|
| 500 | include("modules/Elezioni/ele_voti.php");
|
---|
| 501 | break;
|
---|
| 502 | case "rec_add_votanti":
|
---|
| 503 | include("modules/Elezioni/ele_voti.php");
|
---|
| 504 | break;
|
---|
| 505 | case "rec_finale":
|
---|
| 506 | include("modules/Elezioni/ele_voti.php");
|
---|
| 507 | break;
|
---|
| 508 | case "controllo_voti":
|
---|
| 509 | include("modules/Elezioni/controllo_voti.php");
|
---|
| 510 | break;
|
---|
| 511 | case "controllo_votanti":
|
---|
| 512 | include("modules/Elezioni/controllo_votanti.php");
|
---|
| 513 | break;
|
---|
| 514 | case "come":
|
---|
| 515 | include("modules/Elezioni/ele_come.php");
|
---|
| 516 | break;
|
---|
| 517 | case "numeri":
|
---|
| 518 | include("modules/Elezioni/ele_come.php");
|
---|
| 519 | break;
|
---|
| 520 | case "servizi":
|
---|
| 521 | include("modules/Elezioni/ele_come.php");
|
---|
| 522 | break;
|
---|
| 523 | case "link":
|
---|
| 524 | include("modules/Elezioni/ele_come.php");
|
---|
| 525 | break;
|
---|
| 526 | case "conf":
|
---|
| 527 | include("modules/Elezioni/ele_conf.php");
|
---|
| 528 | break;
|
---|
| 529 | case "stampa":
|
---|
| 530 | include("modules/Elezioni/ele_stampe.php");
|
---|
| 531 | break;
|
---|
| 532 | case "cambiopwd":
|
---|
| 533 | include("modules/Elezioni/ele_pwd.php");
|
---|
| 534 | break;
|
---|
| 535 | case "eletti":
|
---|
| 536 | include("modules/Elezioni/ele_eletti.php");
|
---|
| 537 | break;
|
---|
| 538 | case "foto":
|
---|
| 539 | include("modules/Elezioni/foto.php");
|
---|
| 540 | break;
|
---|
| 541 | case "consiglieri":
|
---|
| 542 | include("modules/Elezioni/ele_consiglieri.php");
|
---|
| 543 | break;
|
---|
| 544 | case "backup":
|
---|
| 545 | include("modules/Elezioni/backup.php");
|
---|
| 546 | break;
|
---|
| 547 | case "restore":
|
---|
| 548 | include("modules/Elezioni/restore.php");
|
---|
| 549 | break;
|
---|
| 550 | case "scarica":
|
---|
| 551 | include("modules/Elezioni/scarica.php");
|
---|
| 552 | break;
|
---|
| 553 | case "importa":
|
---|
| 554 | include("modules/Elezioni/importa.php");
|
---|
| 555 | break;
|
---|
[80] | 556 | case "widget":
|
---|
| 557 | include("modules/Elezioni/ele_widget.php");
|
---|
[2] | 558 | break;
|
---|
[139] | 559 | case "riepilogo":
|
---|
| 560 | include("modules/Elezioni/ele_riepilogo.php");
|
---|
| 561 | break;
|
---|
[254] | 562 | case "riepilogovoti":
|
---|
| 563 | include("modules/Elezioni/ele_riepilogovoti.php");
|
---|
| 564 | break;
|
---|
[2] | 565 | case "logout":
|
---|
| 566 | logout();
|
---|
| 567 | break;
|
---|
| 568 | }
|
---|
[258] | 569 |
|
---|
[2] | 570 | }else {
|
---|
| 571 |
|
---|
| 572 | login();
|
---|
| 573 |
|
---|
| 574 | }
|
---|
| 575 |
|
---|
| 576 | ?>
|
---|