8 Commits

Author SHA1 Message Date
Wruczek 6cff15964f Some people are unbelievable 2019-02-08 16:30:04 +01:00
Wruczek be9baee799 Typo... 2019-02-01 03:21:30 +01:00
Wruczek c94f166153 CSS: Set to the value, unset is less compatible 2019-02-01 03:08:34 +01:00
Wruczek 972c2e6520 Fixed a bug during installation
It set the "option" on the dbconfig and saved it to the config file as a string. Then it failed to load the file.
2019-02-01 03:05:56 +01:00
Wruczek 428e383c91 Forgot drop statements from lang sql 2019-01-30 18:12:38 +01:00
Wruczek 8cf8a26821 Updated languages 2019-01-30 18:09:21 +01:00
Wruczek d4f1efe96a Throw DB exceptions instead of silently failing 2019-01-30 15:59:55 +01:00
Wruczek 5e5fb356c7 Fixed a directory creation bug
When the cache directory for servericons was not found, the ServerIconCache tried to create one. Due to a bug, the created directory had no permissions and was inaccessible
2019-01-19 15:25:25 +01:00
6 changed files with 1626 additions and 1420 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ body {
.nav-fix-scroll { .nav-fix-scroll {
overflow: auto; overflow: auto;
max-height: 85vh; max-height: 85vh;
align-items: unset; align-items: flex-start;
} }
} }
File diff suppressed because it is too large Load Diff
+1
View File
@@ -11,6 +11,7 @@ if (!file_exists(__PRIVATE_DIR . "/vendor/autoload.php")) {
'<h3>In 2.0, the installation procedure is a little different. Go to the ' . '<h3>In 2.0, the installation procedure is a little different. Go to the ' .
'<a href="https://github.com/Wruczek/ts-website/wiki/%5BEN%5D-Website-Installation" target="_blank">wiki</a> ' . '<a href="https://github.com/Wruczek/ts-website/wiki/%5BEN%5D-Website-Installation" target="_blank">wiki</a> ' .
'and follow the installation tutorial.</h3>' . 'and follow the installation tutorial.</h3>' .
'<h2 style="color: red">Please do not contact us for help with that error. Read the wiki.</h2>' .
'Or, if you know what you are doing, run <code>composer update</code> in the ' . 'Or, if you know what you are doing, run <code>composer update</code> in the ' .
'<code>' . realpath(__BASE_DIR) . '</code> directory' '<code>' . realpath(__BASE_DIR) . '</code> directory'
); );
+9 -1
View File
@@ -43,7 +43,15 @@ if (!empty($_POST)) {
// try to connect only if dbconfig is defined // try to connect only if dbconfig is defined
if (isset($dbconfig)) { if (isset($dbconfig)) {
try { try {
$db = new Medoo($dbconfig); $errmodeException = [
"option" => [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
]
];
// Enable DB exceptions instead of silent fails, only for the Medoo
// object and not for the dbConfig, we dont want to get it saved
$db = new Medoo($dbconfig + $errmodeException);
$sqlfiles = []; $sqlfiles = [];
+1 -1
View File
@@ -23,7 +23,7 @@ class ServerIconCache {
} }
public static function syncIcons() { public static function syncIcons() {
if (!file_exists(self::$iconsCacheDir) && !mkdir(self::$iconsCacheDir, true)) { if (!file_exists(self::$iconsCacheDir) && !mkdir(self::$iconsCacheDir)) {
throw new \Exception("Cannot create icons cache directory at " . self::$iconsCacheDir); throw new \Exception("Cannot create icons cache directory at " . self::$iconsCacheDir);
} }
+9 -1
View File
@@ -2,6 +2,7 @@
namespace Wruczek\TSWebsite\Utils; namespace Wruczek\TSWebsite\Utils;
use Medoo\Medoo; use Medoo\Medoo;
use PDO;
use Wruczek\TSWebsite\Config; use Wruczek\TSWebsite\Config;
/** /**
@@ -28,7 +29,14 @@ class DatabaseUtils {
public function getDb() { public function getDb() {
if($this->db === null) { if($this->db === null) {
try { try {
$db = new Medoo($this->configUtils->getDatabaseConfig()); $config = $this->configUtils->getDatabaseConfig();
// Enable DB exceptions instead of silent fails
$config["option"] = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
];
$db = new Medoo($config);
} catch (\Exception $e) { } catch (\Exception $e) {
TemplateUtils::i()->renderErrorTemplate("DB error", "Connection to database failed", $e->getMessage()); TemplateUtils::i()->renderErrorTemplate("DB error", "Connection to database failed", $e->getMessage());
exit; exit;