diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc
index 82b7bb6a57909292cd457bd806f160e58787d511..a852876df8eb608d018392f2b5c9831cafc87b05 100644 (file)
$this->dn= "new";
/* Create new usertab object */
- $this->ogroup= new ogrouptabs($this->config,
- $this->config->data['TABS']['OGROUPTABS'], $this->dn);
+ $this->ogroup= new ogrouptabs($this->config,$this->config->data['TABS']['OGROUPTABS'], $this->dn,"ogroups");
+ $this->ogroup->set_acl_base($this->DivListOGroup->selectedBase);
}
/* Load permissions for selected 'dn' and check if
we're allowed to remove this 'dn' */
- $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
- $this->acl= get_module_permission($acl, "ogroup", $this->dn);
- if (chkacl($this->acl, "delete") == ""){
+ $acl = $this->ui->get_permissions($this->dn,"ogroup");
+ if(preg_match("/d/",$acl)){
/* Check locking, save current plugin in 'back_plugin', so
the dialog knows where to return. */
/* Some nice guy may send this as POST, so we've to check
for the permissions again. */
- if (chkacl($this->acl, "delete") == ""){
+ $acl = $this->ui->get_permissions($this->dn,"groups");
+ if(preg_match("/d/",$acl)){
/* Delete request is permitted, perform LDAP action */
$this->ogroup= new ogrouptabs($this->config,
above dialog */
add_lock ($this->dn, $this->ui->dn);
- /* Set up the users ACL's for this 'dn' */
- $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
-
/* Register grouptab to trigger edit dialog */
- $this->ogroup= new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'],
- $this->dn);
- $this->ogroup->set_acl($acl);
+ $this->ogroup= new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $this->dn, "ogroups");
+ $this->ogroup->set_acl_base($this->dn);
$_SESSION['objectinfo']= $this->dn;
}
****************/
/* Finish button has been pressed */
- if ((isset($_POST['edit_finish'])) && (isset($this->ogroup->config)) ){
+ if ((isset($_POST['edit_finish']) || isset($_POST['edit_apply'])) && (isset($this->ogroup->config)) ){
/* Check tabs, will feed message array */
$message= $this->ogroup->check();
$this->ogroup->save();
gosa_log ("Object group'".$this->dn."' has been saved");
- /* Group has been saved successfully, remove lock from
- LDAP. */
- if ($this->dn != "new"){
- del_lock ($this->dn);
- }
-
- unset ($this->ogroup);
- $this->ogroup= NULL;
- unset ($_SESSION['objectinfo']);
+ if (!isset($_POST['edit_apply'])){
+ /* Group has been saved successfully, remove lock from
+ LDAP. */
+ if ($this->dn != "new"){
+ del_lock ($this->dn);
+ }
+ unset ($this->ogroup);
+ $this->ogroup= NULL;
+ unset ($_SESSION['objectinfo']);
+ }
} else {
/* Ok. There seem to be errors regarding to the tab data,
show message and continue as usual. */
/* Don't show buttons if tab dialog requests this */
if (!$this->ogroup->by_object[$this->ogroup->current]->dialog){
$display.= "<p style=\"text-align:right\">\n";
- $display.= "<input type=submit name=\"edit_finish\" value=\""._("Save")."\">\n";
+ $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
$display.= " \n";
+ if ($this->dn != "new"){
+ $display.= "<input type=submit name=\"edit_apply\" value=\""._("Apply")."\">\n";
+ $display.= " \n";
+ }
$display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
$display.= "</p>";
}
Display list
****************/
+ /* Check if there is a snapshot dialog open */
+ $base = $this->DivListOGroup->selectedBase;
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ return($str);
+ }
+
/* Display dialog with group list */
+ $this->DivListOGroup->parent = $this;
$this->DivListOGroup->execute();
/* Add departments if subsearch is disabled */
}
+ /* Return departments, that will be included within snapshot detection */
+ function get_used_snapshot_bases()
+ {
+ return(array(get_groups_ou().$this->DivListOGroup->selectedBase));
+ }
+
+
+
function convert_list($input)
{
$temp= "";
function reload()
{
/* Set base for all searches && initialise some vars */
- $this->oogrouplist= array();
+ $this->ogrouplist= array();
$base = $this->DivListOGroup->selectedBase;
$filter = "(gosaGroupObjects=[])";
$Regex = $this->DivListOGroup->Regex;
$filter= "(&(cn=$Regex)(objectClass=gosaGroupOfNames)(|$filter))";
if($this->DivListOGroup->SubSearch){
- $res= get_list($filter, $this->ui->subtreeACL, $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH);
+ $res= get_list($filter, "ogroups", $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH);
}else{
- $res= get_list($filter, $this->ui->subtreeACL, get_groups_ou().$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT );
+ $res= get_list($filter, "ogroups", get_groups_ou().$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT );
}
$this->ogrouplist= $res;