source: trunk/install/install3.php@ 422

Last change on this file since 422 was 376, checked in by roby, 2 years ago

Admin:

  • modificata la funzione aggiornadb per gestire il caso di cambiamento del nome del superutente e tolto il default per tipi campo text
  • modificata la funzione dei controlli per gestire il tipo consultazione Regionali in Sicilia

Install:

  • modificata la funzione di installazione per compatibilità con php 8.0

Client:

  • cambiata l'immagine "vuoto.jpg" nel formato png per gestire la trasparenza
  • modificate le funzioni affluenze e votanti per correggere l'esportazione in pdf e le stampe
  • per il tema Futura2 eliminato il taglio della descrizione della consultazione
File size: 8.3 KB
RevLine 
[2]1<?php
2
3/************************************************************************/
4/* Eleonline */
5/* ============================================ */
6/* Installer was based on Joomla Installer */
7/************************************************************************/
8
9
10/** Include common.php */
11require_once( 'common.php' );
12
13$DBhostname = mosGetParam( $_POST, 'DBhostname', '' );
14$DBuserName = mosGetParam( $_POST, 'DBuserName', '' );
15$DBpassword = mosGetParam( $_POST, 'DBpassword', '' );
16$DBname = mosGetParam( $_POST, 'DBname', '' );
17$DBPrefix = mosGetParam( $_POST, 'DBPrefix', 'soraldo' );
18$sitename = mosGetParam( $_POST, 'sitename', '' ) ;
19$nomecomune = mosGetParam( $_POST, 'nomecomune', '' ) ;
20$istat = mosGetParam( $_POST, 'istat', '' ) ;
[253]21$Capoluogo = mosGetParam( $_POST, 'Capoluogo', '0' );
[2]22$Lingua = mosGetParam( $_POST, 'Lingua', '' );
[253]23$Multicomune = mosGetParam( $_POST, 'Multicomune', '0' );
[2]24$Replica = mosGetParam( $_POST, 'Replica', '' );
25
26//tema
27$tema = mosGetParam( $_POST, 'tema', '' );
28$sceltatema = mosGetParam( $_POST, 'sceltatema', '' );
29$blocco = mosGetParam( $_POST, 'blocco', '' );
30$flash = mosGetParam( $_POST, 'flash', '' );
31// d'hondt
32
33$Limite = mosGetParam( $_POST, 'Limite', '' );
34
35$adminName = mosGetParam( $_POST, 'adminName', '');
36$adminEmail = mosGetParam( $_POST, 'adminEmail', '');
37$CreateUSer = intval( mosGetParam( $_POST, 'CreateUSer', 1 ) );
38$configArray['siteUrl'] = trim( mosGetParam( $_POST, 'siteUrl', '' ) );
39$configArray['absolutePath'] = trim( mosGetParam( $_POST, 'absolutePath', '' ) );
[376]40#if (get_magic_quotes_gpc()) {
41# $configArray['absolutePath'] = stripslashes(stripslashes($configArray['absolutePath']));
42# $sitename = stripslashes(stripslashes($sitename));
43#}
[2]44
45
46
47
48
49if ($sitename == '') {
50 echo "<form name=\"stepBack\" method=\"post\" action=\"install2.php\">
51 <input type=\"hidden\" name=\"DBhostname\" value=\"$DBhostname\">
52 <input type=\"hidden\" name=\"DBuserName\" value=\"$DBuserName\">
53 <input type=\"hidden\" name=\"DBpassword\" value=\"$DBpassword\">
54 <input type=\"hidden\" name=\"DBname\" value=\"$DBname\">
55 <input type=\"hidden\" name=\"DBPrefix\" value=\"$DBPrefix\">
56 <input type=\"hidden\" name=\"DBcreated\" value=1>
57
58 </form>";
59
60 echo "<script>alert('Il nome del sito non e' stato inserito'); document.stepBack.submit();</script>";
61 return;
62}
63
64echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">";
65?>
66<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
67<html xmlns="http://www.w3.org/1999/xhtml">
68<head>
69<title>PHP-Nuke Installer</title>
70<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
71<link rel="stylesheet" href="install.css" type="text/css" />
72<script type="text/javascript">
73<!--
74function check() {
75 // form validation check
76 var formValid = true;
77 var f = document.form;
78 if ( f.adminName.value == '' ) {
79 alert('Prego inserisci un nome per il tuo amministratore');
80 f.siteUrl.focus();
81 formValid = false;
82 } else if ( f.siteUrl.value == '' ) {
83 alert('Prego inserisci un URL corretto per il tuo sito');
84 f.siteUrl.focus();
85 formValid = false;
86 } else if ( f.absolutePath.value == '' ) {
87 alert('Prego inserisci la path assoluta del tuo sito');
88 f.absolutePath.focus();
89 formValid = false;
90 } else if ( f.adminEmail.value == '' ) {
91 alert('Prego inserisci un indirizzo email per contattare il tuo amministratore');
92 f.adminEmail.focus();
93 formValid = false;
94 } else if ( f.adminPassword.value == '' ) {
95 alert('Prego inserisci una password per il tuo amministratore');
96 f.adminPassword.focus();
97 formValid = false;
98 }
99
100 return formValid;
101}
102
103//-->
104</script>
105</head>
106<body onload="document.form.siteUrl.focus();">
107<div id="wrapper">
108 <div id="header">
109 <div id="eleonline"><img src="header_install.png" alt="Installazione Eleonline" title="Installazione Eleonline" /></div>
110 </div>
111</div>
112
113<div id="ctr" align="center">
114 <form action="install4.php" method="post" name="form" id="form" onsubmit="return check();">
115 <input type="hidden" name="DBhostname" value="<?php echo "$DBhostname"; ?>" />
116 <input type="hidden" name="DBuserName" value="<?php echo "$DBuserName"; ?>" />
117 <input type="hidden" name="DBpassword" value="<?php echo "$DBpassword"; ?>" />
118 <input type="hidden" name="DBname" value="<?php echo "$DBname"; ?>" />
119 <input type="hidden" name="DBPrefix" value="<?php echo "$DBPrefix"; ?>" />
120
121 <input type="hidden" name="sitename" value="<?php echo "$sitename"; ?>" />
122 <input type="hidden" name="nomecomune" value="<?php echo "$nomecomune"; ?>" />
123 <input type="hidden" name="istat" value="<?php echo "$istat"; ?>" />
124 <input type="hidden" name="Capoluogo" value="<?php echo "$Capoluogo"; ?>" />
125 <input type="hidden" name="Lingua" value="<?php echo "$Lingua"; ?>" />
126 <input type="hidden" name="Multicomune" value="<?php echo "$Multicomune"; ?>" />
127 <input type="hidden" name="Replica" value="<?php echo "$Replica"; ?>" />
128
129 <input type="hidden" name="tema" value="<?php echo "$tema"; ?>" />
130 <input type="hidden" name="sceltatema" value="<?php echo "$sceltatema"; ?>" />
131 <input type="hidden" name="blocco" value="<?php echo "$blocco"; ?>" />
132 <input type="hidden" name="flash" value="<?php echo "$flash"; ?>" />
133
134
135 <input type="hidden" name="Limite" value="<?php echo "$Limite"; ?>" />
136
137
138
139 <div class="install">
140 <div id="stepbar">
141 <div class="step-off">inizio</div>
142 <div class="step-off">licenza</div>
143 <div class="step-off">passo 1</div>
144 <div class="step-off">passo 2</div>
145 <div class="step-on">passo 3</div>
146 <div class="step-off">passo 4</div>
147 </div>
148 <div id="right">
149 <div id="step">passo 3</div>
150 <div class="far-right">
151 <input class="button" type="submit" name="next" value="Avanti >>"/>
152 </div>
153 <div class="clr"></div>
154 <h1>Creazione Amministratore Super User</h1>
155 <div class="install-text">
156
157 <p>Il Super User o Admin ID di default e' <b>suser</b> Puoi cambiarlo da questo form<br /><br />
158 Inserisci il tuo indirizzo email, che sara' l'indirizzo email dell'amministratore del sito.<br /><br />
159 Inserisci la tua password (il sistema genera una password casuale).
160 </p>
161 </div>
162 <div class="install-form">
163 <div class="form-block">
164 <table class="content2">
165 <tr>
166 <td nowarp>Admin ID:</td>
167 <td align="center"><input class="inputbox" type="text" name="adminName" value="<?php echo "$adminName"; ?>" size="40" /></td>
168<?php
169 $abspath = "";
170 if ($configArray['absolutePath'])
171 $abspath = $configArray['absolutePath'];
172 else {
173 $path = getcwd();
174 if (preg_match("/\/install/i", "$path"))
175 $abspath = str_replace('/install',"",$path);
176 else
177 $abspath = str_replace('\install',"",$path);
178 }
179?>
180 <input type="hidden" name="absolutePath" value="<?php echo $abspath; ?>" /></td>
181 </tr>
182<?php
183 $url = "";
184 if ($configArray['siteUrl'])
185 $url = $configArray['siteUrl'];
186 else {
[376]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'];
[2]191 $root = str_replace("install/","",$root);
192 $root = str_replace("/install3.php","",$root);
[376]193# $url = "http://".$root."/client";
194 $url = $port.$root."/client";
[2]195 }
196?>
197 <tr>
198 <td nowarp>URL del sito:</td>
199 <td align="center"><input class="inputbox" type="text" name="siteUrl" value="<?php echo $url; ?>" size="40" /></td>
200 </tr>
201 <tr>
202 <td nowarp>Tua E-mail:</td>
203 <td align="center"><input class="inputbox" type="text" name="adminEmail" value="<?php echo "$adminEmail"; ?>" size="40" /></td>
204 </tr>
205 <tr>
206 <td nowarp>Admin password:</td>
207 <td align="center"><input class="inputbox" type="text" name="adminPassword" value="<?php echo mosMakePassword(8); ?>" size="40"/>
208 </td>
209 </tr>
210
211
212
213 </table>
214 <p></p>
215 </div>
216 </div>
217 <div id="break"></div>
218 </div>
219 <div class="clr"></div>
220 </div>
221 </form>
222</div>
223<div class="clr"></div>
224<?php include("footer.php"); ?>
225</body>
[253]226</html>
Note: See TracBrowser for help on using the repository browser.