OSDN Git Service

6dd54fc46330f8e2d04bb954c30c58bb8ddbe237
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / install-EUC.php
1 <?php\r
2 /*\r
3  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
4  * Copyright (C) 2002-2009 The Nucleus Group\r
5  *\r
6  * This program is free software; you can redistribute it and/or\r
7  * modify it under the terms of the GNU General Public License\r
8  * as published by the Free Software Foundation; either version 2\r
9  * of the License, or (at your option) any later version.\r
10  * (see nucleus/documentation/index.html#license for more info)\r
11  * This script will install the Nucleus tables in your SQL-database, and initialize the data in\r
12  * those tables.\r
13  *\r
14  * Below is a friendly way of letting users on non-php systems know that Nucleus won't run there.\r
15  * ?><div style="font-size: xx-large;">If you see this text in your browser when you open <i>install.php</i>, your web server is not able to run PHP-scripts, and therefor Nucleus will not be able to run there. </div><div style="display: none"><?php\r
16  */\r
17 \r
18 /**\r
19  * @license http://nucleuscms.org/license.txt GNU General Public License\r
20  * @copyright Copyright (C) 2002-2009 The Nucleus Group\r
21  * @version $Id$\r
22  * $NucleusJP: install.php,v 1.7 2007/02/04 06:28:44 kimitake Exp $\r
23  */\r
24 \r
25 /*\r
26         This part of the install.php code allows for customization of the install process.\r
27         When distributing plugins or skins together with a Nucleus installation, the\r
28         configuration below will instruct to install them\r
29 \r
30         -- Start Of Configurable Part --\r
31 */\r
32 \r
33 include('./install_lang_japanese-euc.php');\r
34 \r
35 // array with names of plugins to install. Plugin files must be present in the nucleus/plugin/\r
36 // directory.\r
37 //\r
38 // example:\r
39 //     array('NP_TrackBack', 'NP_MemberGoodies')\r
40 $aConfPlugsToInstall = array('NP_SkinFiles');\r
41 \r
42 \r
43 // array with skins to install. skins must be present under the skins/ directory with\r
44 // a subdirectory having the same name that contains a skinbackup.xml file\r
45 //\r
46 // example:\r
47 //     array('base','rsd')\r
48 $aConfSkinsToImport = array('default');\r
49 \r
50 /*\r
51         -- End Of Configurable Part --\r
52 */\r
53 \r
54 // don't give warnings for uninitialized vars\r
55 error_reporting(E_ERROR | E_WARNING | E_PARSE);\r
56 \r
57 // make sure there's no unnecessary escaping:\r
58 set_magic_quotes_runtime(0);\r
59 \r
60 // if there are some plugins or skins to import, do not include vars\r
61 // in globalfunctions.php again... so set a flag\r
62 if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0) ) {\r
63         global $CONF;\r
64         $CONF['installscript'] = 1;\r
65 }\r
66 \r
67 if (phpversion() >= '4.1.0') {\r
68         include_once('nucleus/libs/vars4.1.0.php');\r
69 } else {\r
70         include_once('nucleus/libs/vars4.0.6.php');\r
71 }\r
72 \r
73 include_once('nucleus/libs/mysql.php');\r
74 \r
75 // check if mysql support is installed\r
76         if (!function_exists('mysql_query') ) {\r
77                 _doError(_ERROR1);\r
78         }\r
79 \r
80         if (postVar('action') == 'go') {\r
81                 doInstall();\r
82         } else {\r
83                 showInstallForm();\r
84         }\r
85 \r
86 exit;\r
87 \r
88 function showInstallForm() {\r
89         // 0. pre check if all necessary files exist\r
90         doCheckFiles();\r
91 \r
92         ?>\r
93         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
94         <html xmlns="http://www.w3.org/1999/xhtml">\r
95         <head>\r
96                 <meta http-equiv="content-type" content="application/xhtml+xml; charset=<?php echo _CHARSET; ?>" />\r
97                 <title><?php echo _TITLE; ?></title>\r
98                 <style type="text/css"><!--\r
99                         @import url('nucleus/documentation/styles/manual.css');\r
100                 --></style>\r
101                 <script type="text/javascript"><!--\r
102                         var submitcount = 0;\r
103 \r
104                         // function to make sure the submit button only gets pressed once\r
105                         function checkSubmit() {\r
106                                 if (submitcount == 0) {\r
107                                         submitcount++;\r
108                                         return true;\r
109                                 } else {\r
110                                         return false;\r
111                                 }\r
112                         }\r
113                 --></script>\r
114         </head>\r
115         <body>\r
116                 <div style="text-align:center"><img src="./nucleus/styles/logo.gif" /></div> <!-- Nucleus logo -->\r
117                 <form method="post" action="install.php">\r
118 \r
119                 <h1><?php echo _HEADER1; ?></h1>\r
120 \r
121                 <?php echo _TEXT1; ?>\r
122 \r
123                 <h1><?php echo _HEADER2; ?></h1>\r
124 \r
125                 <?php echo _TEXT2; ?>\r
126 \r
127                 <ul>\r
128                         <li>PHP:\r
129 \r
130 <?php\r
131         echo phpversion();\r
132         $minVersion = '4.0.6';\r
133 \r
134         if (phpversion() < $minVersion) {\r
135                 echo ' <span class="warning" style="display:block">' . sprintf(_TEXT2_WARN, $minVersion) . '</span>';\r
136         } elseif (phpversion() < '5') {\r
137                 echo ' <span class="warning" style="display:block">' . _TEXT2_WARN3 . '</span>';\r
138         }\r
139 ?>\r
140 \r
141                         </li>\r
142                         <li>MySQL:\r
143 \r
144 <?php\r
145         // note: this piece of code is taken from phpMyAdmin\r
146         $result = @mysql_query('SELECT VERSION() AS version');\r
147 \r
148         if ($result != FALSE && @mysql_num_rows($result) > 0) {\r
149                 $row   = mysql_fetch_array($result);\r
150                 $match = explode('.', $row['version']);\r
151         } else {\r
152                 $result = @mysql_query('SHOW VARIABLES LIKE \'version\'');\r
153 \r
154                 if ($result != FALSE && @mysql_num_rows($result) > 0) {\r
155                         $row   = mysql_fetch_row($result);\r
156                         $match = explode('.', $row[1]);\r
157                 } else {\r
158                         $output = shell_exec('mysql -V');\r
159                         preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);\r
160                         $match = explode('.', $version[0]);\r
161 \r
162                         if ($match[0] == '') {\r
163                                 $match[0] = '0';\r
164                                 $match[1] = '0';\r
165                                 $match[2] = '0';\r
166                         }\r
167                 }\r
168         }\r
169 \r
170         $mysqlVersion = implode($match, '.');\r
171         $minVersion = '3.23';\r
172 \r
173         if ($mysqlVersion == '0.0.0') {\r
174                 echo _NOTIFICATION1;\r
175         }\r
176         else {\r
177                 echo $mysqlVersion;\r
178         }\r
179 \r
180         if ($mysqlVersion < $minVersion) {\r
181                 echo ' <span class="warning" style="display:block">' . sprintf(_TEXT2_WARN2, $minVersion) . '</span>';\r
182         }\r
183 ?>\r
184 \r
185                         </li>\r
186                 </ul>\r
187 \r
188 <?php\r
189         // tell people how they can have their config file filled out automatically\r
190         if (@file_exists('config.php') && @!is_writable('config.php')) {\r
191 ?>\r
192 \r
193                 <h1><?php echo _HEADER3; ?></h1>\r
194 \r
195                 <?php echo _TEXT3;\r
196 \r
197 } ?>\r
198 \r
199                 <h1><?php echo _HEADER4; ?></h1>\r
200 \r
201                 <?php echo _TEXT4; ?>\r
202 \r
203                 <fieldset>\r
204                         <legend><?php echo _TEXT4_TAB_HEAD; ?></legend>\r
205                         <table>\r
206                                 <tr>\r
207                                         <td><?php echo _TEXT4_TAB_FIELD1; ?></td>\r
208                                         <td><input name="mySQL_host" value="<?php echo htmlspecialchars(@ini_get('mysql.default_host') )?>" /></td>\r
209                                 </tr>\r
210                                 <tr>\r
211                                         <td><?php echo _TEXT4_TAB_FIELD2; ?></td>\r
212                                         <td><input name="mySQL_user" /></td>\r
213                                 </tr>\r
214                                 <tr>\r
215                                         <td><?php echo _TEXT4_TAB_FIELD3; ?></td>\r
216                                         <td><input name="mySQL_password" type="password" /></td>\r
217                                 </tr>\r
218                                 <tr>\r
219                                         <td><?php echo _TEXT4_TAB_FIELD4; ?></td>\r
220                                         <td><input name="mySQL_database" /> (<input name="mySQL_create" value="1" type="checkbox" id="mySQL_create" /><label for="mySQL_create"><?php echo _TEXT4_TAB_FIELD4_ADD; ?></label>)</td>\r
221                                 </tr>\r
222                         </table>\r
223                 </fieldset>\r
224 \r
225                 <fieldset>\r
226                         <legend><?php echo _TEXT4_TAB2_HEAD; ?></legend>\r
227                         <table>\r
228                                 <tr>\r
229                                         <td><input name="mySQL_usePrefix" value="1" type="checkbox" id="mySQL_usePrefix" /><label for="mySQL_usePrefix"><?php echo _TEXT4_TAB2_FIELD; ?></label></td>\r
230                                         <td><input name="mySQL_tablePrefix" value="" /></td>\r
231                                 </tr>\r
232                         </table>\r
233 \r
234                         <?php echo _TEXT4_TAB2_ADD; ?>\r
235 \r
236                 </fieldset>\r
237 \r
238         <h1><?php echo _HEADER5; ?></h1>\r
239 \r
240         <?php echo _TEXT5; ?>\r
241 \r
242 <?php\r
243 \r
244         // no need to this all! dirname(__FILE__) is all we need -- moraes\r
245         /*\r
246         // discover full path\r
247         $fullPath = serverVar('PATH_TRANSLATED');\r
248 \r
249         if ($fullPath == '') {\r
250                 $fullPath = serverVar('SCRIPT_FILENAME');\r
251         }\r
252 \r
253         $basePath = str_replace('install.php', '', $fullPath);\r
254         $basePath = replaceDoubleBackslash($basePath);\r
255         $basePath = replaceDoubleBackslash($basePath);\r
256 \r
257         // add slash at end if necessary\r
258         if (!endsWithSlash($basePath) ) {\r
259                 $basePath .= '/';\r
260         }\r
261         */\r
262 \r
263         $basePath = dirname(__FILE__) . '/';\r
264 ?>\r
265 \r
266                 <fieldset>\r
267                         <legend><?php echo _TEXT5_TAB_HEAD; ?></legend>\r
268                         <table>\r
269                                 <tr>\r
270                                         <td><?php echo _TEXT5_TAB_FIELD1; ?></td>\r
271                                         <td><input name="IndexURL" size="60" value="<?php\r
272                                                 $url = 'http://' . serverVar('HTTP_HOST') . serverVar('PHP_SELF');\r
273                                                 $url = str_replace('install.php', '', $url);\r
274                                                 $url = replaceDoubleBackslash($url);\r
275 \r
276                                                 // add slash at end if necessary\r
277                                                 if (!endsWithSlash($url) ) {\r
278                                                         $url .= '/';\r
279                                                 }\r
280 \r
281                                                 echo $url; ?>" /></td>\r
282                                 </tr>\r
283                                 <tr>\r
284                                         <td><?php echo _TEXT5_TAB_FIELD2; ?></td>\r
285                                         <td><input name="AdminURL" size="60" value="<?php\r
286                                                 if ($url) {\r
287                                                         echo $url . 'nucleus/';\r
288                                                 } ?>" /></td>\r
289                                 </tr>\r
290                                 <tr>\r
291                                         <td><?php echo _TEXT5_TAB_FIELD3; ?></td>\r
292                                         <td><input name="AdminPath" size="60" value="<?php\r
293                                                 if($basePath) {\r
294                                                         echo $basePath . 'nucleus/';\r
295                                                 } ?>" /></td>\r
296                                 </tr>\r
297                                 <tr>\r
298                                         <td><?php echo _TEXT5_TAB_FIELD4; ?></td>\r
299                                         <td><input name="MediaURL" size="60" value="<?php\r
300                                                 if ($url) {\r
301                                                         echo $url . 'media/';\r
302                                                 } ?>" /></td>\r
303                                 </tr>\r
304                                 <tr>\r
305                                         <td><?php echo _TEXT5_TAB_FIELD5; ?></td>\r
306                                         <td><input name="MediaPath" size="60" value="<?php\r
307                                                 if ($basePath) {\r
308                                                         echo $basePath . 'media/';\r
309                                                 } ?>" /></td>\r
310                                 </tr>\r
311                                 <tr>\r
312                                         <td><?php echo _TEXT5_TAB_FIELD6; ?></td>\r
313                                         <td><input name="SkinsURL" size="60" value="<?php\r
314                                                 if ($url) {\r
315                                                         echo $url . 'skins/';\r
316                                                 } ?>" />\r
317                                                 <br />(<?php echo _TEXT5_TAB_FIELD7_2; ?>)\r
318                                         </td>\r
319                                 </tr>\r
320                                 <tr>\r
321                                         <td><?php echo _TEXT5_TAB_FIELD7; ?></td>\r
322                                         <td><input name="SkinsPath" size="60" value="<?php\r
323                                                 if ($basePath) {\r
324                                                         echo $basePath . 'skins/';\r
325                                                 } ?>" />\r
326                                                 <br />(<?php echo _TEXT5_TAB_FIELD7_2; ?>)\r
327                                         </td>\r
328                                 </tr>\r
329                                 <tr>\r
330                                         <td><?php echo _TEXT5_TAB_FIELD8; ?></td>\r
331                                         <td><input name="PluginURL" size="60" value="<?php\r
332                                                 if ($url) {\r
333                                                         echo $url . 'nucleus/plugins/';\r
334                                                 } ?>" /></td>\r
335                                 </tr>\r
336                                 <tr>\r
337                                         <td><?php echo _TEXT5_TAB_FIELD9; ?></td>\r
338                                         <td><input name="ActionURL" size="60" value="<?php\r
339                                                 if ($url) {\r
340                                                         echo $url . 'action.php';\r
341                                                 } ?>" />\r
342                                                 <br />(<?php echo _TEXT5_TAB_FIELD9_2;?>)\r
343                                         </td>\r
344                                 </tr>\r
345                         </table>\r
346                 </fieldset>\r
347 \r
348                 <?php echo _TEXT5_2; ?>\r
349 \r
350                 <h1><? echo _HEADER6; ?></h1>\r
351 \r
352                 <?php echo _TEXT6; ?>\r
353 \r
354                 <fieldset>\r
355                         <legend><?php echo _TEXT6_TAB_HEAD; ?></legend>\r
356                         <table>\r
357                                 <tr>\r
358                                         <td><?php echo _TEXT6_TAB_FIELD1; ?></td>\r
359                                         <td><input name="User_name" value="" /> <small>(<?php echo _TEXT6_TAB_FIELD1_2; ?>)</small></td>\r
360                                 </tr>\r
361                                 <tr>\r
362                                         <td><?php echo _TEXT6_TAB_FIELD2; ?></td>\r
363                                         <td><input name="User_realname" value="" /></td>\r
364                                 </tr>\r
365                                 <tr>\r
366                                         <td><?php echo _TEXT6_TAB_FIELD3; ?></td>\r
367                                         <td><input name="User_password" type="password" value="" /></td>\r
368                                 </tr>\r
369                                 <tr>\r
370                                         <td><?php echo _TEXT6_TAB_FIELD4; ?></td>\r
371                                         <td><input name="User_password2" type="password" value="" /></td>\r
372                                 </tr>\r
373                                 <tr>\r
374                                         <td><?php echo _TEXT6_TAB_FIELD5; ?></td>\r
375                                         <td><input name="User_email" value="" /> <small>(<?php echo _TEXT6_TAB_FIELD5_2; ?>)</small></td>\r
376                                 </tr>\r
377                         </table>\r
378                 </fieldset>\r
379 \r
380                 <h1><?php echo _HEADER7; ?></h1>\r
381 \r
382                 <?php echo _TEXT7; ?>\r
383 \r
384                 <fieldset>\r
385                         <legend><?php echo _TEXT7_TAB_HEAD; ?></legend>\r
386                         <table>\r
387                                 <tr>\r
388                                         <td><?php echo _TEXT7_TAB_FIELD1; ?></td>\r
389                                         <td><input name="Blog_name" size="60" value="My Nucleus CMS" /></td>\r
390                                 </tr>\r
391                                 <tr>\r
392                                         <td><?php echo _TEXT7_TAB_FIELD2; ?></td>\r
393                                         <td><input name="Blog_shortname" value="mynucleuscms" /> <small>(<?php echo _TEXT7_TAB_FIELD2_2; ?>)</small></td>\r
394                                 </tr>\r
395                         </table>\r
396                 </fieldset>\r
397 \r
398                 <h1><?php echo _HEADER8; ?></h1>\r
399 \r
400                 <fieldset>\r
401                         <legend><?php echo _TEXT8_TAB_HEADER; ?></legend>\r
402                         <table>\r
403                                 <tr>\r
404                                         <td><input name="Weblog_ping" value="1" type="checkbox" id="Weblog_ping" /><?php echo _TEXT8_TAB_FIELD1; ?></td>\r
405                                 </tr>\r
406                         </table>\r
407                 </fieldset>\r
408 \r
409                 <h1><?php echo _HEADER9; ?></h1>\r
410 \r
411                 <?php echo _TEXT9; ?>\r
412 \r
413                 <p><input name="action" value="go" type="hidden" /> <input type="submit" value="<?php echo _BUTTON1; ?>" onclick="return checkSubmit();" /></p>\r
414 \r
415                 </form>\r
416         </body>\r
417 </html>\r
418 \r
419 <?php }\r
420 \r
421 function tableName($unPrefixed) {\r
422         global $mysql_usePrefix, $mysql_prefix;\r
423 \r
424         if ($mysql_usePrefix == 1) {\r
425                 return $mysql_prefix . $unPrefixed;\r
426         } else {\r
427                 return $unPrefixed;\r
428         }\r
429 }\r
430 \r
431 function doInstall() {\r
432         global $mysql_usePrefix, $mysql_prefix, $weblog_ping;\r
433 \r
434         // 0. put all POST-vars into vars\r
435         $mysql_host        = postVar('mySQL_host');\r
436         $mysql_user        = postVar('mySQL_user');\r
437         $mysql_password    = postVar('mySQL_password');\r
438         $mysql_database    = postVar('mySQL_database');\r
439         $mysql_create      = postVar('mySQL_create');\r
440         $mysql_usePrefix   = postVar('mySQL_usePrefix');\r
441         $mysql_prefix      = postVar('mySQL_tablePrefix');\r
442         $config_indexurl   = postVar('IndexURL');\r
443         $config_adminurl   = postVar('AdminURL');\r
444         $config_adminpath  = postVar('AdminPath');\r
445         $config_mediaurl   = postVar('MediaURL');\r
446         $config_skinsurl   = postVar('SkinsURL');\r
447         $config_pluginurl  = postVar('PluginURL');\r
448         $config_actionurl  = postVar('ActionURL');\r
449         $config_mediapath  = postVar('MediaPath');\r
450         $config_skinspath  = postVar('SkinsPath');\r
451         $user_name         = postVar('User_name');\r
452         $user_realname     = postVar('User_realname');\r
453         $user_password     = postVar('User_password');\r
454         $user_password2    = postVar('User_password2');\r
455         $user_email        = postVar('User_email');\r
456         $blog_name         = postVar('Blog_name');\r
457         $blog_shortname    = postVar('Blog_shortname');\r
458         $config_adminemail = $user_email;\r
459         $config_sitename   = $blog_name;\r
460         $weblog_ping       = postVar('Weblog_ping');\r
461 \r
462         $config_indexurl   = replaceDoubleBackslash($config_indexurl);\r
463         $config_adminurl   = replaceDoubleBackslash($config_adminurl);\r
464         $config_mediaurl   = replaceDoubleBackslash($config_mediaurl);\r
465         $config_skinsurl   = replaceDoubleBackslash($config_skinsurl);\r
466         $config_pluginurl  = replaceDoubleBackslash($config_pluginurl);\r
467         $config_actionurl  = replaceDoubleBackslash($config_actionurl);\r
468         $config_adminpath  = replaceDoubleBackslash($config_adminpath);\r
469         $config_skinspath  = replaceDoubleBackslash($config_skinspath);\r
470         $config_mediapath  = replaceDoubleBackslash($config_mediapath);\r
471 \r
472         // 1. check all the data\r
473         $errors = array();\r
474 \r
475         if (!$mysql_database) {\r
476                 array_push($errors, _ERROR2);\r
477         }\r
478 \r
479         if (($mysql_usePrefix == 1) && (strlen($mysql_prefix) == 0) ) {\r
480                 array_push($errors, _ERROR3);\r
481         }\r
482 \r
483         if (($mysql_usePrefix == 1) && (!eregi('^[a-zA-Z0-9_]+$', $mysql_prefix) ) ) {\r
484                 array_push($errors, _ERROR4);\r
485         }\r
486 \r
487         // TODO: add action.php check\r
488         if (!endsWithSlash($config_indexurl) || !endsWithSlash($config_adminurl) || !endsWithSlash($config_mediaurl) || !endsWithSlash($config_pluginurl) || !endsWithSlash($config_skinsurl) ) {\r
489                 array_push($errors, _ERROR5);\r
490         }\r
491 \r
492         if (!endsWithSlash($config_adminpath) ) {\r
493                 array_push($errors, _ERROR6);\r
494         }\r
495 \r
496         if (!endsWithSlash($config_mediapath) ) {\r
497                 array_push($errors, _ERROR7);\r
498         }\r
499 \r
500         if (!endsWithSlash($config_skinspath) ) {\r
501                 array_push($errors, _ERROR8);\r
502         }\r
503 \r
504         if (!is_dir($config_adminpath) ) {\r
505                 array_push($errors, _ERROR9);\r
506         }\r
507 \r
508         if (!_isValidMailAddress($user_email) ) {\r
509                 array_push($errors, _ERROR10);\r
510         }\r
511 \r
512         if (!_isValidDisplayName($user_name) ) {\r
513                 array_push($errors, _ERROR11);\r
514         }\r
515 \r
516         if (!$user_password || !$user_password2) {\r
517                 array_push($errors, _ERROR12);\r
518         }\r
519 \r
520         if ($user_password != $user_password2) {\r
521                 array_push($errors, _ERROR13);\r
522         }\r
523 \r
524         if (!_isValidShortName($blog_shortname) ) {\r
525                 array_push($errors, _ERROR14);\r
526         }\r
527 \r
528         if (sizeof($errors) > 0) {\r
529                 showErrorMessages($errors);\r
530         }\r
531 \r
532         // 2. try to log in to mySQL\r
533         global $MYSQL_CONN;\r
534         $MYSQL_CONN = @mysql_connect($mysql_host, $mysql_user, $mysql_password);\r
535 \r
536         if ($MYSQL_CONN == false) {\r
537                 _doError(_ERROR15 . ': ' . mysql_error() );\r
538         }\r
539 \r
540         // 3. try to create database (if needed)\r
541         if ($mysql_create == 1) {\r
542                 mysql_query('CREATE DATABASE ' . $mysql_database) or _doError(_ERROR16 . ': ' . mysql_error() );\r
543         }\r
544 \r
545         // 4. try to select database\r
546         mysql_select_db($mysql_database) or _doError(_ERROR17);\r
547 \r
548         // 5. execute queries\r
549         $filename = 'install.sql';\r
550         $fd = fopen($filename, 'r');\r
551         $queries = fread($fd, filesize($filename) );\r
552         fclose($fd);\r
553 \r
554         $queries = split("(;\n|;\r)", $queries);\r
555 \r
556         $aTableNames = array(\r
557                 'nucleus_actionlog',\r
558                 'nucleus_ban',\r
559                 'nucleus_blog',\r
560                 'nucleus_category',\r
561                 'nucleus_comment',\r
562                 'nucleus_config',\r
563                 'nucleus_item',\r
564                 'nucleus_karma',\r
565                 'nucleus_member',\r
566                 'nucleus_plugin',\r
567                 'nucleus_skin',\r
568                 'nucleus_template',\r
569                 'nucleus_team',\r
570                 'nucleus_activation',\r
571                 'nucleus_tickets'\r
572         );\r
573 // these are unneeded (one of the replacements above takes care of them)\r
574 //                      'nucleus_plugin_event',\r
575 //                      'nucleus_plugin_option',\r
576 //                      'nucleus_plugin_option_desc',\r
577 //                      'nucleus_skin_desc',\r
578 //                      'nucleus_template_desc',\r
579 \r
580         $aTableNamesPrefixed = array(\r
581                 $mysql_prefix . 'nucleus_actionlog',\r
582                 $mysql_prefix . 'nucleus_ban',\r
583                 $mysql_prefix . 'nucleus_blog',\r
584                 $mysql_prefix . 'nucleus_category',\r
585                 $mysql_prefix . 'nucleus_comment',\r
586                 $mysql_prefix . 'nucleus_config',\r
587                 $mysql_prefix . 'nucleus_item',\r
588                 $mysql_prefix . 'nucleus_karma',\r
589                 $mysql_prefix . 'nucleus_member',\r
590                 $mysql_prefix . 'nucleus_plugin',\r
591                 $mysql_prefix . 'nucleus_skin',\r
592                 $mysql_prefix . 'nucleus_template',\r
593                 $mysql_prefix . 'nucleus_team',\r
594                 $mysql_prefix . 'nucleus_activation',\r
595                 $mysql_prefix . 'nucleus_tickets'\r
596         );\r
597 // these are unneeded (one of the replacements above takes care of them)\r
598 //                      $mysql_prefix . 'nucleus_plugin_event',\r
599 //                      $mysql_prefix . 'nucleus_plugin_option',\r
600 //                      $mysql_prefix . 'nucleus_plugin_option_desc',\r
601 //                      $mysql_prefix . 'nucleus_skin_desc',\r
602 //                      $mysql_prefix . 'nucleus_template_desc',\r
603 \r
604         $count = count($queries);\r
605 \r
606         for ($idx = 0; $idx < $count; $idx++) {\r
607                 $query = trim($queries[$idx]);\r
608                 // echo "QUERY = <small>" . htmlspecialchars($query) . "</small><p>";\r
609 \r
610                 if ($query) {\r
611 \r
612                         if ($mysql_usePrefix == 1) {\r
613                                         $query = str_replace($aTableNames, $aTableNamesPrefixed, $query);\r
614                         }\r
615 \r
616                         mysql_query($query) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($query) . '</small>): ' . mysql_error() );\r
617                 }\r
618         }\r
619 \r
620         // 5a make first post\r
621         $newpost = "INSERT INTO " . tableName('nucleus_item') . " VALUES (1, '" . _1ST_POST_TITLE . "', '" . _1ST_POST . "', '" . _1ST_POST2 . "', 1, 1, '2005-08-15 11:04:26', 0, 0, 0, 1, 0, 1);";\r
622         mysql_query($newpost) or _doError(_ERROR18 . ' (<small>' . htmlspecialchars($newpost) . '</small>): ' . mysql_error() );\r
623 \r
624         // 6. update global settings\r
625         updateConfig('IndexURL',   $config_indexurl);\r
626         updateConfig('AdminURL',   $config_adminurl);\r
627         updateConfig('MediaURL',   $config_mediaurl);\r
628         updateConfig('SkinsURL',   $config_skinsurl);\r
629         updateConfig('PluginURL',  $config_pluginurl);\r
630         updateConfig('ActionURL',  $config_actionurl);\r
631         updateConfig('AdminEmail', $config_adminemail);\r
632         updateConfig('SiteName',   $config_sitename);\r
633 \r
634         // 7. update GOD member\r
635         $query = 'UPDATE ' . tableName('nucleus_member')\r
636                    . " SET mname     = '" . addslashes($user_name) . "',"\r
637                    . " mrealname     = '" . addslashes($user_realname) . "',"\r
638                    . " mpassword     = '" . md5(addslashes($user_password) ) . "',"\r
639                    . " murl          = '" . addslashes($config_indexurl) . "',"\r
640                    . " memail        = '" . addslashes($user_email) . "',"\r
641                    . " madmin        = 1,"\r
642                    . " mcanlogin     = 1"\r
643                    . " WHERE"\r
644                    . " mnumber       = 1";\r
645 \r
646         mysql_query($query) or _doError(_ERROR19 . ': ' . mysql_error() );\r
647 \r
648         // 8. update weblog settings\r
649         $query = 'UPDATE ' . tableName('nucleus_blog')\r
650                    . " SET bname  = '" . addslashes($blog_name) . "',"\r
651                    . " bshortname = '" . addslashes($blog_shortname) . "',"\r
652                    . " burl       = '" . addslashes($config_indexurl) . "'"\r
653                    . " WHERE"\r
654                    . " bnumber    = 1";\r
655 \r
656         mysql_query($query) or _doError(_ERROR20 . ': ' . mysql_error() );\r
657 \r
658         // 8-2. update category settings\r
659         $query = 'UPDATE ' . tableName('nucleus_category')\r
660                    . " SET cname  = '" . addslashes(_GENERALCAT_NAME) . "',"\r
661                    . " cdesc      = '" . addslashes(_GENERALCAT_DESC) . "'"\r
662                    . " WHERE"\r
663                    . " catid      = 1";\r
664 \r
665         mysql_query($query) or _doError(_ERROR20 . ': ' . mysql_error() );\r
666 \r
667         // 9. update item date\r
668         $query = 'UPDATE ' . tableName('nucleus_item')\r
669                    . " SET   itime   = '" . date('Y-m-d H:i:s', time() ) ."'"\r
670                    . " WHERE inumber = 1";\r
671 \r
672         mysql_query($query) or _doError(_ERROR21 . ': ' . mysql_error() );\r
673 \r
674         global $aConfPlugsToInstall, $aConfSkinsToImport;\r
675         $aSkinErrors = array();\r
676         $aPlugErrors = array();\r
677 \r
678         if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0) ) {\r
679                 // 10. set global variables\r
680                 global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_PREFIX;\r
681 \r
682                 $MYSQL_HOST     = $mysql_host;\r
683                 $MYSQL_USER     = $mysql_user;\r
684                 $MYSQL_PASSWORD = $mysql_password;\r
685                 $MYSQL_DATABASE = $mysql_database;\r
686                 $MYSQL_PREFIX   = ($mysql_usePrefix == 1) ? $mysql_prefix : '';\r
687 \r
688                 global $DIR_NUCLEUS, $DIR_MEDIA, $DIR_SKINS, $DIR_PLUGINS, $DIR_LANG, $DIR_LIBS;\r
689 \r
690                 $DIR_NUCLEUS = $config_adminpath;\r
691                 $DIR_MEDIA   = $config_mediapath;\r
692                 $DIR_SKINS   = $config_skinspath;\r
693                 $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
694                 $DIR_LANG    = $DIR_NUCLEUS . 'language/';\r
695                 $DIR_LIBS    = $DIR_NUCLEUS . 'libs/';\r
696 \r
697                 // close database connection (needs to be closed if we want to include globalfunctions.php)\r
698                 mysql_close();\r
699 \r
700                 $manager = '';\r
701                 include_once($DIR_LIBS . 'globalfunctions.php');\r
702 \r
703                 // 11. install custom skins\r
704                 $aSkinErrors = installCustomSkins($manager);\r
705 \r
706                 // 12. install NP_Ping, if decided\r
707                 if ($weblog_ping == 1) {\r
708                         global $aConfPlugsToInstall;\r
709                         array_push($aConfPlugsToInstall, "NP_Ping");\r
710                 }\r
711 \r
712                 // 13. install custom plugins\r
713                 $aPlugErrors = installCustomPlugs($manager);\r
714         }\r
715 \r
716         // 14. Write config file ourselves (if possible)\r
717         $bConfigWritten = 0;\r
718 \r
719         if (@file_exists('config.php') && is_writable('config.php') && $fp = @fopen('config.php', 'w') ) {\r
720                 $config_data = '<' . '?php' . "\n\n";\r
721                 //$config_data .= "\n"; (extraneous, just added extra \n to previous line\r
722                 $config_data .= "       // mySQL connection information\n";\r
723                 $config_data .= "       \$MYSQL_HOST     = '" . $mysql_host . "';\n";\r
724                 $config_data .= "       \$MYSQL_USER     = '" . $mysql_user . "';\n";\r
725                 $config_data .= "       \$MYSQL_PASSWORD = '" . $mysql_password . "';\n";\r
726                 $config_data .= "       \$MYSQL_DATABASE = '" . $mysql_database . "';\n";\r
727                 $config_data .= "       \$MYSQL_PREFIX   = '" . (($mysql_usePrefix == 1) ? $mysql_prefix : '') . "';\n";\r
728                 $config_data .= "\n";\r
729                 $config_data .= "       // main nucleus directory\n";\r
730                 $config_data .= "       \$DIR_NUCLEUS = '" . $config_adminpath . "';\n";\r
731                 $config_data .= "\n";\r
732                 $config_data .= "       // path to media dir\n";\r
733                 $config_data .= "       \$DIR_MEDIA   = '" . $config_mediapath . "';\n";\r
734                 $config_data .= "\n";\r
735                 $config_data .= "       // extra skin files for imported skins\n";\r
736                 $config_data .= "       \$DIR_SKINS   = '" . $config_skinspath . "';\n";\r
737                 $config_data .= "\n";\r
738                 $config_data .= "       // these dirs are normally sub dirs of the nucleus dir, but \n";\r
739                 $config_data .= "       // you can redefine them if you wish\n";\r
740                 $config_data .= "       \$DIR_PLUGINS = \$DIR_NUCLEUS . 'plugins/';\n";\r
741                 $config_data .= "       \$DIR_LANG    = \$DIR_NUCLEUS . 'language/';\n";\r
742                 $config_data .= "       \$DIR_LIBS    = \$DIR_NUCLEUS . 'libs/';\n";\r
743                 $config_data .= "\n";\r
744                 $config_data .= "       // include libs\n";\r
745                 $config_data .= "       include(\$DIR_LIBS . 'globalfunctions.php');\n";\r
746                 $config_data .= "       if (!extension_loaded('mbstring')) {\n";\r
747                 $config_data .= "               include(\$DIR_LIBS . 'mb_emulator/mb-emulator.php');\n";\r
748                 $config_data .= "       }\n";\r
749                 $config_data .= "?" . ">";\r
750 \r
751                 $result = @fputs($fp, $config_data, strlen($config_data) );\r
752                 fclose($fp);\r
753 \r
754                 if ($result) {\r
755                         $bConfigWritten = 1;\r
756                 }\r
757         }\r
758 \r
759 ?>\r
760 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
761 <html xmlns="http://www.w3.org/1999/xhtml">\r
762 <head>\r
763         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET; ?>" />\r
764         <title><?php echo _TITLE; ?></title>\r
765         <style>@import url('nucleus/styles/manual.css');</style>\r
766 </head>\r
767 <body>\r
768         <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
769 \r
770 <?php\r
771         $aAllErrors = array_merge($aSkinErrors, $aPlugErrors);\r
772 \r
773         if (count($aAllErrors) > 0) {\r
774                 echo '<h1>' . _TITLE2 . '</h1>';\r
775                 echo '<ul><li>' . implode('</li><li>', $aAllErrors) . '</li></ul>';\r
776         }\r
777 \r
778         if (!$bConfigWritten) { ?>\r
779                 <h1><?php echo _TITLE3; ?></h1>\r
780 \r
781                 <? echo _TEXT10; ?>\r
782 \r
783                 <pre><code>&lt;?php\r
784         // mySQL connection information\r
785         $MYSQL_HOST     = '<b><?php echo $mysql_host?></b>';\r
786         $MYSQL_USER     = '<b><?php echo $mysql_user?></b>';\r
787         $MYSQL_PASSWORD = '<i><b>xxxxxxxxxxx</b></i>';\r
788         $MYSQL_DATABASE = '<b><?php echo $mysql_database?></b>';\r
789         $MYSQL_PREFIX   = '<b><?php echo ($mysql_usePrefix == 1)?$mysql_prefix:''?></b>';\r
790 \r
791         // main nucleus directory\r
792         $DIR_NUCLEUS = '<b><?php echo $config_adminpath?></b>';\r
793 \r
794         // path to media dir\r
795         $DIR_MEDIA   = '<b><?php echo $config_mediapath?></b>';\r
796 \r
797         // extra skin files for imported skins\r
798         $DIR_SKINS   = '<b><?php echo $config_skinspath?></b>';\r
799 \r
800         // these dirs are normally sub dirs of the nucleus dir, but\r
801         // you can redefine them if you wish\r
802         $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
803         $DIR_LANG    = $DIR_NUCLEUS . 'language/';\r
804         $DIR_LIBS    = $DIR_NUCLEUS . 'libs/';\r
805 \r
806         // include libs\r
807         include($DIR_LIBS . 'globalfunctions.php');\r
808         if (!extension_loaded('mbstring')) {\r
809                 include($DIR_LIBS . 'mb_emulator/mb-emulator.php');\r
810         }\r
811 ?&gt;</code></pre>\r
812 \r
813         <?php echo _TEXT11; ?>\r
814 \r
815         <div class="note">\r
816         <?php echo _TEXT12; ?>\r
817         </div>\r
818 \r
819 <?php } else { ?>\r
820 \r
821         <h1><?php echo _TITLE4; ?></h1>\r
822 \r
823         <?php echo _TEXT13; ?>\r
824 \r
825 <?php } ?>\r
826 \r
827         <h1><?php echo _TITLE5; ?></h1>\r
828 \r
829         <?php echo _TEXT14; ?>\r
830 \r
831         <ul>\r
832                 <li><?php echo _TEXT14_L1; ?></li>\r
833                 <li><?php echo _TEXT14_L2; ?></li>\r
834         </ul>\r
835 \r
836         <h1><?php echo _HEADER10; ?></h1>\r
837 \r
838         <?php echo _TEXT15; ?>\r
839 \r
840                 <ul>\r
841                 <li><?php echo _TEXT15_L1; ?></li>\r
842                 <li><?php echo _TEXT15_L2; ?></li>\r
843                 </ul>\r
844 \r
845         <?php echo _TEXT15_EX; ?>\r
846 \r
847         <h1><?php echo _HEADER11; ?></h1>\r
848 \r
849         <p><?php echo _TEXT16; ?>\r
850                 <ul>\r
851                         <li><a href="<?php echo $config_adminurl?>"><?php echo _TEXT16_L1; ?></a></li>\r
852                         <li><a href="<?php echo $config_indexurl?>"><?php echo _TEXT16_L2; ?></a></li>\r
853                 </ul>\r
854         </p>\r
855 \r
856 </body>\r
857 </html>\r
858 \r
859 <?php\r
860 }\r
861 \r
862 function installCustomPlugs(&$manager) {\r
863         global $aConfPlugsToInstall, $DIR_LIBS;\r
864 \r
865         $aErrors = array();\r
866 \r
867         if (count($aConfPlugsToInstall) == 0) {\r
868                 return $aErrors;\r
869         }\r
870 \r
871         $res = sql_query('SELECT * FROM ' . sql_table('plugin') );\r
872         $numCurrent = mysql_num_rows($res);\r
873 \r
874         foreach ($aConfPlugsToInstall as $plugName) {\r
875                 // do this before calling getPlugin (in case the plugin id is used there)\r
876                 $query = 'INSERT INTO ' . sql_table('plugin') . ' (porder, pfile) VALUES (' . (++$numCurrent) . ', "' . addslashes($plugName) . '")';\r
877                 sql_query($query);\r
878 \r
879                 // get and install the plugin\r
880                 $manager->clearCachedInfo('installedPlugins');\r
881                 $plugin =& $manager->getPlugin($plugName);\r
882                 $plugin->plugid = $numCurrent;\r
883 \r
884                 if (!$plugin) {\r
885                         sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE pfile=\'' . addslashes($plugName) . '\'');\r
886                         $numCurrent--;\r
887                         array_push($aErrors, _ERROR22 . $plugName);\r
888                         continue;\r
889                 }\r
890 \r
891                 $plugin->install();\r
892         }\r
893 \r
894         // SYNC PLUGIN EVENT LIST\r
895         sql_query('DELETE FROM ' . sql_table('plugin_event') );\r
896 \r
897         // loop over all installed plugins\r
898         $res = sql_query('SELECT pid, pfile FROM ' . sql_table('plugin') );\r
899 \r
900         while($o = mysql_fetch_object($res) ) {\r
901                 $pid  =  $o->pid;\r
902                 $plug =& $manager->getPlugin($o->pfile);\r
903 \r
904                 if ($plug) {\r
905                         $eventList = $plug->getEventList();\r
906 \r
907                         foreach ($eventList as $eventName) {\r
908                                 sql_query('INSERT INTO ' . sql_table('plugin_event') . ' (pid, event) VALUES (' . $pid . ', \'' . $eventName . '\')');\r
909                         }\r
910                 }\r
911         }\r
912 \r
913         return $aErrors;\r
914 }\r
915 \r
916 function installCustomSkins(&$manager) {\r
917         global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS;\r
918 \r
919         $aErrors = array();\r
920 \r
921         if (count($aConfSkinsToImport) == 0) {\r
922                 return $aErrors;\r
923         }\r
924 \r
925         // load skinie class\r
926         include_once($DIR_LIBS . 'skinie.php');\r
927 \r
928         $importer = new SKINIMPORT();\r
929 \r
930         foreach ($aConfSkinsToImport as $skinName) {\r
931                 $importer->reset();\r
932                 $skinFile = $DIR_SKINS . $skinName . '/skinbackup.xml';\r
933 \r
934                 if (!@file_exists($skinFile) ) {\r
935                         array_push($aErrors, _ERROR23_1 . $skinFile . ' : ' . _ERROR23_2);\r
936                         continue;\r
937                 }\r
938 \r
939                 $error = $importer->readFile($skinFile);\r
940 \r
941                 if ($error) {\r
942                         array_push($aErrors, _ERROR24 . $skinName . ' : ' . $error);\r
943                         continue;\r
944                 }\r
945 \r
946                 $error = $importer->writeToDatabase(1);\r
947 \r
948                 if ($error) {\r
949                         array_push($aErrors, _ERROR24 . $skinName . ' : ' . $error);\r
950                         continue;\r
951                 }\r
952         }\r
953 \r
954         return $aErrors;\r
955 }\r
956 \r
957 // give an error if one or more nucleus are not accessible\r
958 function doCheckFiles() {\r
959         $missingfiles = array();\r
960         $files = array(\r
961                 'install.sql',\r
962                 'index.php',\r
963                 'action.php',\r
964                 'nucleus/index.php',\r
965                 'nucleus/libs/globalfunctions.php',\r
966                 'nucleus/libs/ADMIN.php',\r
967                 'nucleus/libs/BLOG.php',\r
968                 'nucleus/libs/COMMENT.php',\r
969                 'nucleus/libs/COMMENTS.php',\r
970                 'nucleus/libs/ITEM.php',\r
971                 'nucleus/libs/MEMBER.php',\r
972                 'nucleus/libs/SKIN.php',\r
973                 'nucleus/libs/TEMPLATE.php',\r
974                 'nucleus/libs/MEDIA.php',\r
975                 'nucleus/libs/ACTIONLOG.php',\r
976                 'nucleus/media.php'\r
977         );\r
978 \r
979         $count = count($files);\r
980 \r
981         for ($i = 0; $i < $count; $i++) {\r
982                 if (!is_readable($files[$i]) ) {\r
983                         array_push($missingfiles, _ERROR25_1 . $files[$i] . _ERROR25_2);\r
984                 }\r
985         }\r
986 \r
987 // The above code replaces several if statements of the form:\r
988 \r
989 //      if (!is_readable('install.sql') ) {\r
990 //              array_push($missingfiles, 'File <b>install.sql</b> is missing or not readable');\r
991 //      }\r
992 \r
993         if (count($missingfiles) > 0) {\r
994                 showErrorMessages($missingfiles);\r
995         }\r
996 }\r
997 \r
998 function updateConfig($name, $val) {\r
999         $name = addslashes($name);\r
1000         $val  = trim(addslashes($val) );\r
1001 \r
1002         $query = 'UPDATE ' . tableName('nucleus_config')\r
1003                    . " SET   value = '$val'"\r
1004                    . " WHERE name  = '$name'";\r
1005 \r
1006         mysql_query($query) or _doError(_ERROR26 . ': ' . mysql_error() );\r
1007         return mysql_insert_id();\r
1008 }\r
1009 \r
1010 function replaceDoubleBackslash($input) {\r
1011         return str_replace('\\', '/', $input);\r
1012 }\r
1013 \r
1014 function endsWithSlash($s) {\r
1015         return (strrpos($s, '/') == strlen($s) - 1);\r
1016 }\r
1017 \r
1018 /**\r
1019  * Checks if email address is valid\r
1020  */\r
1021 function _isValidMailAddress($address) {\r
1022         if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address) ) {\r
1023                 return 1;\r
1024         } else {\r
1025                 return 0;\r
1026         }\r
1027 }\r
1028 \r
1029 // returns true if the given string is a valid shortname\r
1030 // (to check short blog names and nicknames)\r
1031 // logic: starts and ends with a non space, can contain spaces in between\r
1032 //        min 2 chars\r
1033 function _isValidShortName($name) {\r
1034         if (eregi("^[a-z0-9]+$", $name) ) {\r
1035                 return 1;\r
1036         } else {\r
1037                 return 0;\r
1038         }\r
1039 }\r
1040 \r
1041 \r
1042 \r
1043 // returns true if the given string is a valid display name\r
1044 // (to check nicknames)\r
1045 function _isValidDisplayName($name) {\r
1046         if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name) ) {\r
1047                 return 1;\r
1048         } else {\r
1049                 return 0;\r
1050         }\r
1051 }\r
1052 \r
1053 function _doError($msg) {\r
1054         ?>\r
1055 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
1056 <html xmlns="http://www.w3.org/1999/xhtml">\r
1057 <head>\r
1058         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" />\r
1059         <title><?php echo _TITLE; ?></title>\r
1060         <style>@import url('nucleus/styles/manual.css');</style>\r
1061 </head>\r
1062 <body>\r
1063         <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
1064         <h1><?php echo _ERROR27; ?></h1>\r
1065 \r
1066         <p><?php echo _ERROR28; ?>: "<?php echo $msg?>";</p>\r
1067 \r
1068         <p><a href="install.php" onclick="history.back();"><?php echo _TEXT17; ?></a></p>\r
1069 </body>\r
1070 </html>\r
1071 \r
1072 <?php\r
1073         exit;\r
1074 }\r
1075 \r
1076 function showErrorMessages($errors) {\r
1077         ?>\r
1078 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
1079 <html xmlns="http://www.w3.org/1999/xhtml">\r
1080 <head>\r
1081         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" />\r
1082         <title><?php echo _TITLE; ?></title>\r
1083         <style>@import url('nucleus/styles/manual.css');</style>\r
1084 </head>\r
1085 <body>\r
1086         <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
1087         <h1><?php echo _ERROR27; ?></h1>\r
1088 \r
1089         <p><?php echo _ERROR29; ?>:</p>\r
1090 \r
1091         <ul>\r
1092 \r
1093 <?php\r
1094         while($msg = array_shift($errors) ) {\r
1095                 echo '<li>' . $msg . '</li>';\r
1096         }\r
1097 ?>\r
1098 \r
1099         </ul>\r
1100 \r
1101         <p><a href="install.php" onclick="history.back();return false;"><?php echo _TEXT17; ?></a></p>\r
1102 </body>\r
1103 </html>\r
1104 \r
1105 <?php\r
1106         exit;\r
1107 }\r
1108 \r
1109 /* for the non-php systems that decide to show the contents:\r
1110 ?></div><?php   */\r
1111 \r
1112 ?>