diff --git a/admin/themes/admin/install.htm b/admin/themes/admin/install.htm new file mode 100644 index 0000000..2a94ecb --- /dev/null +++ b/admin/themes/admin/install.htm @@ -0,0 +1,168 @@ + + + + + + gelato :: installation + + + + +
+ + +
+ {if {$showForm}} +
+ + +
+
+
+ Database Settings +
    +
  • + {error.10}
  • +
  • +
  • +
  • + {error.9}
  • +
  • + {error.7}
  • +
  • + {error.8}
  • +
+

+
+ Admin user +
    +
  • + {error.1}
  • +
  • + {error.2}
  • +
  • + {error.3}
  • +
  • + {error.4}
  • +
+

+
+ Tumblelog configuration +
    +
  • +
  • +
  • +
  • +
  • + {error.5}
  • +
  • +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+

+ + + + +

+
+
+ +
+ {else} +

Finished!

+

Now you can log in with your username and password

+ {/if} +
+ +
+ + \ No newline at end of file diff --git a/classes/install.class.php b/classes/install.class.php index d838882..9baf222 100644 --- a/classes/install.class.php +++ b/classes/install.class.php @@ -141,11 +141,9 @@ class Install { } function inerrors($n) { - if ( strpos($this->errors,$n)===false) { + if(strpos($this->errors,(string)$n)===false) return false; - } else { - return true; - } + return true; } function mostrarerror($n) { diff --git a/install.php b/install.php index 1d06045..91dd6cf 100644 --- a/install.php +++ b/install.php @@ -18,192 +18,33 @@ $configFile = Absolute_Path."config.php"; if(file_exists($configFile)){ require_once($configFile); }else{ - exit("You need to rename config-sample.php to config.php and fill out the required details."); + exit('You need to rename config-sample.php to config.php and fill out the required details.'); } global $user, $conf, $tumble; $install = new Install(); +if($install->is_gelato_installed()){ + header("location: index.php"); + exit; +} $install->data = $_POST; $install->check_form(); +$theme = new themes; +$theme->set('version',version()); +$theme->set('showForm',$install->showForm); + +$theme->set('db_login',isset($install->data['db_login'])? $install->data['db_login'] : ''); +$theme->set('db_host',(!empty($install->data['db_host']))? $install->data['db_host'] : 'localhost'); +$theme->set('db_name',(!empty($install->data['db_name']))? $install->data['db_name'] : 'gelatocms'); +$theme->set('login',isset($install->data['login'])?$install->data['login']:''); +$theme->set('email',isset($install->data['email'])?$install->data['email']:''); +$theme->set('title',isset($install->data['title'])?$install->data['title']:''); +$theme->set('description',isset($install->data['description'])?$install->data['description']:''); +$theme->set('url_installation',isset($_SERVER['SCRIPT_URI'])?substr($_SERVER["SCRIPT_URI"], 0, -12):''); +$theme->set('themes',getThemes()); + +for($c=1;$c<=10;$c++)$errores[$c] = $install->mostrarerror($c); +$theme->set('error',$errores); + +$theme->display(Absolute_Path.'admin/themes/admin/install.htm'); ?> - - - - - - gelato :: installation - - - - -
- - -
- -showForm) { -?> - -
- - -
-
-
- Database Settings -
    -
  • - mostrarerror("10")?>
  • -
  • -
  • -
  • - mostrarerror("9")?>
  • -
  • - mostrarerror("7")?>
  • -
  • - mostrarerror("8")?>
  • -
-

-
- Admin user -
    -
  • - mostrarerror("1")?>
  • -
  • - mostrarerror("2")?>
  • -
  • - mostrarerror("3")?>
  • -
  • - mostrarerror("4")?>
  • -
-

-
- Tumblelog configuration -
    -
  • -
  • -
  • -
  • -
  • - " class="txt"/>mostrarerror("5")?>
  • -
  • -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
-

- - - - -

-
-
- -
- -Finished!

"; - echo "

Now you can log in with your username and password

"; - } - -?> -
- - -
- - \ No newline at end of file