X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fhtml%2Fmain.php;h=d6baecbd0a8dc231e4a8d8798e0208676c80ff86;hb=a2eec6ac24459bca81a633699d8cc2979d1dd586;hp=be0b728693130d99698fe63fee2c33830f241c3f;hpb=36d6bda3b848873e8531f725e12b45fc31e962e7;p=gosa.git diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index be0b72869..d6baecbd0 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -30,11 +30,13 @@ header("Content-type: text/html; charset=UTF-8"); /* Set the text domain as 'messages' */ $domain = 'messages'; -bindtextdomain($domain, "$BASE_DIR/locale"); +bindtextdomain($domain, LOCALE_DIR); textdomain($domain); /* Remember everything we did after the last click */ session::start(); +session::set('errorsAlreadyPosted',array()); +session::set('runtime_cache',array()); session::set('limit_exceeded',FALSE); if ($_SERVER["REQUEST_METHOD"] == "POST"){ @@ -132,7 +134,7 @@ $GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/'; /* Set the text domain as 'messages' */ $domain = 'messages'; -bindtextdomain($domain, "$BASE_DIR/locale"); +bindtextdomain($domain, LOCALE_DIR); textdomain($domain); @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to"); @@ -142,10 +144,17 @@ if (!session::is_set('plist')){ $class_list= get_declared_classes(); foreach ($class_mapping as $class => $path){ if (!in_array($class, $class_list)){ + if (is_readable("$BASE_DIR/$path")){ require_once("$BASE_DIR/$path"); + } else { + msg_dialog::display(_("Fatal error"), + sprintf(_("Cannot locate file '%s' - please run '%s' to fix this"), + "$BASE_DIR/$path", "update-gosa"), FATAL_ERROR_DIALOG); + exit; + } } } - + session::set('plist', new pluglist($config, $ui)); /* Load ocMapping into userinfo */ @@ -154,13 +163,16 @@ if (!session::is_set('plist')){ session::set('ui',$ui); } $plist= session::get('plist'); - /* Check for register globals */ if (isset($global_check) && $config->data['MAIN']['FORCEGLOBALS'] == 'true'){ - echo _("FATAL: Register globals is on. GOsa will refuse to login unless this is fixed by an administrator."); + msg_dialog::display( + _("PHP configuration"), + _("FATAL: Register globals is on. GOsa will refuse to login unless this is fixed by an administrator."), + FATAL_ERROR_DIALOG); + new log("security","login","",array(),"Register globals is on. For security reasons, this should be turned off.") ; session::destroy (); - exit (); + exit; } /* Check Plugin variable */ @@ -347,7 +359,10 @@ if((isset($config->data['MAIN']['ACCOUNT_EXPIRATION'])) && if (is_file("$plugin_dir/main.inc")){ require_once ("$plugin_dir/main.inc"); } else { - echo sprintf(_("FATAL: Can't find any plugin definitions for plugin '%s'!"), $plug); + msg_dialog::display( + _("Plugin"), + sprintf(_("FATAL: Can't find any plugin definitions for plugin '%s'!"), $plug), + FATAL_ERROR_DIALOG); exit(); }