A tumblelog CMS built on AJAX, PHP and MySQL.

install.php 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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('login',isset($install->data['login'])?$install->data['login']:'');
  31. $theme->set('email',isset($install->data['email'])?$install->data['email']:'');
  32. $theme->set('title',isset($install->data['title'])?$install->data['title']:'');
  33. $theme->set('description',isset($install->data['description'])?$install->data['description']:'');
  34. $theme->set('url_installation',(isset($install->data['url_installation']) and $install->data['url_installation'])?$install->data['url_installation']:(isset($_SERVER['SCRIPT_URI'])?substr($_SERVER["SCRIPT_URI"], 0, -12):''));
  35. $theme->set('themes',util::getThemes());
  36. $theme->set('langs',util::getLangs());
  37. for($c=1;$c<=10;$c++)$errores[$c] = $install->mostrarerror($c);
  38. $theme->set('error',$errores);
  39. $theme->display(Absolute_Path.'admin/themes/admin/install.htm');
  40. ?>