summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c0af48)
raw | patch | inline | side by side (parent: 6c0af48)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 13 Jun 2006 07:17:46 +0000 (07:17 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 13 Jun 2006 07:17:46 +0000 (07:17 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3791 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_plugin.inc | patch | blob | history | |
plugins/admin/systems/class_divListSystem.inc | patch | blob | history |
index b4f7b1efbcb9e802bb73319446a9a303dd8ea515..b30cdcb1d67c5303fb3a6ed6b4dd3ece7e049f52 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
/* Create a snapshot of the current object */
function create_snapshot($type= "snapshot", $description= array())
{
+ if(!$this->snapshotEnabled()) return;
+
/* Create 2 ldap connections
one connection points to the snapshot server and
one to our basic ldap server */
}
}
+
+ /* returns true if snapshots are enabled */
+ function snapshotEnabled()
+ {
+ $tmp = $this->config->data['MAIN'];
+ if(isset($tmp['ENABLE_SNAPSHOT'])){
+ if (preg_match("/^true$/i", $tmp['ENABLE_SNAPSHOT']) || preg_match("/yes/i", $tmp['ENABLE_SNAPSHOT'])){
+ return(TRUE);
+ }
+ }
+ return(false);
+ }
+
/* Return available snapshots for the given base
*/
function Available_SnapsShots($dn,$raw = false)
{
+ if(!$this->snapshotEnabled()) return(array());
+
/* Create an additional ldap object which
points to our ldap snapshot server */
$ldap= $this->config->get_ldap_link();
$tmp = $this->config->data['MAIN'];
if(!isset($tmp['SNAPSHOT_BASE'])){
- print_red(_("Please specify the attribute SNAPSHOT_SERVER in your gosa.conf."));
+ print_red(_("Please specify the attribute SNAPSHOT_BASE in your gosa.conf."));
return(array());
}
array("gosaSnapshotType","gosaSnapshotTimestamp","gosaSnapshotDN","description"));
/* Put results into a list and add description if missing */
- while($entry = $ldap->fetch()){
+ while($entry = $ldap_to->fetch()){
if(!isset($entry['description'][0])){
$entry['description'][0] = "";
}
function getAllDeletedSnapshots($base_of_object,$raw = false)
{
+ if(!$this->snapshotEnabled()) return(array());
/* Create an additional ldap object which
points to our ldap snapshot server */
/* Restore selected snapshot */
function restore_snapshot($dn)
{
+ if(!$this->snapshotEnabled()) return(array());
+
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
$tmp = $this->config->data['MAIN'];
diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc
index d92ffacbe4d3c27b934451217b343857428aba23..d926756144f1d6637dd1f6b027070efa8e0d4971 100644 (file)
" <input class='center' type='image' align='middle' src='images/list_home.png'
title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'> ".
" <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='". _("Submit")."'> ".
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- " <input class='center' type='image' align='middle' src='images/list_back.png'
- title='"._("Go up one department")."' alt='"._("Up")."' name='RestoreDeletedSnapShot'>".
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- " <input class='center' type='image' align='middle' src='images/select_new_terminal.png'
+ " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+
+ if($this->parent->snapshotEnabled()){
+ $listhead .= " <input class='center' type='image' align='middle' src='images/restore.png'
+ title='"._("Restore objects")."' alt='"._("Up")."' name='RestoreDeletedSnapShot'>".
+ " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ }
+
+ $listhead .= " <input class='center' type='image' align='middle' src='images/select_new_terminal.png'
name='newsystem_terminal' alt='"._("New Terminal template")."' title='"._("New Terminal")."'>".
" <input class='center' type='image' align='middle' src='images/select_new_workstation.png'
name='newsystem_workstation' alt='"._("New Workstation template")."' title='"._("New Workstation")."'>".
function GetSnapShotActions($dn)
{
$str = "";
- $str .="<input class='center' type='image' src='images/snapshot.png'
- alt='"._("Create snapshot")."' name='CreateSnapShot_".base64_encode($dn)."' title='"._("Create snapshot")."'> ";
-
- if(count($this->parent->Available_SnapsShots($dn))){
- $str .="<input class='center' type='image' src='images/restore.png'
- alt='"._("Restore snapshot")."' name='RestoreSnapShot_".base64_encode($dn)."' title='"._("Restore snapshot")."'> ";
- }else{
- $str.= "<img src='images/empty.png' style='width:16px;' class='center'> ";
+
+ if($this->parent->snapshotEnabled()){
+
+ $str .="<input class='center' type='image' src='images/snapshot.png'
+ alt='"._("Create snapshot")."' name='CreateSnapShot_".base64_encode($dn)."' title='"._("Create snapshot")."'> ";
+
+ if(count($this->parent->Available_SnapsShots($dn))){
+ $str .="<input class='center' type='image' src='images/restore.png'
+ alt='"._("Restore snapshot")."' name='RestoreSnapShot_".base64_encode($dn)."' title='"._("Restore snapshot")."'> ";
+ }else{
+ $str.= "<img src='images/empty.png' style='width:16px;' class='center'> ";
+ }
}
return($str);
}