X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_config.inc;h=6dd0527b8a45e7755245a8970ae7d97ea7a8e744;hb=7db39a804ab721db300683f505c87b9c2b8808a5;hp=67b91314c67ac8eff7aa184b79e28ccbfb0c43d5;hpb=7bbd7aa8f40e2936d800a3d006960d2af0f08f9a;p=gosa.git diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index 67b91314c..6dd0527b8 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -244,7 +244,8 @@ class config { $cache = session::global_get('HTTP_GOSA_KEY_CACHE'); if(!isset($cache[$creds])){ $cache[$creds] = cred_decrypt($creds, $_SERVER['HTTP_GOSA_KEY']); - } + session::global_set('HTTP_GOSA_KEY_CACHE',$cache); + } return ($cache[$creds]); } return ($creds); @@ -1004,6 +1005,63 @@ class config { return(TRUE); } } + + /* Returns true if snapshots are enabled, and false if it is disalbed + There will also be some errors psoted, if the configuration failed */ + function snapshotEnabled() + { + if($this->get_cfg_value("enableSnapshots") == "true"){ + + /* Check if the snapshot_base is defined */ + if ($this->get_cfg_value("snapshotBase") == ""){ + + /* Send message if not done already */ + if(!session::is_set("snapshotFailMessageSend")){ + session::set("snapshotFailMessageSend",TRUE); + msg_dialog::display(_("Configuration error"), + sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."), + "snapshotBase"), ERROR_DIALOG); + } + return(FALSE); + } + + /* Check if the snapshot_base is defined */ + if (!is_callable("gzcompress")){ + + /* Send message if not done already */ + if(!session::is_set("snapshotFailMessageSend")){ + session::set("snapshotFailMessageSend",TRUE); + msg_dialog::display(_("Configuration error"), + sprintf(_("The snapshot functionality is enabled, but the required compression module is missing. Please install '%s'."),"php5-zip / php5-gzip"), ERROR_DIALOG); + } + return(FALSE); + } + + /* check if there are special server configurations for snapshots */ + if ($this->get_cfg_value("snapshotURI") != ""){ + + /* check if all required vars are available to create a new ldap connection */ + $missing = ""; + foreach(array("snapshotURI","snapshotAdminDn","snapshotAdminPassword","snapshotBase") as $var){ + if($this->get_cfg_value($var) == ""){ + $missing .= $var." "; + + /* Send message if not done already */ + if(!session::is_set("snapshotFailMessageSend")){ + session::set("snapshotFailMessageSend",TRUE); + msg_dialog::display(_("Configuration error"), + sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."), + $missing), ERROR_DIALOG); + } + return(FALSE); + } + } + } + return(TRUE); + } + return(FALSE); + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: