Translation preparation and some webgui code
This commit is contained in:
@@ -21,6 +21,7 @@ $g_db_password = 'changeme!';
|
||||
$g_db_schema = 'yms';
|
||||
|
||||
// mail settings
|
||||
$g_mail_enable = FALSE;
|
||||
$g_mailto = 'captain@example.com';
|
||||
$g_mailto_webmaster = 'webmaster@example.com';
|
||||
|
||||
@@ -34,7 +35,7 @@ $g_shapedir = 'shapes';
|
||||
|
||||
// documents and images
|
||||
$g_doc_basepath = '/var/local/yms';
|
||||
$g_doc_maxsize = 1024*1024*16; // 16 MB
|
||||
$g_doc_maxsize = 1024*1024*16; // 16 MB, please adjust php.ini accordingly!
|
||||
$g_doc_typemap = array(
|
||||
'generic' => 'doc',
|
||||
'manual' => 'doc',
|
||||
|
||||
+28
-3
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/******************************************************************************
|
||||
* YMS - Yacht Management Software
|
||||
* Copyright (C) 2024 Thomas Hooge
|
||||
* Copyright (C) 2024-2025 Thomas Hooge
|
||||
*
|
||||
* SPDX-License-Identifier: WTFPL
|
||||
******************************************************************************
|
||||
@@ -72,14 +72,39 @@ try {
|
||||
$pdo = new PDO("mysql:host=$g_db_host;dbname=$g_db_schema;charset=utf8mb4", $g_db_username, $g_db_password);
|
||||
} catch (PDOException $e) {
|
||||
echo '<pre>';
|
||||
print_r($e);
|
||||
switch ($e->getCode()) {
|
||||
case 2002:
|
||||
echo "Unable to connect to database, perhaps host info is wrong.\n";
|
||||
break;
|
||||
case 1044:
|
||||
case 1045:
|
||||
// access denied to db or generic access denied
|
||||
echo "Unable to connect to database, perhaps username or password is wrong.\n";
|
||||
break;
|
||||
case 1049:
|
||||
echo "Unable to connect to database, perhaps database name is wrong.\n";
|
||||
break;
|
||||
default:
|
||||
print_r($e);
|
||||
}
|
||||
echo '</pre>';
|
||||
exit(1);
|
||||
}
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
|
||||
# $pdo->query("SET lc_time_names='de_DE'");
|
||||
$sth = $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=0");
|
||||
try {
|
||||
$sth = $pdo->query("SELECT valint FROM settings WHERE userid=0 AND sno=0");
|
||||
} catch (PDOException $e) {
|
||||
if ($e->getCode() == 1146) {
|
||||
echo '<pre>';
|
||||
echo 'Settings table not found! Perhaps database is not initialized';
|
||||
echo '</pre>';
|
||||
exit(1)
|
||||
}
|
||||
}
|
||||
$g_db_scheme_version = $sth->fetchColumn();
|
||||
// TODO Check version
|
||||
|
||||
$user = User::GetInstance(); // There can be only one
|
||||
if ($g_scriptname != 'login.php') {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# YMS - Yacht Management System
|
||||
# Copyright (C) 2024 Thomas Hooge
|
||||
# Copyright (C) 2024-2025 Thomas Hooge
|
||||
# This file is distributed under the same license as the YMS package.
|
||||
# Thomas Hooge <thomas@hoogi.de>, 2024.
|
||||
#
|
||||
@@ -10,7 +10,7 @@ msgstr ""
|
||||
"POT-Creation-Date: 2024-04-10 17:14+0200\n"
|
||||
"PO-Revision-Date: 2024-03-15 13:50+0100\n"
|
||||
"Last-Translator: Thomas Hooge <thomas@hoogi.de>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language-Team: de <thomas@hoogi.de>\n"
|
||||
"Language: de\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
Reference in New Issue
Block a user