A tumblelog CMS built on AJAX, PHP and MySQL.

install.php 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. if (!defined('entry') || !entry) {
  3. define('entry', true);
  4. }
  5. /* ===========================
  6. gelato CMS - A PHP based tumblelog CMS
  7. development version
  8. http://www.gelatocms.com/
  9. gelato CMS is a free software licensed under the GPL 2.0
  10. Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
  11. =========================== */
  12. // Received a valid request, better start setting globals we'll need throughout the app in entry.php
  13. require_once('entry.php');
  14. $configFile = Absolute_Path."config.php";
  15. if (file_exists($configFile)) {
  16. require_once($configFile);
  17. } else {
  18. exit('You need to rename config-sample.php to config.php and fill out the required details.');
  19. }
  20. global $user, $conf, $tumble;
  21. $install = new Install();
  22. if ($install->is_gelato_installed()) {
  23. header("location: index.php");
  24. exit;
  25. }
  26. $util_class = new util();
  27. $install->data = $_POST;
  28. $install->check_form();
  29. $theme = new themes;
  30. $theme->set('version', $util_class->version());
  31. $theme->set('showForm', $install->showForm);
  32. $theme->set('db_login', isset($install->data['db_login'])? $install->data['db_login'] : DB_User);
  33. $theme->set('db_host', (!empty($install->data['db_host']))? $install->data['db_host'] : DB_Server);
  34. $theme->set('db_name', (!empty($install->data['db_name']))? $install->data['db_name'] : DB_name);
  35. $theme->set('login', isset($install->data['login'])?$install->data['login']:'');
  36. $theme->set('email', isset($install->data['email'])?$install->data['email']:'');
  37. $theme->set('title', isset($install->data['title'])?$install->data['title']:'');
  38. $theme->set('description', isset($install->data['description'])?$install->data['description']:'');
  39. $theme->set('url_installation', isset($_SERVER['SCRIPT_URI'])?substr($_SERVER["SCRIPT_URI"], 0, -12):'');
  40. $theme->set('themes', $util_class->getThemes());
  41. for ($c=1;$c<=10;$c++) {
  42. $errores[$c] = $install->mostrarerror($c);
  43. }
  44. $theme->set('error', $errores);
  45. $theme->display(Absolute_Path.'admin/themes/admin/install.htm');