diff --git a/www/lib/Reply.php b/www/lib/Reply.php index 261ccc74..bae18c22 100644 --- a/www/lib/Reply.php +++ b/www/lib/Reply.php @@ -9,7 +9,6 @@ public static function ajax($data) $res = json_encode($data); - //die($res); return $res; } @@ -19,6 +18,8 @@ public static function ajaxDie($stat, $msg, $data_tr = '') $data['msg'] = $msg; $data['data'] = $data_tr; + http_response_code(503); + die(self::ajax($data)); } } diff --git a/www/lib/lib.php b/www/lib/lib.php index 3bcd1b76..1e8fe3ee 100644 --- a/www/lib/lib.php +++ b/www/lib/lib.php @@ -214,7 +214,7 @@ private function load_config() { private function connect() { $this->load_config(); - $this->dblink = mysqli_connect($this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname) or die(LANG_DIE_COULDNOTCONNECT); + $this->dblink = mysqli_connect($this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname) or Reply::ajaxDie('service-unavailable-error', LANG_DIE_COULDNOTCONNECT); mysqli_real_query($this->dblink, "set names utf8;"); } public static function escapeString(&$string) {