Changeset 255 for trunk/admin/admin.php


Ignore:
Timestamp:
Mar 20, 2018, 11:19:10 PM (6 years ago)
Author:
roby
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/admin.php

    r254 r255  
    2121// Versione di php
    2222$phpver = phpversion();
    23 
     23global $dbi;
    2424// converte superglobal se php e' < 4.1.0
    2525
     
    115115//===================================================================
    116116session_name('sesadmin');
    117 session_start();//MODIFICHE PER GESTIONE SESSIONI
     117#session_start();//MODIFICHE PER GESTIONE SESSIONI
    118118  // gestione sessione
     119$a = session_id();
     120if(empty($a)) session_start();
     121#echo "SID: ".SID."<br>session_id(): ".session_id()."<br>COOKIE: ".$_COOKIE["PHPSESSID"];
    119122
    120123if (file_exists("config.php")){
     
    123126        $install="1";
    124127}
    125 
    126128
    127129# verifica se effettuata la configurazione
     
    151153        $sth = $dbi->prepare("select * from ".$prefix."_config");
    152154        $sth->execute();
    153        
    154         $row = $sth->fetch(PDO::FETCH_ASSOC);   
     155        $row = $sth->fetch(PDO::FETCH_ASSOC);
     156        #$row = $sth->fetchAll();       
    155157        $siteistat=$row['siteistat'];
    156158if (!isset($_SESSION['id_comune'])){
     
    168170        $_SESSION['blocco']=$row['blocco'];
    169171        $_SESSION['testata']=$row['testata'];
    170         $_SESSION['logo']=$row['logo'];
     172#       $_SESSION['logo']=$row['logo'];
    171173        $_SESSION['fileout']=$row['fileout'];
    172174        $_SESSION['copyright']=$row['copyright'];
     
    174176        $_SESSION['patch']=$row['patch'];
    175177        $_SESSION['id_comune']=$row['siteistat'];
    176         $_SESSION['multicomune']=$multicomune;
    177         $_SESSION['flash']=$flash;
    178         $_SESSION['displayerrors']=$displayerrors;
    179         $_SESSION['editor']=$editor;
    180         $_SESSION['tema_on']=$tema_on;
    181         $_SESSION['ed_user']=$ed_user;
     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'];
    182184}
    183185//fine
     
    214216                        $sth = $dbi->prepare("update ".$prefix."_authors set counter=$counter where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune'");
    215217                        $sth->execute();       
    216                         $row = $sth->fetch(PDO::FETCH_ASSOC);   
     218#                       $row = $sth->fetch(PDO::FETCH_ASSOC);   
    217219                       
    218220                        if ($esiste==1) {
    219                                 $_SESSION['dbi']=$dbi;
     221#                               $_SESSION['dbi']=$dbi;
    220222                                $_SESSION['aid']="$aid";
    221223                                $_SESSION['pwd']="$mpwd";
     
    231233        }
    232234}else{
    233 $_SESSION['dbi']=$dbi;
    234 
    235 }
     235#$_SESSION['dbi']=$dbi;
     236
     237} 
    236238if (! isset($_SESSION['lang'])) $_SESSION['lang']=$language;
    237239$currentlang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language;
     
    240242//lettura sessione
    241243$aid=$_SESSION['aid'];
    242 $dbi=$_SESSION['dbi'];
     244#$dbi=$_SESSION['dbi'];
    243245$prefix=$_SESSION['prefix'];
    244246$id_comune=$_SESSION['id_comune'];
     
    247249                        $sth = $dbi->prepare("select id_cons_gen  from ".$prefix."_ele_cons_comune where preferita='1' and (id_comune='$id_comune' or id_comune=0)");
    248250                        $sth->execute();       
    249                         $row = $sth->fetch(PDO::FETCH_ASSOC);   
    250 $id_cons_gen=$row[1];
     251                        $row = $sth->fetch(PDO::FETCH_BOTH);   
     252$id_cons_gen=$row[0];
    251253}
    252254$currentlang=$_SESSION['lang'];
     
    264266/*********************************************************/
    265267function ChiSei($id_cons_gen){
    266 
     268global $dbi;
    267269
    268270$aid=$_SESSION['aid'];
    269 $dbi=$_SESSION['dbi'];
     271#$dbi=$_SESSION['dbi'];
    270272$prefix=$_SESSION['prefix'];
    271273$pwd=$_SESSION['pwd'];
     
    334336        if($multicomune=='1'){
    335337                echo ""._COMUNE."</td><td>";
    336                 $sqlcomu="select id_comune,descrizione from ".$prefix."_ele_comuni order by descrizione asc";
    337                 $rescomu= mysql_query("$sqlcomu",$dbi);
    338        
     338                $row=elenco_comuni();
    339339                echo "<select name=\"id_comune\">";
    340                 while (list($id,$descrizione)=mysql_fetch_row($rescomu))
    341                 {
     340                foreach($row as $comuni)
     341                {$id=$comuni[0];$descrizione=$comuni[1];
    342342                        $sel=($id == $id_comune) ? "selected":"";
    343343                        echo "<option value=\"$id\" $sel>$descrizione";
     
    388388}
    389389
     390
     391#echo "op:".$param['op']." -- aid:".$_SESSION['aid']."remote:".$_SESSION['remote']."REMOTE:".$_SERVER['REMOTE_ADDR'];
    390392if (isset($param['op'])) get_magic_quotes_gpc() ? $op=$param['op']:$op=addslashes($param['op']); else $op='ele';
    391393//if (isset($param['op'])) $op=$param['op']; else $op='ele';
     
    565567}
    566568
    567 
    568569?>
Note: See TracChangeset for help on using the changeset viewer.