Changeset 361 for trunk/admin/admin.php
- Timestamp:
- Mar 17, 2022, 4:12:48 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/admin.php
r360 r361 17 17 #$LIMITE=3; //fascia di separazione del maggioritario (15.000 abitanti) 18 18 # tempo di sessione: ini_set('session.gc_maxlifetime','3600'); 19 global $multicomune,$msglogout,$language ;19 global $multicomune,$msglogout,$language,$id_sez; 20 20 21 21 // Adattamento variabili superglobal … … 301 301 $session=$_SESSION['remote']; 302 302 303 $perms=ChiSei($id_cons_gen); #die("qui".$_SESSION['aid']); 304 if($perms==0) {logout();} 305 } 303 } 304 306 305 307 306 … … 325 324 $adminsuper=$row[0]; 326 325 $admincomune=$row[1]; 327 $ adminop=$row[2];326 $oper=$row[2]; 328 327 329 328 #if (($adminsuper==1 || $admincomune==1 || $adminop==1)) { … … 333 332 return 64; 334 333 # $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='$id_comune'"); 335 336 $sth = $dbi->prepare("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'"); 334 elseif($oper) {$msglogout=1; return 0;} # id_cons='$id_cons' and 335 else { 336 $oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); 337 $sql="SELECT id_sez FROM ".$prefix."_ele_operatori where aid='$aid' and permessi>0 and id_cons in (select t1.id_cons from ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_consultazione as t2 where t1.id_cons_gen=t2.id_cons_gen and t1.id_comune='$id_comune' and t2.data_fine>$oggi)"; 338 $sth = $dbi->prepare("$sql"); 339 $sth->execute(); #die("TEST: $sql"); 340 if($sth->rowCount()) {$perms=16; return $perms;} 341 else {$msglogout=1; return 0;} 342 } 343 /* $sth = $dbi->prepare("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'"); 337 344 $sth->execute(); 338 345 $row = $sth->fetch(PDO::FETCH_BOTH); … … 340 347 $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'"); 341 348 342 $sth->execute(); 343 $row = $sth->fetch(PDO::FETCH_BOTH);344 if($row[0]==0) $msglogout=1;345 if ( $sth->rowCount()==1) $perms=$row[0]; else {$msglogout=1; $perms=0; }346 347 return $perms; 349 $sth->execute(); 350 list($perms)=$sth->fetch(PDO::FETCH_NUM); 351 # $row = die("test:$sql".$row[0] ); 352 if (!$perms) {die("qui: select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'"); $msglogout=1; $perms=0; } 353 354 return $perms; */ 348 355 #} else return 0; 349 356 } … … 379 386 elseif ($msglogout==2) echo "<h1 style=\"color:red;\">Nome Utente non presente in archivio</h1><br>"; 380 387 elseif ($msglogout==3) echo "<h1 style=\"color:red;\">Password Errata</h1><br>"; 388 elseif ($msglogout==4) echo "<h1 style=\"color:red;\">Accesso non ammesso da cellulare</h1><br>"; 381 389 echo "<form name=\"login\" data-ajax=\"false\" method=\"post\" action=\"admin.php\">" 382 390 ."<table class=\"table-menu\">" … … 471 479 $tema='Futura2'; #die( "TEST id_cons:$id_cons:".$_SESSION['aid']); 472 480 $_SESSION['tema']=$tema; 473 } else logout();481 } #else {die("TEST: $sql"); logout();} 474 482 } 475 483 } 476 } 477 484 $perms=ChiSei($id_cons_gen); #die("qui".$_SESSION['aid']); 485 if($perms==0) {logout();} 486 } 478 487 479 488 #echo "op:".$param['op']." -- aid:".$_SESSION['aid']."remote:".$_SESSION['remote']."REMOTE:".$_SERVER['REMOTE_ADDR'];
Note:
See TracChangeset
for help on using the changeset viewer.