parent
4a9c9c220a
commit
8fb6a4c34d
|
@ -2,8 +2,8 @@
|
|||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/sessions.inc.php';
|
||||
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/vars.inc.php';
|
||||
if (file_exists('./inc/vars.local.inc.php')) {
|
||||
include_once 'inc/vars.local.inc.php';
|
||||
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/inc/vars.local.inc.php')) {
|
||||
include_once $_SERVER['DOCUMENT_ROOT'] . '/inc/vars.local.inc.php';
|
||||
}
|
||||
|
||||
// Yubi OTP API
|
||||
|
@ -47,64 +47,20 @@ catch (PDOException $e) {
|
|||
exit;
|
||||
}
|
||||
|
||||
// Set language
|
||||
$_SESSION['mailcow_locale'] = strtolower(trim($DEFAULT_LANG));
|
||||
setcookie('language', $DEFAULT_LANG);
|
||||
if (isset($_COOKIE['language'])) {
|
||||
switch ($_COOKIE['language']) {
|
||||
case "de":
|
||||
$_SESSION['mailcow_locale'] = 'de';
|
||||
setcookie('language', 'de');
|
||||
break;
|
||||
case "en":
|
||||
$_SESSION['mailcow_locale'] = 'en';
|
||||
setcookie('language', 'en');
|
||||
break;
|
||||
case "es":
|
||||
$_SESSION['mailcow_locale'] = 'es';
|
||||
setcookie('language', 'es');
|
||||
break;
|
||||
case "nl":
|
||||
$_SESSION['mailcow_locale'] = 'nl';
|
||||
setcookie('language', 'nl');
|
||||
break;
|
||||
case "pt":
|
||||
$_SESSION['mailcow_locale'] = 'pt';
|
||||
setcookie('language', 'pt');
|
||||
break;
|
||||
case "ru":
|
||||
$_SESSION['mailcow_locale'] = 'ru';
|
||||
setcookie('language', 'ru');
|
||||
break;
|
||||
|
||||
if (isset($_GET['lang']) && in_array($_GET['lang'], $AVAILABLE_LANGUAGES)) {
|
||||
$_SESSION['mailcow_locale'] = $_GET['lang'];
|
||||
}
|
||||
elseif (isset($_COOKIE['language']) && in_array($_COOKIE['language'], $AVAILABLE_LANGUAGES)) {
|
||||
$_SESSION['mailcow_locale'] = $_COOKIE['language'];
|
||||
}
|
||||
if (isset($_GET['lang'])) {
|
||||
switch ($_GET['lang']) {
|
||||
case "de":
|
||||
$_SESSION['mailcow_locale'] = 'de';
|
||||
setcookie('language', 'de');
|
||||
break;
|
||||
case "en":
|
||||
$_SESSION['mailcow_locale'] = 'en';
|
||||
setcookie('language', 'en');
|
||||
break;
|
||||
case "es":
|
||||
$_SESSION['mailcow_locale'] = 'es';
|
||||
setcookie('language', 'es');
|
||||
break;
|
||||
case "nl":
|
||||
$_SESSION['mailcow_locale'] = 'nl';
|
||||
setcookie('language', 'nl');
|
||||
break;
|
||||
case "pt":
|
||||
$_SESSION['mailcow_locale'] = 'pt';
|
||||
setcookie('language', 'pt');
|
||||
break;
|
||||
case "ru":
|
||||
$_SESSION['mailcow_locale'] = 'ru';
|
||||
setcookie('language', 'ru');
|
||||
break;
|
||||
}
|
||||
if (isset($_SESSION['mailcow_locale']) && file_exists($_SERVER['DOCUMENT_ROOT'] . '/lang/lang.'.$_SESSION['mailcow_locale'].'.php')) {
|
||||
$_SESSION['mailcow_locale'] = strtolower(trim($DEFAULT_LANG));
|
||||
}
|
||||
setcookie('language', $_SESSION['mailcow_locale']);
|
||||
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/lang/lang.en.php';
|
||||
include $_SERVER['DOCUMENT_ROOT'] . '/lang/lang.'.$_SESSION['mailcow_locale'].'.php';
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/functions.inc.php';
|
||||
|
|
|
@ -27,9 +27,12 @@ $FORM_ACTION = "previous";
|
|||
$MC_DKIM_TXTS = "/data/dkim/txt";
|
||||
$MC_DKIM_KEYS = "/data/dkim/keys";
|
||||
|
||||
// Change default language, "en", "es" "pt", "de", "ru" or "nl"
|
||||
// Change default language, "de", "en", "es", "nl", "pt", "ru"
|
||||
$DEFAULT_LANG = "en";
|
||||
|
||||
// Available languages
|
||||
$AVAILABLE_LANGUAGES = array("de", "en", "es", "nl", "pt", "ru");
|
||||
|
||||
// Change theme (default: lumen)
|
||||
// Needs to be one of those: cerulean, cosmo, cyborg, darkly, flatly, journal, lumen, paper, readable, sandstone,
|
||||
// simplex, slate, spacelab, superhero, united, yeti
|
||||
|
|
Loading…
Reference in New Issue