diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc
index 305fd6a9c82657f959ec9aabbd9b922856d9f7bc..a089e376c213d40a4067a728a323e966451614d4 100644 (file)
$this->dn= "new";
/* Create new usertab object */
- $this->grouptab= new grouptabs($this->config, $this->config->data['TABS']['GROUPTABS'], $this->dn);
+ $this->grouptab= new grouptabs($this->config, $this->config->data['TABS']['GROUPTABS'], $this->dn,"groups");
/* Set up the users ACL's for this 'dn' */
- $acl= get_permissions ($this->DivListGroup->selectedBase, $this->ui->subtreeACL);
- $this->grouptab->set_acl($acl);
+ $this->grouptab->set_acl_base($this->DivListGroup->selectedBase);
}
}
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->grouptab= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $this->dn);
- $this->grouptab->set_acl($acl);
+ $this->grouptab= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $this->dn,"groups");
+ $this->grouptab->set_acl_base($this->dn);
$_SESSION['objectinfo']= $this->dn;
}
return ($display);
}
+
+ /* Check if there is a snapshot dialog open */
+ $base = $this->DivListGroup->selectedBase;
+ if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
+ return($str);
+ }
+
/* Display dialog with group list */
$this->DivListGroup->parent = $this;
$this->DivListGroup->execute();
return($this->DivListGroup->Draw());
}
+
+ /* Return departments, that will be included within snapshot detection */
+ function get_used_snapshot_bases()
+ {
+ return(array(get_groups_ou().$this->DivListGroup->selectedBase));
+ }
+
+
+
function reload($CreatePosixsList=false)
{
$this->grouplist = array();
/* Collect primary groupIDs to show primary groups
if this option is enabled in gosa conf && the checkbox is checked */
if ($this->ShowPrimaryCheckBox){
- $res = get_list("(&(uid=$Regex)(!(uid=*$))(objectClass=posixAccount)(gidNumber=*))", $this->ui->subtreeACL,
- $base,array("gidNumber", "cn"), GL_SUBSEARCH);
+ $res = get_list("(&(uid=$Regex)(!(uid=*$))(objectClass=posixAccount)(gidNumber=*))",
+ "groups", $base,array("gidNumber", "cn"), GL_SUBSEARCH);
foreach ($res as $attrs){
$primaries[$attrs['gidNumber'][0]]= $attrs['cn'][0];
}
/* Collect all GroupIDs from those groups which are functional.
Only perfrom this search if ShowFunctionalGroups is unchecked, else leave arre empty */
$ff = "(&(cn=$Regex)(objectClass=posixGroup)(!(|(objectClass=gosaMailAccount)(objectClass=gosaApplicationGroup)$sfilter)))";
- $res = get_list($ff,$this->ui->subtreeACL,$base,array("gidNumber", "cn", "description"), GL_SUBSEARCH);
+ $res = get_list($ff, "groups", $base,array("gidNumber", "cn", "description"), GL_SUBSEARCH);
foreach($res as $attrs){
if (!isset($primaries[$attrs['gidNumber'][0]])){
$functional[$attrs['gidNumber'][0]]= $attrs['gidNumber'][0];
$attrs = array("cn", "description", "gidNumber", "objectClass","FAIrelease");
if ($SubSearch){
- $res= get_list($filter, $this->ui->subtreeACL, $base, $attrs, GL_SIZELIMIT| GL_SUBSEARCH);
+ $res= get_list($filter, "groups", $base, $attrs, GL_SIZELIMIT| GL_SUBSEARCH);
} else {
- $res= get_list($filter, $this->ui->subtreeACL, get_groups_ou().$base, $attrs, GL_SIZELIMIT);
+ $res= get_list($filter, "groups", get_groups_ou().$base, $attrs, GL_SIZELIMIT);
}
/* Sort values into grouplist*/
function save_object()
{
$this->DivListGroup->save_object();
- $once = true;
- foreach($_POST as $name => $value){
-
- /* Create a new snapshot, display a dialog */
- if(preg_match("/^CreateSnapShot_/",$name) && $once){
- $once = false;
- $entry = preg_replace("/^CreateSnapShot_/","",$name);
- $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
- $this->grouptab = new SnapShotDialog($this->config,$entry,$this);
- }
-
- /* Restore a snapshot, display a dialog with all snapshots of the current object */
- if(preg_match("/^RestoreSnapShot_/",$name) && $once){
- $once = false;
- $entry = preg_replace("/^RestoreSnapShot_/","",$name);
- $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
- $this->grouptab = new SnapShotDialog($this->config,$entry,$this);
- $this->grouptab->Restore = true;
- }
-
- /* Restore one of the already deleted objects */
- if(preg_match("/^RestoreDeletedSnapShot_/",$name) && $once){
- $once = false;
- $entry = get_groups_ou().$this->DivListGroup->selectedBase;
- $this->grouptab = new SnapShotDialog($this->config,$entry,$this);
- $this->grouptab->Restore = true;
- $this->grouptab->DeletedOnes = true;
- }
- }
-
- /* Create a new snapshot requested, check
- the given attributes and create the snapshot*/
- if(isset($_POST['CreateSnapshot'])){
- $this->grouptab->save_object();
- $msgs = $this->grouptab->check();
- if(count($msgs)){
- foreach($msgs as $msg){
- print_red($msg);
- }
- }else{
- $this->dn = $this->grouptab->dn;
- $this->create_snapshot("snapshot",$this->grouptab->CurrentDescription);
- $this->grouptab = NULL;
- }
- }
-
- /* Restore is requested, restore the object with the posted dn .*/
- if((isset($_POST['RestoreSnapshot'])) && (isset($_POST['SnapShot']))){
- $entry =trim($_POST['SnapShot']);
- if(!empty($entry)){
- $entry = base64_decode($entry);
- $this->restore_snapshot($entry);
- $this->grouptab = NULL;
- }
- }
}
function check() { }
function adapt_from_template($dn) { }
function password_change_needed() { }
- function show_header($button_text, $text, $disabled= FALSE) { }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>