From d5d545840a34fab04270698526007e6d4c01ac3f Mon Sep 17 00:00:00 2001 From: Benjamin Zapiec Date: Wed, 31 Jul 2024 10:23:48 +0200 Subject: [PATCH] use 'core' as textdomain instead of 'messages' --- html/helpviewer.php | 4 +-- html/index.php | 8 ++--- html/logout.php | 84 ++++++++++++++++++++++----------------------- html/main.php | 12 +++---- html/password.php | 4 +-- html/setup.php | 4 +-- 6 files changed, 58 insertions(+), 58 deletions(-) diff --git a/html/helpviewer.php b/html/helpviewer.php index 1a9217414..95e0fb961 100644 --- a/html/helpviewer.php +++ b/html/helpviewer.php @@ -55,10 +55,10 @@ $GLOBALS['t_language'] = $lang; $GLOBALS['t_gettext_message_dir'] = $BASE_DIR . '/locale/'; -$domain = 'messages'; +$domain = 'core'; bindtextdomain($domain, LOCALE_DIR); textdomain($domain); -@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to"); +DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to"); $smarty->compile_dir = $config->get_cfg_value("core", "templateCompileDirectory"); $smarty->assign("title", "GOsa - " . _("Help browser")); diff --git a/html/index.php b/html/index.php index d1336ed21..e73309d0e 100644 --- a/html/index.php +++ b/html/index.php @@ -162,7 +162,7 @@ function displayLogin() $config= new config(CONFIG_DIR."/".CONFIG_FILE, $BASE_DIR); session::global_set('debugLevel', $config->get_cfg_value("core", 'debugLevel')); if ($_SERVER["REQUEST_METHOD"] != "POST") { - @DEBUG(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config"); + DEBUG(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config"); } /* Enable compressed output */ @@ -197,8 +197,8 @@ function displayLogin() $GLOBALS['t_language']= $lang; $GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/'; -/* Set the text domain as 'messages' */ -$domain = 'messages'; +/* Set the text domain as 'core' */ +$domain = 'core'; bindtextdomain($domain, LOCALE_DIR); textdomain($domain); $smarty->assign('nextfield', 'username'); @@ -207,7 +207,7 @@ function displayLogin() $smarty->assign("cookies", _("Your browser has cookies disabled: please enable cookies and reload this page before logging in!")); if ($_SERVER["REQUEST_METHOD"] != "POST") { - @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to"); + DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to"); } diff --git a/html/logout.php b/html/logout.php index 9a55de4e2..5855f3f8f 100644 --- a/html/logout.php +++ b/html/logout.php @@ -21,34 +21,34 @@ */ /* Basic setup, remove eventually registered sessions */ -require_once ("../include/php_setup.inc"); -require_once ("functions.inc"); +require_once("../include/php_setup.inc"); +require_once("functions.inc"); header("Content-type: text/html; charset=UTF-8"); /* try to start session, so we can remove userlocks, if the old session is still available */ -@session::start(); -session::set('errorsAlreadyPosted',array()); -if(session::global_is_set('ui')){ - +session::start(); +session::set('errorsAlreadyPosted', array()); +if (session::global_is_set('ui')) { + /* Get config & ui informations */ - $ui= session::global_get("ui"); - - /* config used for del_user_locks & some lines below to detect the language */ - $config= session::global_get("config"); + $ui = session::global_get("ui"); + + /* config used for del_user_locks & some lines below to detect the language */ + $config = session::global_get("config"); /* Remove all locks of this user */ del_user_locks($ui->dn); - - /* Write something to log */ - new log("security","logout","",array(),"User \"".$ui->username."\" logged out") ; + + /* Write something to log */ + new log("security", "logout", "", array(), "User \"" . $ui->username . "\" logged out"); } /* Language setup */ -if ((!isset($config)) || $config->get_cfg_value("core","language") == ""){ - $lang= get_browser_language(); +if ((!isset($config)) || $config->get_cfg_value("core", "language") == "") { + $lang = get_browser_language(); } else { - $lang= $config->get_cfg_value("core","language"); + $lang = $config->get_cfg_value("core", "language"); } // Try to keep track of logouts, this will fail if our session has already expired. @@ -58,54 +58,54 @@ putenv("LANGUAGE="); putenv("LANG=$lang"); setlocale(LC_ALL, $lang); -$GLOBALS['t_language']= $lang; -$GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/'; +$GLOBALS['t_language'] = $lang; +$GLOBALS['t_gettext_message_dir'] = $BASE_DIR . '/locale/'; -/* Set the text domain as 'messages' */ -$domain = 'messages'; +/* Set the text domain as 'core' */ +$domain = 'core'; bindtextdomain($domain, LOCALE_DIR); textdomain($domain); /* Create smarty & Set template compile directory */ -$smarty= new smarty(); -if (isset($config)){ - $smarty->compile_dir= $config->get_cfg_value("core","templateCompileDirectory"); +$smarty = new smarty(); +if (isset($config)) { + $smarty->compile_dir = $config->get_cfg_value("core", "templateCompileDirectory"); } else { - $smarty->compile_dir= '/var/spool/gosa/'; + $smarty->compile_dir = '/var/spool/gosa/'; } -if(!is_writeable($smarty->compile_dir)){ +if (!is_writeable($smarty->compile_dir)) { - header('location: index.php'); - exit(); + header('location: index.php'); + exit(); } -$smarty->assign ("title","GOsa"); - +$smarty->assign("title", "GOsa"); + /* If GET request is posted, the logout was forced by pressing the link */ -if (isset($_POST['forcedlogout']) || isset($_GET['forcedlogout'])){ - +if (isset($_POST['forcedlogout']) || isset($_GET['forcedlogout'])) { + /* destroy old session */ - session::destroy (); - + session::destroy(); + /* If we're not using htaccess authentication, just redirect... */ - if (isset($config) && $config->get_cfg_value("core","htaccessAuthentication") == "true"){ + if (isset($config) && $config->get_cfg_value("core", "htaccessAuthentication") == "true") { /* Else notice that the user has to close the browser... */ - $smarty->display (get_template_path('headers.tpl')); - $smarty->display (get_template_path('logout-close.tpl')); + $smarty->display(get_template_path('headers.tpl')); + $smarty->display(get_template_path('logout-close.tpl')); exit; } - header ("Location: index.php"); + header("Location: index.php"); exit(); +} else { // The logout wasn't forced, so the session is invalid -}else{ // The logout wasn't forced, so the session is invalid - - $smarty->display (get_template_path('headers.tpl')); - $smarty->display (get_template_path('logout.tpl')); + $smarty->display(get_template_path('headers.tpl')); + $smarty->display(get_template_path('logout.tpl')); exit; } ?> - + + \ No newline at end of file diff --git a/html/main.php b/html/main.php index 397588b1b..d24c7f62e 100644 --- a/html/main.php +++ b/html/main.php @@ -33,8 +33,8 @@ /* Set header */ header("Content-type: text/html; charset=UTF-8"); -/* Set the text domain as 'messages' */ -$domain = 'messages'; +/* Set the text domain as 'core' */ +$domain = 'core'; bindtextdomain($domain, LOCALE_DIR); textdomain($domain); @@ -109,7 +109,7 @@ } -@DEBUG (DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config"); +DEBUG (DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config"); /* Set template compile directory */ $smarty->compile_dir= $config->get_cfg_value("core","templateCompileDirectory"); @@ -154,11 +154,11 @@ /* Check if the config is up to date */ $config->check_config_version(); -/* Set the text domain as 'messages' */ -$domain = 'messages'; +/* Set the text domain as 'core' */ +$domain = 'core'; bindtextdomain($domain, LOCALE_DIR); textdomain($domain); -@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to"); +DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to"); /* Prepare plugin list */ if (!session::global_is_set('plist')){ diff --git a/html/password.php b/html/password.php index c5791d26e..c82b30bdc 100644 --- a/html/password.php +++ b/html/password.php @@ -141,8 +141,8 @@ function displayPWchanger() $GLOBALS['t_language']= $lang; $GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/'; -/* Set the text domain as 'messages' */ -$domain = 'messages'; +/* Set the text domain as 'core' */ +$domain = 'core'; bindtextdomain($domain, LOCALE_DIR); textdomain($domain); diff --git a/html/setup.php b/html/setup.php index 28f512353..36961ae82 100644 --- a/html/setup.php +++ b/html/setup.php @@ -112,8 +112,8 @@ //set the template variable for setup $GLOBALS['theme'] = 'default'; -/* Set the text domain as 'messages' */ -$domain = 'messages'; +/* Set the text domain as 'core' */ +$domain = 'core'; bindtextdomain($domain, LOCALE_DIR); textdomain($domain);