A tumblelog CMS built on AJAX, PHP and MySQL.

install.php 1.9KB

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