Installation.php 853 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. ###
  3. # @name Installation Access
  4. # @author Tobias Reich
  5. # @copyright 2014 by Tobias Reich
  6. ###
  7. if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
  8. if (!defined('LYCHEE_ACCESS_INSTALLATION')) exit('Error: You are not allowed to access this area!');
  9. class Installation extends Access {
  10. public function check($fn) {
  11. switch ($fn) {
  12. case 'dbCreateConfig': $this->dbCreateConfig(); break;
  13. # Error
  14. default: exit('Warning: No configuration!');
  15. return false; break;
  16. }
  17. return true;
  18. }
  19. private function dbCreateConfig() {
  20. Module::dependencies(isset($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']));
  21. echo Database::createConfig($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']);
  22. }
  23. }
  24. ?>