Skip to content

Commit

Permalink
use 'core' as textdomain instead of 'messages'
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Zapiec committed Jul 31, 2024
1 parent 1249438 commit d5d5458
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 58 deletions.
4 changes: 2 additions & 2 deletions html/helpviewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
8 changes: 4 additions & 4 deletions html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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');
Expand All @@ -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");
}


Expand Down
84 changes: 42 additions & 42 deletions html/logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}
?>
</html>

</html>
12 changes: 6 additions & 6 deletions html/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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')){
Expand Down
4 changes: 2 additions & 2 deletions html/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions html/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d5d5458

Please sign in to comment.