Skip to content
Newer
Older
100644 517 lines (453 sloc) 15.6 KB
5cfb881 @Chris--S installation script
Chris--S authored
1 <?php
2 /**
3 * Dokuwiki installation assistance
4 *
5 * @author Chris Smith <chris@jalakai.co.uk>
6 */
7
d0a27cb @splitbrain don't use fullpath() before initialized
authored
8 if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/');
5cfb881 @Chris--S installation script
Chris--S authored
9 if(!defined('DOKU_CONF')) define('DOKU_CONF',DOKU_INC.'conf/');
10 if(!defined('DOKU_LOCAL')) define('DOKU_LOCAL',DOKU_INC.'conf/');
11
3545b2e @Chris--S add error_reporting sanity
Chris--S authored
12 // check for error reporting override or set error reporting to sane values
13 if (!defined('DOKU_E_LEVEL')) { error_reporting(E_ALL ^ E_NOTICE); }
14 else { error_reporting(DOKU_E_LEVEL); }
15
4724831 @splitbrain installer updates
authored
16 // kill magic quotes
17 if (get_magic_quotes_gpc() && !defined('MAGIC_QUOTES_STRIPPED')) {
18 if (!empty($_GET)) remove_magic_quotes($_GET);
19 if (!empty($_POST)) remove_magic_quotes($_POST);
20 if (!empty($_COOKIE)) remove_magic_quotes($_COOKIE);
21 if (!empty($_REQUEST)) remove_magic_quotes($_REQUEST);
22 @ini_set('magic_quotes_gpc', 0);
23 define('MAGIC_QUOTES_STRIPPED',1);
24 }
25 @set_magic_quotes_runtime(0);
26 @ini_set('magic_quotes_sybase',0);
5cfb881 @Chris--S installation script
Chris--S authored
27
28 // language strings
4724831 @splitbrain installer updates
authored
29 require_once(DOKU_INC.'inc/lang/en/lang.php');
30 $LC = preg_replace('/[^a-z\-]+/','',$_REQUEST['l']);
31 if(!$LC) $LC = 'en';
32 if($LC && $LC != 'en' ) {
33 require_once(DOKU_INC.'inc/lang/'.$LC.'/lang.php');
34 }
5cfb881 @Chris--S installation script
Chris--S authored
35
36 // initialise variables ...
37 $error = array();
38
4724831 @splitbrain installer updates
authored
39 $dokuwiki_hash = array(
e784f39 @splitbrain release candidate preparations
authored
40 '2005-09-22' => 'e33223e957b0b0a130d0520db08f8fb7',
41 '2006-03-05' => '51295727f79ab9af309a2fd9e0b61acc',
42 '2006-03-09' => '51295727f79ab9af309a2fd9e0b61acc',
4dde32d @splitbrain release preparations
authored
43 '2006-11-06' => 'b3a8af76845977c2000d85d6990dd72b',
e7f137b @splitbrain release preparations
authored
44 '2007-05-24' => 'd80f2740c84c4a6a791fd3c7a353536f',
83666c1 @splitbrain final release preps
authored
45 '2007-06-26' => 'b3ca19c7a654823144119980be73cd77',
dd6510b @splitbrain release preparations
authored
46 '2008-05-04' => '1e5c42eac3219d9e21927c39e3240aad',
4724831 @splitbrain installer updates
authored
47 );
5cfb881 @Chris--S installation script
Chris--S authored
48
49
50
4724831 @splitbrain installer updates
authored
51 // begin output
52 header('Content-Type: text/html; charset=utf-8');
53 ?>
54 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
55 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
56 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $LC?>"
57 lang="<?php echo $LC?>" dir="<?php echo $lang['direction']?>">
58 <head>
59 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4208c14 @splitbrain use translation for pag title in install.php
authored
60 <title><?php echo $lang['i_installer']?></title>
4724831 @splitbrain installer updates
authored
61 <style type="text/css">
62 body { width: 90%; margin: 0 auto; font: 84% Verdana, Helvetica, Arial, sans-serif; }
63 img { border: none }
64 br.cl { clear:both; }
70a6aa1 @Chris--S install.php updates
Chris--S authored
65 code { font-size: 110%; color: #800000; }
4724831 @splitbrain installer updates
authored
66 fieldset { border: none }
9c70688 @Chris--S installer - fix policy 1 + two appearance changes
Chris--S authored
67 label { display: block; margin-top: 0.5em; }
8af2e4b @splitbrain default policy for installer
authored
68 select.text, input.text { width: 30em; margin: 0 0.5em; }
4724831 @splitbrain installer updates
authored
69 </style>
70 <script type="text/javascript" language="javascript">
71 function acltoggle(){
72 var cb = document.getElementById('acl');
73 var fs = document.getElementById('acldep');
74 if(!cb || !fs) return;
75 if(cb.checked){
76 fs.style.display = '';
77 }else{
78 fs.style.display = 'none';
79 }
80 }
81 window.onload = function(){
82 acltoggle();
83 var cb = document.getElementById('acl');
84 if(cb) cb.onchange = acltoggle;
85 };
86 </script>
87 </head>
88 <body style="">
89 <h1 style="float:left">
f46c9e8 @selfthinker fixed all remaining links to wiki.splitbrain.org and to restructured …
selfthinker authored
90 <img src="http://dokuwiki.org/_media/wiki:dokuwiki-64.png"
4724831 @splitbrain installer updates
authored
91 style="vertical-align: middle;" alt="" />
92 <?php echo $lang['i_installer']?>
93 </h1>
94 <div style="float:right; margin: 1em;">
95 <?php langsel()?>
96 </div>
97 <br class="cl" />
98
99 <div style="float: right; width: 34%;">
100 <?php
101 if(@file_exists(DOKU_INC.'inc/lang/'.$LC.'/install.html')){
102 include(DOKU_INC.'inc/lang/'.$LC.'/install.html');
103 }else{
ca64d72 @Chris--S i18n update
Chris--S authored
104 print "<div lang=\"en\" dir=\"ltr\">\n";
4724831 @splitbrain installer updates
authored
105 include(DOKU_INC.'inc/lang/en/install.html');
ca64d72 @Chris--S i18n update
Chris--S authored
106 print "</div>\n";
4724831 @splitbrain installer updates
authored
107 }
108 ?>
109 </div>
110
111 <div style="float: left; width: 58%;">
112 <?php
113 if(! (check_functions() && check_permissions()) ){
114 echo '<p>'.$lang['i_problems'].'</p>';
115 print_errors();
70a6aa1 @Chris--S install.php updates
Chris--S authored
116 print_retry();
4724831 @splitbrain installer updates
authored
117 }elseif(!check_configs()){
118 echo '<p>'.$lang['i_modified'].'</p>';
119 print_errors();
120 }elseif($_REQUEST['submit']){
121 if(!check_data($_REQUEST['d'])){
122 print_errors();
123 print_form($_REQUEST['d']);
124 }elseif(!store_data($_REQUEST['d'])){
125 echo '<p>'.$lang['i_failure'].'</p>';
126 print_errors();
127 }else{
128 echo '<p>'.$lang['i_success'].'</p>';
129 }
130 }else{
131 print_form($_REQUEST['d']);
132 }
133 ?>
134 </div>
135
136 <div style="clear: both">
f46c9e8 @selfthinker fixed all remaining links to wiki.splitbrain.org and to restructured …
selfthinker authored
137 <a href="http://dokuwiki.org/"><img src="lib/tpl/default/images/button-dw.png" alt="driven by DokuWiki" /></a>
4724831 @splitbrain installer updates
authored
138 <a href="http://www.php.net"><img src="lib/tpl/default/images/button-php.gif" alt="powered by PHP" /></a>
139 </div>
140 </body>
141 </html>
142 <?php
5cfb881 @Chris--S installation script
Chris--S authored
143
144 /**
4724831 @splitbrain installer updates
authored
145 * Print the input form
5cfb881 @Chris--S installation script
Chris--S authored
146 */
4724831 @splitbrain installer updates
authored
147 function print_form($d){
148 global $lang;
149 global $LC;
5cfb881 @Chris--S installation script
Chris--S authored
150
4724831 @splitbrain installer updates
authored
151 if(!is_array($d)) $d = array();
152 $d = array_map('htmlspecialchars',$d);
5cfb881 @Chris--S installation script
Chris--S authored
153
4724831 @splitbrain installer updates
authored
154 if(!isset($d['acl'])) $d['acl']=1;
5cfb881 @Chris--S installation script
Chris--S authored
155
4724831 @splitbrain installer updates
authored
156 ?>
157 <form action="" method="post">
158 <input type="hidden" name="l" value="<?php echo $LC ?>" />
159 <fieldset>
160 <label for="title"><?php echo $lang['i_wikiname']?>
161 <input type="text" name="d[title]" id="title" value="<?php echo $d['title'] ?>" style="width: 20em;" />
162 </label>
163
164 <fieldset style="margin-top: 1em;">
165 <label for="acl">
166 <input type="checkbox" name="d[acl]" id="acl" <?php echo(($d['acl'] ? 'checked="checked"' : ''));?> />
167 <?php echo $lang['i_enableacl']?></label>
168
169 <fieldset id="acldep">
170 <label for="superuser"><?php echo $lang['i_superuser']?></label>
171 <input class="text" type="text" name="d[superuser]" id="superuser" value="<?php echo $d['superuser'] ?>" />
172
173 <label for="fullname"><?php echo $lang['fullname']?></label>
174 <input class="text" type="text" name="d[fullname]" id="fullname" value="<?php echo $d['fullname'] ?>" />
175
176 <label for="email"><?php echo $lang['email']?></label>
177 <input class="text" type="text" name="d[email]" id="email" value="<?php echo $d['email'] ?>" />
178
179 <label for="password"><?php echo $lang['pass']?></label>
180 <input class="text" type="password" name="d[password]" id="password" />
181
182 <label for="confirm"><?php echo $lang['passchk']?></label>
183 <input class="text" type="password" name="d[confirm]" id="confirm" />
8af2e4b @splitbrain default policy for installer
authored
184
185 <label for="policy"><?php echo $lang['i_policy']?></label>
186 <select class="text" name="d[policy]" id="policy">
187 <option value="0" <?php echo ($d['policy'] == 0)?'selected="selected"':'' ?>><?php echo $lang['i_pol0']?></option>
188 <option value="1" <?php echo ($d['policy'] == 1)?'selected="selected"':'' ?>><?php echo $lang['i_pol1']?></option>
189 <option value="2" <?php echo ($d['policy'] == 2)?'selected="selected"':'' ?>><?php echo $lang['i_pol2']?></option>
190 </select>
4724831 @splitbrain installer updates
authored
191 </fieldset>
192 </fieldset>
193
194 </fieldset>
195 <fieldset id="process">
196 <input class="button" type="submit" name="submit" value="<?php echo $lang['btn_save']?>" />
197 </fieldset>
198 </form>
199 <?php
5cfb881 @Chris--S installation script
Chris--S authored
200 }
201
70a6aa1 @Chris--S install.php updates
Chris--S authored
202 function print_retry() {
203 global $lang;
9ad6da3 @splitbrain keep chosen language on retry in installer FS#1396
authored
204 global $LC;
70a6aa1 @Chris--S install.php updates
Chris--S authored
205 ?>
206 <form action="" method="get">
207 <fieldset>
9ad6da3 @splitbrain keep chosen language on retry in installer FS#1396
authored
208 <input type="hidden" name="l" value="<?php echo $LC ?>" />
70a6aa1 @Chris--S install.php updates
Chris--S authored
209 <input class="button" type="submit" value="<?php echo $lang['i_retry'];?>" />
210 </fieldset>
211 </form>
212 <?php
213 }
214
4724831 @splitbrain installer updates
authored
215 /**
216 * Check validity of data
217 *
218 * @author Andreas Gohr
219 */
e238607 @splitbrain better datachecking in install.php
authored
220 function check_data(&$d){
4724831 @splitbrain installer updates
authored
221 global $lang;
222 global $error;
5cfb881 @Chris--S installation script
Chris--S authored
223
e238607 @splitbrain better datachecking in install.php
authored
224 //autolowercase the username
225 $d['superuser'] = strtolower($d['superuser']);
226
4724831 @splitbrain installer updates
authored
227 $ok = true;
5cfb881 @Chris--S installation script
Chris--S authored
228
4724831 @splitbrain installer updates
authored
229 // check input
230 if(empty($d['title'])){
231 $error[] = sprintf($lang['i_badval'],$lang['i_wikiname']);
232 $ok = false;
233 }
234 if($d['acl']){
235 if(!preg_match('/^[a-z1-9_]+$/',$d['superuser'])){
236 $error[] = sprintf($lang['i_badval'],$lang['i_superuser']);
237 $ok = false;
238 }
239 if(empty($d['password'])){
240 $error[] = sprintf($lang['i_badval'],$lang['pass']);
241 $ok = false;
242 }
243 if($d['confirm'] != $d['password']){
244 $error[] = sprintf($lang['i_badval'],$lang['passchk']);
245 $ok = false;
246 }
247 if(empty($d['fullname']) || strstr($d['fullname'],':')){
248 $error[] = sprintf($lang['i_badval'],$lang['fullname']);
249 $ok = false;
250 }
e238607 @splitbrain better datachecking in install.php
authored
251 if(empty($d['email']) || strstr($d['email'],':') || !strstr($d['email'],'@')){
4724831 @splitbrain installer updates
authored
252 $error[] = sprintf($lang['i_badval'],$lang['email']);
253 $ok = false;
254 }
255 }
256 return $ok;
5cfb881 @Chris--S installation script
Chris--S authored
257 }
258
4724831 @splitbrain installer updates
authored
259 /**
260 * Writes the data to the config files
261 *
262 * @author Chris Smith <chris@jalakai.co.uk>
263 */
264 function store_data($d){
0036aa8 @splitbrain save language in installer
authored
265 global $LC;
4724831 @splitbrain installer updates
authored
266 $ok = true;
8af2e4b @splitbrain default policy for installer
authored
267 $d['policy'] = (int) $d['policy'];
5cfb881 @Chris--S installation script
Chris--S authored
268
4724831 @splitbrain installer updates
authored
269 // create local.php
270 $now = date('r');
271 $output = <<<EOT
272 <?php
273 /**
274 * Dokuwiki's Main Configuration File - Local Settings
275 * Auto-generated by install script
276 * Date: $now
277 */
5cfb881 @Chris--S installation script
Chris--S authored
278
4724831 @splitbrain installer updates
authored
279 EOT;
280 $output .= '$conf[\'title\'] = \''.addslashes($d['title'])."';\n";
0036aa8 @splitbrain save language in installer
authored
281 $output .= '$conf[\'lang\'] = \''.addslashes($LC)."';\n";
4724831 @splitbrain installer updates
authored
282 if($d['acl']){
283 $output .= '$conf[\'useacl\'] = 1'.";\n";
523d7ea @Chris--S install script update II
Chris--S authored
284 $output .= "\$conf['superuser'] = '@admin';\n";
5cfb881 @Chris--S installation script
Chris--S authored
285 }
4724831 @splitbrain installer updates
authored
286 $ok = $ok && fileWrite(DOKU_LOCAL.'local.php',$output);
5cfb881 @Chris--S installation script
Chris--S authored
287
4724831 @splitbrain installer updates
authored
288
289 if ($d['acl']) {
5cfb881 @Chris--S installation script
Chris--S authored
290 // create users.auth.php
291 // --- user:MD5password:Real Name:email:groups,comma,seperated
f6e0e34 @splitbrain disable debugging by default
authored
292 $output = join(":",array($d['superuser'], md5($d['password']), $d['fullname'], $d['email'], 'admin,user'));
5cfb881 @Chris--S installation script
Chris--S authored
293 $output = @file_get_contents(DOKU_CONF.'users.auth.php.dist')."\n$output\n";
4724831 @splitbrain installer updates
authored
294 $ok = $ok && fileWrite(DOKU_LOCAL.'users.auth.php', $output);
5cfb881 @Chris--S installation script
Chris--S authored
295
296 // create acl.auth.php
8af2e4b @splitbrain default policy for installer
authored
297 $output = <<<EOT
298 # acl.auth.php
299 # <?php exit()?>
300 # Don't modify the lines above
301 #
302 # Access Control Lists
303 #
304 # Auto-generated by install script
305 # Date: $now
306
307 EOT;
308 if($d['policy'] == 2){
309 $output .= "* @ALL 0\n";
5c4260f @splitbrain fix user group name in install.php
authored
310 $output .= "* @user 8\n";
9c70688 @Chris--S installer - fix policy 1 + two appearance changes
Chris--S authored
311 }elseif($d['policy'] == 1){
8af2e4b @splitbrain default policy for installer
authored
312 $output .= "* @ALL 1\n";
5c4260f @splitbrain fix user group name in install.php
authored
313 $output .= "* @user 8\n";
8af2e4b @splitbrain default policy for installer
authored
314 }else{
315 $output .= "* @ALL 8\n";
316 }
4724831 @splitbrain installer updates
authored
317 $ok = $ok && fileWrite(DOKU_LOCAL.'acl.auth.php', $output);
5cfb881 @Chris--S installation script
Chris--S authored
318 }
4724831 @splitbrain installer updates
authored
319 return $ok;
5cfb881 @Chris--S installation script
Chris--S authored
320 }
321
4724831 @splitbrain installer updates
authored
322 /**
323 * Write the given content to a file
324 *
325 * @author Chris Smith <chris@jalakai.co.uk>
326 */
327 function fileWrite($filename, $data) {
328 global $error;
329 global $lang;
330
331 if (($fp = @fopen($filename, 'wb')) === false) {
332 $filename = str_replace($_SERVER['DOCUMENT_ROOT'],'{DOCUMENT_ROOT}/', $filename);
333 $error[] = sprintf($lang['i_writeerr'],$filename);
334 return false;
335 }
5cfb881 @Chris--S installation script
Chris--S authored
336
4724831 @splitbrain installer updates
authored
337 if (!empty($data)) { fwrite($fp, $data); }
338 fclose($fp);
339 return true;
5cfb881 @Chris--S installation script
Chris--S authored
340 }
341
342
4724831 @splitbrain installer updates
authored
343 /**
344 * check installation dependent local config files and tests for a known
345 * unmodified main config file
346 *
347 * @author Chris Smith <chris@jalakai.co.uk>
348 */
349 function check_configs(){
350 global $error;
351 global $lang;
352 global $dokuwiki_hash;
5cfb881 @Chris--S installation script
Chris--S authored
353
4724831 @splitbrain installer updates
authored
354 $ok = true;
5cfb881 @Chris--S installation script
Chris--S authored
355
4724831 @splitbrain installer updates
authored
356 $config_files = array(
357 'local' => DOKU_LOCAL.'local.php',
358 'users' => DOKU_LOCAL.'users.auth.php',
359 'auth' => DOKU_LOCAL.'acl.auth.php'
360 );
5cfb881 @Chris--S installation script
Chris--S authored
361
362
4724831 @splitbrain installer updates
authored
363 // main dokuwiki config file (conf/dokuwiki.php) must not have been modified
aa248fb @splitbrain ignore line endings when checking the config file hash for the installer
authored
364 $installation_hash = md5(preg_replace("/(\015\012)|(\015)/","\012",
365 @file_get_contents(DOKU_CONF.'dokuwiki.php')));
4724831 @splitbrain installer updates
authored
366 if (!in_array($installation_hash, $dokuwiki_hash)) {
367 $error[] = sprintf($lang['i_badhash'],$installation_hash);
368 $ok = false;
369 }
5cfb881 @Chris--S installation script
Chris--S authored
370
4724831 @splitbrain installer updates
authored
371 // configs shouldn't exist
372 foreach ($config_files as $file) {
373 if (@file_exists($file)) {
374 $file = str_replace($_SERVER['DOCUMENT_ROOT'],'{DOCUMENT_ROOT}/', $file);
375 $error[] = sprintf($lang['i_confexists'],$file);
376 $ok = false;
377 }
378 }
379 return $ok;
5cfb881 @Chris--S installation script
Chris--S authored
380 }
381
382
4724831 @splitbrain installer updates
authored
383 /**
384 * Check other installation dir/file permission requirements
385 *
386 * @author Chris Smith <chris@jalakai.co.uk>
387 */
388 function check_permissions(){
389 global $error;
390 global $lang;
391
392 $dirs = array(
393 'conf' => DOKU_LOCAL,
394 'data' => DOKU_INC.'data',
395 'pages' => DOKU_INC.'data/pages',
396 'attic' => DOKU_INC.'data/attic',
397 'media' => DOKU_INC.'data/media',
398 'meta' => DOKU_INC.'data/meta',
399 'cache' => DOKU_INC.'data/cache',
400 'locks' => DOKU_INC.'data/locks',
9711045 @splitbrain check data/index permissions in installer FS#1181
authored
401 'index' => DOKU_INC.'data/index',
de33a58 introducing the new tmp dir
Michael Klier authored
402 'tmp' => DOKU_INC.'data/tmp'
4724831 @splitbrain installer updates
authored
403 );
404
405 $ok = true;
406 foreach($dirs as $dir){
407 if(!@file_exists("$dir/.") || !@is_writable($dir)){
70a6aa1 @Chris--S install.php updates
Chris--S authored
408 $dir = str_replace($_SERVER['DOCUMENT_ROOT'],'{DOCUMENT_ROOT}', $dir);
4724831 @splitbrain installer updates
authored
409 $error[] = sprintf($lang['i_permfail'],$dir);
410 $ok = false;
411 }
412 }
413 return $ok;
5cfb881 @Chris--S installation script
Chris--S authored
414 }
415
4724831 @splitbrain installer updates
authored
416 /**
3afe5d1 @splitbrain PHP version check in the installer
authored
417 * Check the availability of functions used in DokuWiki and the PHP version
4724831 @splitbrain installer updates
authored
418 *
419 * @author Andreas Gohr <andi@splitbrain.org>
420 */
421 function check_functions(){
422 global $error;
423 global $lang;
3afe5d1 @splitbrain PHP version check in the installer
authored
424 $ok = true;
425
426 if(version_compare(phpversion(),'4.3.3','<')){
427 $error[] = sprintf($lang['i_phpver'],phpversion(),'4.3.3');
428 $ok = false;
429 }
430
4724831 @splitbrain installer updates
authored
431 $funcs = explode(' ','addslashes basename call_user_func chmod copy fgets '.
432 'file file_exists fseek flush filesize ftell fopen '.
433 'glob header ignore_user_abort ini_get mail mkdir '.
434 'ob_start opendir parse_ini_file readfile realpath '.
9c18485 fixed a forgotten space in install.php
Samuele Tognini authored
435 'rename rmdir serialize session_start unlink usleep '.
7b407d6 @splitbrain fixed function check in install.php FS#1215
authored
436 'preg_replace file_get_contents');
4724831 @splitbrain installer updates
authored
437
70a6aa1 @Chris--S install.php updates
Chris--S authored
438 if (!function_exists('mb_substr')) {
439 $funcs[] = 'utf8_encode';
440 $funcs[] = 'utf8_decode';
441 }
442
4724831 @splitbrain installer updates
authored
443 foreach($funcs as $func){
444 if(!function_exists($func)){
445 $error[] = sprintf($lang['i_funcna'],$func);
446 $ok = false;
447 }
448 }
449 return $ok;
5cfb881 @Chris--S installation script
Chris--S authored
450 }
451
4724831 @splitbrain installer updates
authored
452 /**
453 * Print language selection
454 *
455 * @author Andreas Gohr <andi@splitbrain.org>
456 */
457 function langsel(){
458 global $lang;
459 global $LC;
460
461 $dir = DOKU_INC.'inc/lang';
462 $dh = opendir($dir);
463 if(!$dh) return;
464
465 $langs = array();
466 while (($file = readdir($dh)) !== false) {
467 if(preg_match('/^[\._]/',$file)) continue;
468 if(is_dir($dir.'/'.$file) && @file_exists($dir.'/'.$file.'/lang.php')){
469 $langs[] = $file;
470 }
471 }
472 closedir($dh);
473 sort($langs);
5cfb881 @Chris--S installation script
Chris--S authored
474
475
4724831 @splitbrain installer updates
authored
476 echo '<form action="">';
477 echo $lang['i_chooselang'];
478 echo ': <select name="l" onchange="submit()">';
479 foreach($langs as $l){
480 $sel = ($l == $LC) ? 'selected="selected"' : '';
481 echo '<option value="'.$l.'" '.$sel.'>'.$l.'</option>';
482 }
9c70688 @Chris--S installer - fix policy 1 + two appearance changes
Chris--S authored
483 echo '</select> ';
4724831 @splitbrain installer updates
authored
484 echo '<input type="submit" value="'.$lang['btn_update'].'" />';
485 echo '</form>';
5cfb881 @Chris--S installation script
Chris--S authored
486 }
487
4724831 @splitbrain installer updates
authored
488 /**
489 * Print gloabl error array
490 *
491 * @author Andreas Gohr <andi@splitbrain.org>
492 */
493 function print_errors(){
494 global $error;
495 echo '<ul>';
496 foreach ($error as $err){
497 echo "<li>$err</li>";
498 }
499 echo '</ul>';
5cfb881 @Chris--S installation script
Chris--S authored
500 }
501
4724831 @splitbrain installer updates
authored
502 /**
503 * remove magic quotes recursivly
504 *
505 * @author Andreas Gohr <andi@splitbrain.org>
506 */
507 function remove_magic_quotes(&$array) {
508 foreach (array_keys($array) as $key) {
509 if (is_array($array[$key])) {
510 remove_magic_quotes($array[$key]);
511 }else {
512 $array[$key] = stripslashes($array[$key]);
513 }
514 }
5cfb881 @Chris--S installation script
Chris--S authored
515 }
516
Something went wrong with that request. Please try again.