diff --git a/classes/dao.php b/classes/dao.php index cf65cb1..3408eda 100755 --- a/classes/dao.php +++ b/classes/dao.php @@ -5,25 +5,11 @@ class Dao private $conn; - private $debug = false; - - private function get_debug_mode () { - $this->debug = file_exists(__DIR__.DIRECTORY_SEPARATOR."../DEBUG"); - } - - public function __construct() { - $this->get_debug_mode(); - if ($this->debug) { - $username = 'phpmyadmin'; - $password = $this->read_password();; - $dsn = 'mysql:dbname=phpmyadmin;host=127.0.0.1'; - } else { - $username = 'accueil_insa'; - $password = $this->read_password(); - $dsn = 'mysql:dbname=accueil_insa;host=127.0.0.1'; - } + $username = 'accueil_insa'; + $password = $this->read_password(); + $dsn = 'mysql:dbname=accueil_insa;host=127.0.0.1'; try { $this->conn = new PDO($dsn, $username, $password, [PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8']); } catch (PDOException $e) { @@ -33,10 +19,7 @@ class Dao private function read_password() { - if ($this->debug) - $real_path = __DIR__.DIRECTORY_SEPARATOR.".htpassdb_debug"; - else - $real_path = __DIR__.DIRECTORY_SEPARATOR.".htpassdb"; + $real_path = __DIR__.DIRECTORY_SEPARATOR.".htpassdb"; $file = fopen($real_path, "r") or die("Unable to open DB password file!");; $password = fgets($file); fclose($file);