From dc24e3181c8846202b0e48fc96e34e51be08c954 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 24 Feb 2009 13:46:52 +0000 Subject: [PATCH] Added snapshot check. -Check for missing compression extension git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13452 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_plugin.inc | 39 +++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 1c57be2cc..805190ea7 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -1320,23 +1320,50 @@ class plugin { $config = $this->config; if($config->get_cfg_value("enableSnapshots") == "true"){ + /* Check if the snapshot_base is defined */ if ($config->get_cfg_value("snapshotBase") == ""){ - msg_dialog::display(_("Configuration error"), sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."),"snapshotBase"), ERROR_DIALOG); + + /* 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 package is missing, try to install '%s'."),"php5-zip / php5-gzip"), ERROR_DIALOG); + } + return(FALSE); + } + /* check if there are special server configurations for snapshots */ if ($config->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($config->get_cfg_value($var) == ""){ - $missing .= $var." "; - msg_dialog::display(_("Configuration error"), sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."), $missing), ERROR_DIALOG); - return(FALSE); - } + if($config->get_cfg_value($var) == ""){ + $missing .= $var." "; + + /* Send message if not done already */ + if(!session::is_set("snapshotFailMessageSend")){ + ession::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); -- 2.30.2