A tumblelog CMS built on AJAX, PHP and MySQL.

install.php 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. if (!defined('entry') || !entry) {
  3. define('entry', true);
  4. }
  5. /* ===========================
  6. Sorbet CMS - A PHP based tumblelog CMS forked from Gelato CMS
  7. Sorbet CMS is a free software licensed under the GPL 3.0
  8. =========================== */
  9. // Received a valid request, better start setting globals we'll need throughout the app in entry.php
  10. require_once('entry.php');
  11. $configFile = Absolute_Path."config.php";
  12. if (file_exists($configFile)) {
  13. require_once($configFile);
  14. } else {
  15. exit('You need to rename config-sample.php to config.php and fill out the required details.');
  16. }
  17. global $user, $conf, $tumble;
  18. $install = new Install();
  19. if ($install->is_sorbet_installed()) {
  20. header("location: index.php");
  21. exit;
  22. }
  23. $util_class = new util();
  24. $install->data = $_POST;
  25. $install->check_form();
  26. $theme = new themes;
  27. $theme->set('version', $util_class->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'] : '');
  31. $theme->set('db_name', (!empty($install->data['db_name']))? $install->data['db_name'] : '');
  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_class->getThemes());
  38. for ($c=1;$c<=10;$c++) {
  39. $errores[$c] = $install->mostrarerror($c);
  40. }
  41. $theme->set('error', $errores);
  42. $theme->display(Absolute_Path.'admin/themes/admin/install.htm');