Changeset 25
- Timestamp:
- 2007-11-23 15:57:17 (4 years ago)
- Files:
-
- trunk/db/clean.sql (added)
- trunk/includes/lang/en.php (modified) (1 diff)
- trunk/install.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/includes/lang/en.php
r20 r25 397 397 $LANG['installer_database_success'] = 'The database has been set up successfully.'; 398 398 $LANG['installer_overall_success'] = "Congratulations! Your Spam Board has been fully set up. If you didn't see any error messages or warnings, it should now be fully functional.<br /><br />You still have some work to do, of course:<ol><li>delete this installer script</li><li>go to <a href=\"%boardurl%\">your board</a></li><li>log in with the admin account you just created</li><li>go to the Administration Panel</li><li>set up at least one category and one forum</li><li>set appropriate permissions on this forum</li><li>deactive maintainance mode in the settings</li></ol>"; 399 $LANG['installer_warning_cleanup_failed'] = "Warning: Although the installation of your board has been finished successfully, the install script didn't manage to clean every up. This isn't fatal at all, it just meant there are still a few pre-install files floating around your directory tree. If you like to have it completely clean, delete all .tmpl files in includes/config/."; 399 400 400 401 /* error messages */ trunk/install.php
r22 r25 169 169 // include new settings again 170 170 require('includes/config/settings.php'); 171 // remove settings.tmpl172 unlink('includes/config/settings.tmpl');173 171 } else { $ok = 0; } 174 172 /* initialize crypto module */ … … 187 185 // set permissions 188 186 @chmod('includes/config/crypt.php', 0660); 189 // remove template190 unlink('includes/config/crypt.tmpl');191 187 // get new crypto settings 192 188 require('includes/config/crypt.php'); … … 194 190 } else { $ok = 0; } 195 191 } else { $ok = 0; } 196 /* moveother template files to their actual names */197 if (@ rename('includes/config/bans.tmpl', 'includes/config/bans.php')) {192 /* copy other template files to their actual names */ 193 if (@copy('includes/config/bans.tmpl', 'includes/config/bans.php')) { 198 194 @chmod('includes/config/bans.php', 0660); 199 195 } else { $ok = 0; } 200 if (@ rename('includes/config/logins.tmpl', 'includes/config/logins.php')) {196 if (@copy('includes/config/logins.tmpl', 'includes/config/logins.php')) { 201 197 @chmod('includes/config/logins.php', 0660); 202 198 } else { $ok = 0; } 203 if (@ rename('includes/config/memberstages.tmpl', 'includes/config/memberstages.php')) {199 if (@copy('includes/config/memberstages.tmpl', 'includes/config/memberstages.php')) { 204 200 @chmod('includes/config/memberstages.php', 0660); 205 201 } else { $ok = 0; } … … 297 293 } 298 294 } 295 /* clean up */ 296 if ($ok == 1) { 297 // remove settings.tmpl 298 if (@unlink('includes/config/settings.tmpl')) { 299 } else { $ok = 2; } 300 // remove crypt.tmpl 301 if (@unlink('includes/config/crypt.tmpl')) { 302 } else { $ok = 2; } 303 // remove bans.tmpl 304 if (@unlink('includes/config/bans.tmpl')) { 305 } else { $ok = 2; } 306 // remove logins.tmpl 307 if (@unlink('includes/config/logins.tmpl')) { 308 } else { $ok = 2; } 309 // remove memberstages.tmpl 310 if (@unlink('includes/config/memberstages.tmpl')) { 311 } else { $ok = 2; } 312 } else { 313 // something went wrong, so remove everything from the database again 314 if ($db = @file_get_contents('db/clean.sql')) { 315 // one SQL query at a time 316 $db = explode(';', $db); 317 foreach ($db as $query) { 318 $C->query(str_replace('%prefix%', $SETTINGS['dbtableprefix'], $query)); 319 } 320 } 321 } 299 322 /* everything done */ 300 if ($ok == 1) { 323 if ($ok >= 1) { 324 if ($ok == 2) { 325 print($LANG['installer_warning_cleanup_failed'] . '<br /><br />'); 326 } 301 327 print(str_replace('%boardurl%', 'http://' . $_SERVER['HTTP_HOST'] . $SETTINGS['webpath'] , $LANG['installer_overall_success'])); 302 328 }
