index 412ca952620aa64733fbd3b602bd947583bc4acf..d6baecbd0a8dc231e4a8d8798e0208676c80ff86 100644 (file)
--- a/gosa-core/html/main.php
+++ b/gosa-core/html/main.php
/* Basic setup, remove eventually registered sessions */
require_once ("../include/php_setup.inc");
require_once ("functions.inc");
/* Basic setup, remove eventually registered sessions */
require_once ("../include/php_setup.inc");
require_once ("functions.inc");
-require_once ("functions_FAI.inc");
/* Set header */
header("Content-type: text/html; charset=UTF-8");
/* Set the text domain as 'messages' */
$domain = 'messages';
/* Set header */
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 */
textdomain($domain);
/* Remember everything we did after the last click */
-restore_error_handler();
session::start();
session::start();
+session::set('errorsAlreadyPosted',array());
+session::set('runtime_cache',array());
session::set('limit_exceeded',FALSE);
if ($_SERVER["REQUEST_METHOD"] == "POST"){
session::set('limit_exceeded',FALSE);
if ($_SERVER["REQUEST_METHOD"] == "POST"){
* kill session
*/
if($request_time > $max_life){
* kill session
*/
if($request_time > $max_life){
- session_unset();
+ session::destroy();
new log("security","login","",array(),"main.php called without session - logging out") ;
header ("Location: logout.php");
exit;
new log("security","login","",array(),"main.php called without session - logging out") ;
header ("Location: logout.php");
exit;
/* If last language != current force navi reload */
$lang= get_browser_language();
/* If last language != current force navi reload */
$lang= get_browser_language();
-if(session::get('Last_init_lang',$lang)){
+if(session::get('Last_init_lang') != $lang){
$reload_navigation = true;
}
$reload_navigation = true;
}
session::set('Last_init_lang',$lang);
/* Preset current main base */
session::set('Last_init_lang',$lang);
/* Preset current main base */
-if(session::is_set('CurrentMainBase')){
+if(!session::is_set('CurrentMainBase')){
session::set('CurrentMainBase',get_base_from_people($ui->dn));
}
session::set('CurrentMainBase',get_base_from_people($ui->dn));
}
/* Set the text domain as 'messages' */
$domain = 'messages';
/* 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");
textdomain($domain);
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to");
$class_list= get_declared_classes();
foreach ($class_mapping as $class => $path){
if (!in_array($class, $class_list)){
$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");
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", "<b>update-gosa</b>"), FATAL_ERROR_DIALOG);
+ exit;
+ }
}
}
}
}
-
+
session::set('plist', new pluglist($config, $ui));
/* Load ocMapping into userinfo */
session::set('plist', new pluglist($config, $ui));
/* Load ocMapping into userinfo */
session::set('ui',$ui);
}
$plist= session::get('plist');
session::set('ui',$ui);
}
$plist= session::get('plist');
-
/* Check for register globals */
if (isset($global_check) && $config->data['MAIN']['FORCEGLOBALS'] == 'true'){
/* 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.") ;
new log("security","login","",array(),"Register globals is on. For security reasons, this should be turned off.") ;
- session_destroy ();
- exit ();
+ session::destroy ();
+ exit;
}
/* Check Plugin variable */
}
/* Check Plugin variable */
/* Check for memory */
if (function_exists("memory_get_usage")){
if (memory_get_usage() > (to_byte(ini_get('memory_limit')) - 2048000 )){
/* Check for memory */
if (function_exists("memory_get_usage")){
if (memory_get_usage() > (to_byte(ini_get('memory_limit')) - 2048000 )){
- print_red(_("Warning: memory is getting low - please increase the memory_limit!"));
+ msg_dialog::display(_("Configuration warning"), _("Running out of memory!"), WARNING_DIALOG);
}
}
}
}
}
}
}
}
-/* Install eGOsa hooks, convert _POST to _SESSION['POST'] */
+/* Install eGOsa hooks, convert _POST to session */
if(isset($_GET['explorer'])){
session::set('eGosa',TRUE);
}
if(isset($_GET['explorer'])){
session::set('eGosa',TRUE);
}
/* reload navigation if language changed*/
if($reload_navigation){
/* reload navigation if language changed*/
if($reload_navigation){
- $plist->menu="";;
+ $plist->menu="";
}
$plist->gen_headlines();
$plist->gen_menu();
}
$plist->gen_headlines();
$plist->gen_menu();
$_POST[$name] = $value;
}
}
$_POST[$name] = $value;
}
}
- sess_del ('dn');
+ session::un_set ('dn');
}
}
$smarty->display(get_template_path('conflict.tpl'));
exit ();
}
$smarty->display(get_template_path('conflict.tpl'));
exit ();
}
- session::set('session_cnt',$_SESSION['session_cnt'] + 1);
+ session::set('session_cnt', (session::get('session_cnt') + 1));
session::set('post_cnt' , validate($_POST['session_cnt']) + 1);
}
}
session::set('post_cnt' , validate($_POST['session_cnt']) + 1);
}
}
if ($expired == 2){
new log("security","gosa","",array(),"password for user \"$ui->username\" is about to expire") ;
if ($expired == 2){
new log("security","gosa","",array(),"password for user \"$ui->username\" is about to expire") ;
- print_red(_("Your password is about to expire, please change your password"));
+ msg_dialog::display(_("Password reminder"), _("Your password is about to expire, please change your password!"), INFO_DIALOG);
}
}
}
}
if (is_file("$plugin_dir/main.inc")){
require_once ("$plugin_dir/main.inc");
} else {
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();
}
exit();
}