Commit 6073c832 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes: #2592 PHP error: Undefined index: rtl

Showing with 29 additions and 30 deletions
+29 -30
<?php <?php
/* /*
This code is part of FusionDirectory (http://www.fusiondirectory.org/) This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier Copyright (C) 2003-2010 Cajus Pollmeier
...@@ -43,25 +42,25 @@ require_once("../setup/class_setupStep_Finish.inc"); ...@@ -43,25 +42,25 @@ require_once("../setup/class_setupStep_Finish.inc");
header("Content-type: text/html; charset=UTF-8"); header("Content-type: text/html; charset=UTF-8");
/* Set cookie lifetime to one day (The parameter is in seconds ) */ /* Set cookie lifetime to one day (The parameter is in seconds ) */
session_set_cookie_params(24*60*60); session_set_cookie_params(24 * 60 * 60);
session_cache_expire(60*24); // default is 180 session_cache_expire(60 * 24); // default is 180
ini_set("session.gc_maxlifetime",24*60*60); ini_set("session.gc_maxlifetime", 24 * 60 * 60);
/* Start session */ /* Start session */
session::start(); session::start();
session::global_set('DEBUGLEVEL',1); session::global_set('DEBUGLEVEL', 1);
session::set('errorsAlreadyPosted',array()); session::set('errorsAlreadyPosted', array());
/* Attribute initialization, reset errors */ /* Attribute initialization, reset errors */
reset_errors(); reset_errors();
/* Set template compile directory */ /* Set template compile directory */
$smarty->compile_dir= SPOOL_DIR; $smarty->compile_dir = SPOOL_DIR;
/* Check for compile directory */ /* Check for compile directory */
if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))){ if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))) {
msg_dialog::display(_("Smarty"),sprintf(_("Directory '%s' specified as compile directory is not accessible!"), msg_dialog::display(_("Smarty"), sprintf(_("Directory '%s' specified as compile directory is not accessible!"),
$smarty->compile_dir),FATAL_ERROR_DIALOG); $smarty->compile_dir), FATAL_ERROR_DIALOG);
exit(); exit();
} }
...@@ -96,8 +95,9 @@ if (!preg_match("/utf(-)8$/i", $lang)) { ...@@ -96,8 +95,9 @@ if (!preg_match("/utf(-)8$/i", $lang)) {
putenv("LANGUAGE="); putenv("LANGUAGE=");
putenv("LANG=$lang"); putenv("LANG=$lang");
setlocale(LC_ALL, $lang); setlocale(LC_ALL, $lang);
$GLOBALS['t_language'] = $lang; $GLOBALS['t_language'] = $lang;
$GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/'; $GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/';
$smarty->assign("rtl", language_is_rtl($lang));
/* Set the text domain as 'fusiondirectory' */ /* Set the text domain as 'fusiondirectory' */
$domain = 'fusiondirectory'; $domain = 'fusiondirectory';
...@@ -115,34 +115,33 @@ $header = $smarty->fetch(get_template_path('headers.tpl')); ...@@ -115,34 +115,33 @@ $header = $smarty->fetch(get_template_path('headers.tpl'));
/* Set focus to the error button if we've an error message */ /* Set focus to the error button if we've an error message */
$focus= ""; $focus = "";
if (session::is_set('errors') && session::get('errors') != ""){ if (session::is_set('errors') && session::get('errors') != "") {
$focus= '<script type="text/javascript">'; $focus = '<script type="text/javascript">';
$focus.= 'document.forms[0].error_accept.focus();'; $focus .= 'document.forms[0].error_accept.focus();';
$focus.= '</script>'; $focus .= '</script>';
} }
$focus= '<script type="text/javascript">'; $focus = '<script type="text/javascript">';
$focus.= 'next_msg_dialog();'; $focus .= 'next_msg_dialog();';
$focus.= '</script>'; $focus .= '</script>';
/* show web frontend */ /* show web frontend */
$setup = session::global_get('setup'); $setup = session::global_get('setup');
$smarty->assign("contents" , $display); $smarty->assign("contents", $display);
$smarty->assign("navigation", $setup->get_navigation_html()); $smarty->assign("navigation", $setup->get_navigation_html());
$smarty->assign("header", $setup->get_header_html()); $smarty->assign("header", $setup->get_header_html());
$smarty->assign("bottom", $focus.$setup->get_bottom_html()); $smarty->assign("bottom", $focus.$setup->get_bottom_html());
$smarty->assign("msg_dialogs", msg_dialog::get_dialogs()); $smarty->assign("msg_dialogs", msg_dialog::get_dialogs());
if ($error_collector != ""){ if ($error_collector != "") {
$smarty->assign("php_errors", preg_replace("/%BUGBODY%/",$error_collector_mailto,$error_collector)."</div>"); $smarty->assign("php_errors", preg_replace("/%BUGBODY%/", $error_collector_mailto, $error_collector)."</div>");
} else { } else {
$smarty->assign("php_errors", ""); $smarty->assign("php_errors", "");
} }
$smarty->assign("version",FD_VERSION); $smarty->assign("version", FD_VERSION);
echo $header.$smarty->fetch("$BASE_DIR/setup/setup_frame.tpl"); echo $header.$smarty->fetch("$BASE_DIR/setup/setup_frame.tpl");
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?> ?>
  • bmortier @bmortier

    mentioned in issue #874

    By bmortier on 2017-09-02T15:01:59 (imported from GitLab)

    ·

    mentioned in issue #874

    By bmortier on 2017-09-02T15:01:59 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment