Changeset 253 for trunk/install/install4.php
- Timestamp:
- Mar 12, 2018, 8:53:21 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/install/install4.php
r17 r253 25 25 $nomecomune = mosGetParam( $_POST, 'nomecomune', '' ) ; 26 26 $istat = mosGetParam( $_POST, 'istat', '' ) ; 27 $Capoluogo = mosGetParam( $_POST, 'Capoluogo', ' ' );27 $Capoluogo = mosGetParam( $_POST, 'Capoluogo', '0' ); 28 28 $Lingua = mosGetParam( $_POST, 'Lingua', '' ); 29 $Multicomune = mosGetParam( $_POST, 'Multicomune', ' ' );29 $Multicomune = mosGetParam( $_POST, 'Multicomune', '0' ); 30 30 $Replica = mosGetParam( $_POST, 'Replica', '' ); 31 31 … … 295 295 296 296 297 298 $database = new database( $DBhostname, $DBuserName, $DBpassword, $DBname ); 299 $nullDate = $database->getNullDate(); 297 $database = new PDO("mysql:host=$DBhostname;charset=latin1", $DBuserName, $DBpassword, array(PDO::ATTR_EMULATE_PREPARES => false, 298 PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION)); 299 $sql = "use $DBname"; 300 $database->exec($sql); 300 301 301 302 // create the admin user … … 303 304 //$query = "INSERT INTO {$configArray['DBPrefix']}_authors VALUES ('$adminName', '$adminName', '0', '$adminEmail', '$cryptpass','1','0','0','1','it')"; 304 305 $query = "UPDATE {$configArray['DBPrefix']}_authors SET aid='$adminName', name='$adminName', email='$adminEmail', pwd= '$cryptpass' WHERE aid='suser'"; 305 $database->setQuery( $query ); 306 $database->query(); 306 $database->exec( $query ); 307 307 308 308 // create Comune 309 try{ 310 $query = "INSERT INTO {$configArray['DBPrefix']}_ele_comuni VALUES ('$istat', '$nomecomune', '','','','','$Limite','$Capoluogo','','','0','')"; 311 $database->exec( $query ); 312 } catch(PDOException $e) {} 313 $query = "UPDATE {$configArray['DBPrefix']}_config SET sitename='$sitename', siteurl='$siteUrl', adminmail='$adminEmail', tema='$tema', foot='',language='$Lingua',blocco='$blocco',fileout='$Replica',Versione='3', siteistat='$istat',multicomune='$Multicomune',flash='$flash', tema_on='$sceltatema' WHERE sitename=''"; 309 314 310 $query = "INSERT INTO {$configArray['DBPrefix']}_ele_comuni VALUES ('$istat', '$nomecomune', '','','','','$Limite','$Capoluogo','','','')"; 311 312 $database->setQuery( $query ); 313 $database->query(); 314 315 $query = "UPDATE {$configArray['DBPrefix']}_config SET sitename='$sitename', siteurl='$siteUrl', adminmail='$adminEmail', tema='$tema', foot='',language='$Lingua',blocco='$blocco',fileout='$Replica',Versione='2.0 beta', siteistat='$istat',multicomune='$Multicomune',flash='$flash', tema_on='$sceltatema' WHERE sitename=''"; 316 317 318 $database->setQuery( $query ); 319 $database->query(); 315 $database->exec( $query ); 320 316 321 317 322 318 // touch config table 323 319 $date = date("F Y"); 324 $query = "UPDATE {$configArray['DBPrefix']}_config SET sitename='$sitename', nukeurl='$siteUrl', startdate='$date', adminmail='$adminEmail', backend_title='$sitename', notify_email='$adminEmail'"; 325 $database->setQuery( $query ); 326 $database->query(); 320 $query = "UPDATE {$configArray['DBPrefix']}_config SET sitename='$sitename', siteurl='$siteUrl', startdate='$date', adminmail='$adminEmail'"; 321 $database->exec( $query ); 327 322 328 323 } else { … … 407 402 da quella di amministrazione (admin)<br/> 408 403 od anche l'utenza del database pubblico in sola lettura<br/> 409 e altri accorgimenti che riterrai necessari e<br/>404 e altri accorgimenti che riterrai necessari<br/> 410 405 411 406
Note:
See TracChangeset
for help on using the changeset viewer.