2014-04-30 09:10:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
###
|
|
|
|
# @name Installation Access
|
2015-02-01 21:08:37 +00:00
|
|
|
# @copyright 2015 by Tobias Reich
|
2014-04-30 09:10:31 +00:00
|
|
|
###
|
|
|
|
|
|
|
|
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
|
|
|
if (!defined('LYCHEE_ACCESS_INSTALLATION')) exit('Error: You are not allowed to access this area!');
|
|
|
|
|
|
|
|
class Installation extends Access {
|
|
|
|
|
|
|
|
public function check($fn) {
|
|
|
|
|
|
|
|
switch ($fn) {
|
|
|
|
|
2015-02-02 22:36:33 +00:00
|
|
|
case 'Database::createConfig': $this->dbCreateConfig(); break;
|
2014-04-30 09:10:31 +00:00
|
|
|
|
|
|
|
# Error
|
2015-03-06 22:29:55 +00:00
|
|
|
default: $this->init(); break;
|
2014-04-30 09:10:31 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private function dbCreateConfig() {
|
|
|
|
|
2014-08-29 17:55:21 +00:00
|
|
|
Module::dependencies(isset($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']));
|
|
|
|
echo Database::createConfig($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']);
|
2014-04-30 09:10:31 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-03-06 22:29:55 +00:00
|
|
|
private function init() {
|
|
|
|
|
|
|
|
$return = array(
|
|
|
|
'status' => LYCHEE_STATUS_NOCONFIG
|
|
|
|
);
|
|
|
|
|
|
|
|
echo json_encode($return);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-04-30 09:10:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|