Code

Updated deamon handle
[gosa.git] / gosa-core / html / main.php
index fda4f5b6f174a06d3ddfa3daba9a7246afe2c4b9..2b7f3a4a777c4599d13de67f70856572a9c77eaa 100644 (file)
@@ -30,7 +30,7 @@ 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 */
@@ -112,7 +112,7 @@ if(!session::is_set('Last_init_lang')){
 
 /* 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;
 }
 
@@ -132,7 +132,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,7 +142,12 @@ if (!session::is_set('plist')){
   $class_list= get_declared_classes();
   foreach ($class_mapping as $class => $path){
     if (!in_array($class, $class_list)){
-        require_once("$BASE_DIR/$path");
+       if (is_readable("$BASE_DIR/$path")){
+               require_once("$BASE_DIR/$path");
+       } else {
+               echo sprintf(_("Fatal error: cannot locate file '%s' - please run '%s' to fix this"), "$BASE_DIR/$path", "<b>update-gosa</b>");
+               exit;
+       }
     }
   }
   
@@ -285,7 +290,7 @@ $smarty->assign ("go_help", get_template_path('images/help.png'));
 
 /* reload navigation if language changed*/  
 if($reload_navigation){
-  $plist->menu="";;
+  $plist->menu="";
 }
 $plist->gen_headlines();
 $plist->gen_menu();