Installation.php 801 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. ###
  3. # @name Installation Access
  4. # @copyright 2015 by Tobias Reich
  5. ###
  6. if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
  7. final class Installation extends Access {
  8. public function check($fn) {
  9. switch ($fn) {
  10. case 'Config::create': $this->configCreate(); break;
  11. # Error
  12. default: $this->init(); break;
  13. }
  14. return true;
  15. }
  16. private function configCreate() {
  17. Module::dependencies(isset($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']));
  18. echo Config::create($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']);
  19. }
  20. private function init() {
  21. $return = array(
  22. 'status' => LYCHEE_STATUS_NOCONFIG
  23. );
  24. echo json_encode($return);
  25. }
  26. }
  27. ?>