Changeset 376 for trunk/install
- Timestamp:
- Sep 24, 2022, 1:11:18 PM (2 years ago)
- Location:
- trunk/install
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/install/install1.php
r2 r376 14 14 $DBpassword = mosGetParam( $_POST, 'DBpassword', 'password' ); 15 15 $DBname = mosGetParam( $_POST, 'DBname', 'eleonline' ); 16 $ELEuserName = mosGetParam( $_POST, 'ELEuserName', 'eleutente' ); 17 $ELEpassword = mosGetParam( $_POST, 'ELEpassword', 'elepassword' ); 16 18 $DBPrefix = mosGetParam( $_POST, 'DBPrefix', 'soraldo' ); 17 19 … … 41 43 alert('Inserisci un nome per il tuo nuovo Database'); 42 44 f.DBname.focus(); 45 formValid=false; 46 } else if ( f.ELEuserName.value == '' ) { 47 alert('Inserisci il nome del nuovo utente che gestirà il Database'); 48 f.DBuserName.focus(); 43 49 formValid=false; 44 50 } else if ( f.DBPrefix.value == '' ) { … … 124 130 </td> 125 131 <td> 126 <em>Nome dell'account con permessi per creare il database </em>132 <em>Nome dell'account con permessi per creare il database e GRANT</em> 127 133 </td> 128 134 </tr> … … 134 140 </td> 135 141 <td> 136 <em>Password perl'account mysql:</em>142 <em>Password dell'account mysql:</em> 137 143 </td> 138 144 </tr> … … 144 150 </td> 145 151 <td> 146 <em>Nome del database di Eleonline.</em> 147 </td> 148 </tr> 152 <em>Nome del database di Eleonline da creare.</em> 153 </td> 154 </tr> 155 <tr> 156 <td colspan="2"> 157 MySQL Nuovo utente 158 <br/> 159 <input class="inputbox" type="text" name="ELEuserName" value="<?php echo "$ELEuserName"; ?>" /> 160 </td> 161 <td> 162 <em>Nome dell'account che gestirà il database di eleonline</em> 163 </td> 164 </tr> 165 <tr> 166 <td colspan="2"> 167 MySQL Password 168 <br/> 169 <input class="inputbox" type="text" name="ELEpassword" value="<?php echo "$ELEpassword"; ?>" /> 170 </td> 171 <td> 172 <em>Password per il nuovo account mysql:</em> 173 </td> 174 </tr> 149 175 <!-- 150 176 <tr> -
trunk/install/install2.php
r364 r376 17 17 $DBuserName = mosGetParam( $_POST, 'DBuserName', '' ); 18 18 $DBpassword = mosGetParam( $_POST, 'DBpassword', '' ); 19 $ELEuserName = mosGetParam( $_POST, 'ELEuserName', '' ); 20 $ELEpassword = mosGetParam( $_POST, 'ELEpassword', '' ); 19 21 $DBname = mosGetParam( $_POST, 'DBname', '' ); 20 22 $DBPrefix = mosGetParam( $_POST, 'DBPrefix', 'soraldo' ); … … 49 51 db_err ("stepBack3","The database details provided are incorrect and/or empty."); 50 52 } 51 53 $dsn = "mysql:host=$DBhostname"; #dbname=$DBname"; 54 $opt = [ 55 PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, 56 PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, 57 PDO::ATTR_EMULATE_PREPARES => false, 58 ]; 59 $user=$DBuserName; 60 $password=$DBpassword; 52 61 53 62 if($DBPrefix == '') { 54 63 db_err ('stepBack','Non avete indicato il prefisso tabelle database.'); 55 64 } 65 try { 66 $database = new PDO($dsn, $user, $password, $opt); 67 } 68 catch(PDOException $e) 69 { 70 echo $sql . "<br>" . $e->getMessage();die(); 71 } 72 #sostituire questa riga con le variabili per il nuovo utente e la sua password da inserire nella pagina precedente 73 ######################################## 74 # $DBuserName='eleuser'; $DBpassword='elepass'; 56 75 try{ 57 $database = new PDO("mysql:host=$DBhostname;charset=latin1", $DBuserName, $DBpassword, array(PDO::ATTR_EMULATE_PREPARES => false, 58 PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION)); 59 $sql = "CREATE DATABASE IF NOT EXISTS $DBname; 60 CREATE USER `$DBuserName`@'$DBhostname' IDENTIFIED BY '$DBpassword'; 61 GRANT ALL ON `$DBname`.* TO `$DBuserName`@'$DBhostname'; 62 FLUSH PRIVILEGES;"; 76 $sql = "CREATE DATABASE IF NOT EXISTS $DBname;"; 77 $database->exec($sql); 78 } 79 catch(PDOException $e) 80 { 81 echo $sql . "<br>" . $e->getMessage();die(); 82 } 83 try { 84 $sql="CREATE USER if not exists `$ELEuserName`@'$DBhostname' IDENTIFIED BY '$ELEpassword';"; 85 $database->exec($sql); 86 # $sql= "GRANT ALL ON `$DBname`.* TO `roby`@'$DBhostname';"; 87 # $database->exec($sql); 88 $sql= "GRANT ALL ON `$DBname`.* TO `$ELEuserName`@'$DBhostname';"; 89 $database->exec($sql); 90 $sql= "FLUSH PRIVILEGES;"; 63 91 $database->exec($sql); 64 92 $sql = "use $DBname"; -
trunk/install/install3.php
r253 r376 38 38 $configArray['siteUrl'] = trim( mosGetParam( $_POST, 'siteUrl', '' ) ); 39 39 $configArray['absolutePath'] = trim( mosGetParam( $_POST, 'absolutePath', '' ) ); 40 if (get_magic_quotes_gpc()) {41 $configArray['absolutePath'] = stripslashes(stripslashes($configArray['absolutePath']));42 $sitename = stripslashes(stripslashes($sitename));43 }40 #if (get_magic_quotes_gpc()) { 41 # $configArray['absolutePath'] = stripslashes(stripslashes($configArray['absolutePath'])); 42 # $sitename = stripslashes(stripslashes($sitename)); 43 #} 44 44 45 45 … … 185 185 $url = $configArray['siteUrl']; 186 186 else { 187 $port = ( $_SERVER['SERVER_PORT'] == 80 ) ? '' : ":".$_SERVER['SERVER_PORT']; 188 $root = $_SERVER['SERVER_NAME'].$port.$_SERVER['PHP_SELF']; 187 # $port = ( $_SERVER['SERVER_PORT'] == 80 ) ? '' : ":".$_SERVER['SERVER_PORT']; 188 $port = ( $_SERVER['SERVER_PORT'] == 80 ) ? 'http://' : "https://"; 189 # $root = $_SERVER['SERVER_NAME'].$port.$_SERVER['PHP_SELF']; 190 $root = $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; 189 191 $root = str_replace("install/","",$root); 190 192 $root = str_replace("/install3.php","",$root); 191 $url = "http://".$root."/client"; 193 # $url = "http://".$root."/client"; 194 $url = $port.$root."/client"; 192 195 } 193 196 ?> -
trunk/install/install4.php
r253 r376 137 137 138 138 if ($sitename) { 139 if (!get_magic_quotes_gpc()) {139 # if (!get_magic_quotes_gpc()) { 140 140 $configArray['sitename'] = addslashes($sitename); 141 } else {142 $configArray['sitename'] = $sitename;143 }141 # } else { 142 # $configArray['sitename'] = $sitename; 143 # } 144 144 } else { 145 145 echo "<form name=\"stepBack\" method=\"post\" action=\"install3.php\"> … … 310 310 $query = "INSERT INTO {$configArray['DBPrefix']}_ele_comuni VALUES ('$istat', '$nomecomune', '','','','','$Limite','$Capoluogo','','','0','')"; 311 311 $database->exec( $query ); 312 } catch(PDOException $e) { }312 } catch(PDOException $e) { die("$query");} 313 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=''"; 314 314
Note:
See TracChangeset
for help on using the changeset viewer.