summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c9b72b)
raw | patch | inline | side by side (parent: 9c9b72b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 09:36:20 +0000 (09:36 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 09:36:20 +0000 (09:36 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11100 594d385d-05f5-0310-b6e9-bd551577e9d8
15 files changed:
diff --git a/gosa-core/include/class_SnapShotDialog.inc b/gosa-core/include/class_SnapShotDialog.inc
index 4941c34ec3086a1011e7d8a85245a260a84e9e8b..fb7cb1f79c172d42183ee7a3e67e7b4e28cac252 100644 (file)
plugin::execute();
$smarty = get_smarty();
+ if(!isset($this->parent->acl_module) || !count($this->parent->acl_module)){
+ trigger_error("Could not detect acl_module in parent object (".get_class($this->parent).").");
+ return("");
+ }
+
+ $ui = get_userinfo();
+
$once = true;
foreach($_POST as $name => $value){
if((preg_match("/^RemoveSnapShot_/",$name)) && ($once)){
$once = false;
- $entry = preg_replace("/^RemoveSnapShot_/","",$name);
- $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
-
- $found = false;
- foreach($this->last_list as $t_stamp => $obj){
- if($obj['dn'] == $entry){
- $found = true;
- break;
+ $entry = preg_replace("/^RemoveSnapShot_/","",$name);
+ $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
+
+ /* Check if we are allowed to handle snapshots
+ */
+ if($ui->allow_snapshot_restore($entry,$this->parent->acl_module)){
+
+ $found = false;
+ foreach($this->last_list as $t_stamp => $obj){
+ if($obj['dn'] == $entry){
+ $found = true;
+ break;
+ }
}
- }
- if($found){
- $this->del_dn = $entry;
- $smarty= get_smarty();
- $smarty->assign("intro", sprintf(_("You're about to delete the snapshot '%s'."), @LDAP::fix($this->del_dn)));
- return($smarty->fetch (get_template_path('remove.tpl')));
+ if($found){
+ $this->del_dn = $entry;
+ $smarty= get_smarty();
+ $smarty->assign("intro", sprintf(_("You're about to delete the snapshot '%s'."), @LDAP::fix($this->del_dn)));
+ return($smarty->fetch (get_template_path('remove.tpl')));
+ }
}
}
}
/* Remove snapshot */
if(isset($_POST['delete_confirm']) && !empty($this->del_dn)){
- $this->remove_snapshot($this->del_dn);
+ if($ui->allow_snapshot_restore($this->del_dn,$this->parent->acl_module)){
+ $this->remove_snapshot($this->del_dn);
+ }
$this->del_dn = "";
}
/* We must restore a snapshot */
+
if($this->display_restore_dialog){
/* Should we only display all snapshots of already deleted objects
/* Walk through all entries and setup the display text */
foreach($tmp as $key => $entry){
- $TimeStamp = $entry['gosaSnapshotTimestamp'][0];
- $list_of_elements[$TimeStamp] = $entry;
+
+ /* Check permissions */
+ if($ui->allow_snapshot_restore($entry['dn'],$this->parent->acl_module)){
+ $TimeStamp = $entry['gosaSnapshotTimestamp'][0];
+ $list_of_elements[$TimeStamp] = $entry;
+ }
}
/* Sort generated list */
$this->last_list = $list_of_elements;
foreach($list_of_elements as $entry){
- $actions= "<input type='image' src='images/lists/restore.png' name='RestoreSnapShot_%KEY'
- class='center' title='"._("Restore snapshot")."'> ";
- $actions.= "<input type='image' src='images/lists/trash.png' name='RemoveSnapShot_%KEY'
- class='center' title='"._("Remove snapshot")."'> ";
+ $actions= "<input type='image' src='images/lists/restore.png' name='RestoreSnapShot_%KEY'
+ class='center' title='"._("Restore snapshot")."'> ";
+ $actions.= "<input type='image' src='images/lists/trash.png' name='RemoveSnapShot_%KEY'
+ class='center' title='"._("Remove snapshot")."'> ";
$time_stamp = date(_("Y-m-d, H:i:s"),preg_replace("/\-.*$/","",$entry['gosaSnapshotTimestamp'][0]));
$display_data = $entry['description'][0];
diff --git a/gosa-core/plugins/admin/acl/class_aclManagement.inc b/gosa-core/plugins/admin/acl/class_aclManagement.inc
index 7bf405a5027284716c1a25c3488182b3ecc57fd5..8aed5f6b0bbb56b8013b13f14b9d8e49316dca74 100644 (file)
var $start_pasting_copied_objects = FALSE;
var $dns = array();
+ var $acl_module = array("acl","aclroles");
+
function aclManagement(&$config, &$ui)
{
/* Save configuration for internal use */
/* Check if there is a snapshot dialog open */
$base = $this->DivListACL->selectedBase;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-core/plugins/admin/departments/class_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc
index 131a3b3e6778b0327fac82ad2db51221caf0f693..bd6d36e1b58752a0fdb715b9f9751eafefe60e40 100644 (file)
var $ObjectInSaveMode = false; // Is true, if current object wasn't saved right now
var $dns = array();
+ var $acl_module = array("department");
+
function departmentManagement (&$config, &$ui)
{
$this->ui= &$ui;
diff --git a/gosa-core/plugins/admin/groups/class_groupManagement.inc b/gosa-core/plugins/admin/groups/class_groupManagement.inc
index 70ae8ef626f943ee314eca70e62e7159ed06b05d..4137ca8f9b8f0497f242e07b0b40df385ff5d3d1 100644 (file)
var $DivListGroup = NULL;
var $ShowPrimaryCheckBox= false;
var $start_pasting_copied_objects = FALSE;
-
+ var $acl_module = "groups";
var $dns = array();
function groupManagement (&$config, &$ui)
/* Check if there is a snapshot dialog open */
$base = $this->DivListGroup->selectedBase;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc
index 6fe2d6ea249ea72cbc2b706994a5e80d81c429b4..9d5cdf1074e4e70d667a5ca6bc89231e1af9114e 100644 (file)
var $start_pasting_copied_objects = FALSE;
var $dns = array();
+ var $acl_module = array("ogroups");
function ogroupManagement (&$config, $dn= NULL)
{
/* Check if there is a snapshot dialog open */
$base = $this->DivListOGroup->selectedBase;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 2b84bfc2b87b33e3c58703e40aecf1d274e27ce8..6cd576433c9674146a6ed491ed0a6b6bc79d20fc 100644 (file)
var $start_pasting_copied_objects = FALSE;
var $msg_dialog= NULL;
-
- var $dns =array();
+ var $acl_module = array("users");
+ var $dns = array();
function userManagement(&$config, $ui)
{
/* Check if there is a snapshot dialog open */
$base = $this->DivListUsers->selectedBase;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc
index b5b335cab57fce6b48fc2a8553a90dbb74d60865..e739f52200e954712ec440fdb9d702547609a5f9 100644 (file)
var $fai_base ="";
var $fai_release ="";
+ var $acl_module = array("fai");
+
/* construction/reconstruction
*/
function faiManagement (&$config, $ui)
/* Check if there is a snapshot dialog open */
$base = $this->fai_base;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc
index 93987e40466af3fb81808bb79ae24d65dc65a7e4..649ae89f923b6c81f2ca41634e46aaefff1a443e 100644 (file)
var $CopyPasteHandler = NULL;
var $dns = array();
var $start_pasting_copied_objects = FALSE;
+
+ var $acl_module = array("gofaxlist");
function blocklist (&$config, $ui)
{
/* Check if there is a snapshot dialog open */
$base = $this->DivListBlocklist->selectedBase;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc
index 3cf6ec65d7e1100d0ab7609c098166b75596d350..f41ea11ad8db91a30bece3cff8bff8ac8af3b81c 100644 (file)
var $start_pasting_copied_objects = FALSE;
var $dns = array();
+ var $acl_module = array("gofonconference");
+
/* Initialise Class */
function phoneConferenceManagment (&$config, $ui)
{
/* Check if there is a snapshot dialog open */
$base = $this->DivListConference->selectedBase;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacroManagement.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacroManagement.inc
index 46f9d5144383a4a71ee9324eaf612829e98d7fbc..e5e7f3934a0a8b213c355257ae91f9a0d5067db4 100644 (file)
var $dns = array();
+ var $acl_module = array("gofonmacro");
+
function gofonMacro(&$config, $ui)
{
/* Save configuration for internal use */
/* Check if there is a snapshot dialog open */
$base = $this->DivListMacro->selectedBase;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc
index b00a8d29c7f1906c59989e4860bc8bdbce83f826..b4f83907f3eb9bf15762786d0735aa31ed574b83 100644 (file)
var $app_base ="";
var $app_release ="";
+ var $acl_module = array("application");
var $dns = array();
}else{
$base = $this->app_base;
}
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-plugins/goto/admin/devices/class_deviceManagement.inc b/gosa-plugins/goto/admin/devices/class_deviceManagement.inc
index 5cb193a085d0cdf8fbc562d734f8c33a7b6dd102..7b3f750f66d8280fd19d17f332e75cfd202efd1d 100644 (file)
var $dn ="";
var $dns = array();
+ var $acl_module = array("devices");
+
function deviceManagement(&$config, $dn= NULL)
{
plugin::plugin ($config, $dn);
/* Check if there is a snapshot dialog open */
$base = $this->DivListDevices->selectedBase;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc
index d911448dc5319b10503c1d5cafc44dc23377ae4f..c8f4adb73824e11f7eda5ecbe73880d2e7909857 100644 (file)
var $mime_base = "";
var $mime_release = "";
+ var $acl_module = array("mimetypes");
function IsReleaseManagementActivated()
{
}else{
$base = $this->mime_base;
}
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc b/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc
index 8ce2d16a508ad572febb853944bd98c46d06e4f0..624a6029c4fcac68f4bd126f79dda6da6bbe3473 100644 (file)
private $base = "";
private $start_pasting_copied_objects = FALSE;
+
+ public $acl_module = array("sudo");
/*! \brief */
public function __construct(&$config, &$ui)
}
/* Check if there is a snapshot dialog open */
- if($str = $this->showSnapshotDialog(sudo::get_sudoers_ou($this->config),$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog(sudo::get_sudoers_ou($this->config),$this->get_used_snapshot_bases(),$this)){
return($str);
}
diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc
index 1f115d806b3c6cf60b50d70b6f477f6a00078615..7377c5f0a4b5b43ae6b9cce8aa32c001fcdcaeac 100644 (file)
var $system_activation_object = ""; // The object to activate (NewDevice)
var $fai_activated = FALSE;
+ var $acl_module = array("incoming","terminal","workstation","server","printer","phone","winworkstation","component");
+
function systems (&$config, $ui)
{
/* Save configuration for internal use */
/* Check if there is a snapshot dialog open */
$base = $this->DivListSystem->selectedBase;
- if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
return($str);
}