Code

Updated template
[gosa.git] / gosa-core / html / main.php
index 2b7f3a4a777c4599d13de67f70856572a9c77eaa..c265d697e50082585bccbccd46d50fa2e63e8514 100644 (file)
@@ -1,21 +1,23 @@
 <?php
 /*
-   This code is part of GOsa (https://gosa.gonicus.de)
-   Copyright (C) 2003  Cajus Pollmeier
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /* Save start time */
@@ -35,6 +37,8 @@ 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"){
@@ -142,15 +146,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 {
-               echo sprintf(_("Fatal error: cannot locate file '%s' - please run '%s' to fix this"), "$BASE_DIR/$path", "<b>update-gosa</b>");
-               exit;
-       }
+      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", "<b>update-gosa</b>"), FATAL_ERROR_DIALOG);
+        exit;
+      }
     }
   }
-  
+
   session::set('plist', new pluglist($config, $ui));
 
   /* Load ocMapping into userinfo */
@@ -159,13 +165,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 */
@@ -352,7 +361,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();
 }