Changeset 424 for trunk/admin/admin.php
- Timestamp:
- Jun 13, 2024, 7:18:22 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/admin.php
r416 r424 39 39 $_COOKIE = $HTTP_COOKIE_VARS; 40 40 } 41 if(isset($HTTP_SESSION_VARS)) { 42 $_SESSION = $HTTP_SESSION_VARS; 43 } 41 44 42 } 45 43 … … 120 118 #session_start();//MODIFICHE PER GESTIONE SESSIONI 121 119 // gestione sessione 120 if (!isset($_SESSION)) 121 { 122 session_start(); 123 }else session_regenerate_id(); 122 124 $a = session_id(); 123 125 if(empty($a)) session_start(); 124 126 #echo "SID: ".SID."<br>session_id(): ".session_id()."<br>COOKIE: ".$_COOKIE["PHPSESSID"]; 127 125 128 126 129 if (file_exists("config.php")){ … … 134 137 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>"); 135 138 } 136 139 require_once('variabili.php'); 137 140 $dsn = "mysql:host=$dbhost"; 138 141 $opt = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_EMULATE_PREPARES => false); … … 266 269 $_SESSION['bgcolor2']='#c5c5c5'; 267 270 if (!isset($op)) $op='consultazione'; 268 session_regenerate_id();269 271 } 270 272 } … … 326 328 } 327 329 if(!isset($_SESSION['BASE'])) $_SESSION['BASE']=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 328 if(!isset($language) ) $language=$_SESSION['lang'];330 if(!isset($language) and isset($_SESSION['lang'])) $language=$_SESSION['lang']; else $language='it'; 329 331 if (! isset($_SESSION['lang'])) $_SESSION['lang']=$language; 330 332 $currentlang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language; … … 341 343 else { 342 344 # $oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); 343 $sql="select t1.id_cons_gen from ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune=$id_comune and date_add(t1.data_fine, interval 3 day)>CURDATE() and t2.id_cons in (select id_cons from ".$prefix."_ele_operatori where aid='$aid' and permessi>0) limit 0,1";# TEST: and id_sez>0345 $sql="select t1.id_cons_gen from ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune=$id_comune and date_add(t1.data_fine, interval $giorniaut day)>CURDATE() and t2.id_cons in (select id_cons from ".$prefix."_ele_operatori where aid='$aid' and permessi>0) limit 0,1";# TEST: and id_sez>0 344 346 $rese = $dbi->prepare("$sql"); 345 347 $rese->execute(); … … 371 373 /*********************************************************/ 372 374 function ChiSei($idcg){ 373 global $dbi, $msglogout, $id_cons_gen ;375 global $dbi, $msglogout, $id_cons_gen,$giorniaut; 374 376 375 377 $aid=$_SESSION['aid']; … … 383 385 $sth->execute(); 384 386 $row = $sth->fetch(PDO::FETCH_BOTH); 385 387 if($row){ 386 388 $adminsuper=$row[0]; 387 389 $admincomune=$row[1]; 388 $oper=$row[2]; 390 $oper=$row[2]; 391 }else{ 392 $adminsuper=0; 393 $admincomune=0; 394 $oper=1; 395 } 389 396 if ($adminsuper==1) 390 397 return 256; … … 395 402 else { 396 403 # $oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); 397 $sql="select t1.id_cons, t1.id_cons_gen from ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_consultazione as t2 where t1.id_cons_gen=t2.id_cons_gen and t1.chiusa='0' and t1.id_comune='$id_comune' and date_add(t2.data_fine, interval 3day)>CURDATE()";404 $sql="select t1.id_cons, t1.id_cons_gen from ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_consultazione as t2 where t1.id_cons_gen=t2.id_cons_gen and t1.chiusa='0' and t1.id_comune='$id_comune' and date_add(t2.data_fine, interval $giorniaut day)>CURDATE()"; 398 405 $sth = $dbi->prepare("$sql"); 399 406 $sth->execute(); … … 486 493 487 494 global $siteistat,$perms,$msglogout; 495 if (!isset($_SESSION)) 496 { 497 session_start(); 498 } 488 499 $language=$_SESSION['lang']; 489 500 $ref="Location: admin.php?"; … … 498 509 $ref=$ref."&language=$language"; 499 510 $ref.="&msglogout=$msglogout"; 500 $_SESSION=array(); 501 session_unset();502 session_destroy();511 #$_SESSION=array(); 512 if (session_status() == PHP_SESSION_ACTIVE) 513 session_destroy(); 503 514 session_cache_expire (0); 504 515 Header($ref); … … 508 519 #include("modules/Elezioni/language/lang-".$_SESSION['lang'].".php"); 509 520 #die( "$sql <br> TEST id_cons_gen:$id_cons_gen:".$_SESSION['id_cons_gen']); 510 if(isset($id_cons_gen) and isset($id_comune)){ 521 if(isset($id_cons_gen) and isset($id_comune)){ 511 522 if(!isset($id_cons)){ 512 523 # $sql = "SELECT t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'"; … … 520 531 } 521 532 if(isset($id_cons)) { 522 $sql="SELECT id_sez FROM ".$prefix."_ele_operatori where id_sez>0 and aid='$aid' and id_comune=$id_comune ";533 $sql="SELECT id_sez FROM ".$prefix."_ele_operatori where id_sez>0 and aid='$aid' and id_comune=$id_comune and id_cons=$id_cons"; 523 534 try { 524 535 $resmod = $dbi->prepare("$sql"); … … 544 555 } 545 556 } 546 $perms=ChiSei($id_cons_gen); 557 $perms=ChiSei($id_cons_gen); 547 558 if($perms==0) {logout();} 548 559 } … … 723 734 include("modules/Elezioni/ele_riepilogovoti.php"); 724 735 break; 736 case "aggcons": 737 include("modules/Elezioni/ele_restorebackup.php"); 738 break; 725 739 case "logout": 726 740 logout();
Note:
See TracChangeset
for help on using the changeset viewer.