diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc
index f1c1f14d1e8a57b4c89bd2d1057b3fae47d15a72..637abae5b9309b5a85f151b73377625fdc7b912a 100644 (file)
if((isset($this->config->data['MAIN']['ENABLECOPYPASTE']))&&(preg_match("/true/i",$this->config->data['MAIN']['ENABLECOPYPASTE']))){
$this->CopyPasteHandler = new CopyPasteHandler($this->config);
}
-
+
/* Detect if we have to display the primary group checkbox */
+ $tmp = "";
if (isset($this->config->data['MAIN']['NOPRIMARYGROUP'])){
+ $tmp = $this->config->data['MAIN']['NOPRIMARYGROUP'];
+ }
+ if(preg_match("/true/i",$tmp)|| (preg_match("/yes/",$tmp))){
$this->ShowPrimaryCheckBox = false;
} else {
$this->ShowPrimaryCheckBox = true;
/* Finish group edit is triggered by the tabulator dialog, so
the user wants to save edited data. Check and save at this
point. */
- if ((isset($_POST['edit_finish'])) && (isset($this->grouptab->config)) ){
+ if ((isset($_POST['edit_finish']) || isset($_POST['edit_apply'])) && (isset($this->grouptab->config)) ){
/* Check tabs, will feed message array
Save, or display error message? */
$this->grouptab->save();
gosa_log ("Group object'".$this->dn."' has been saved");
- /* Group has been saved successfully, remove lock from LDAP. */
- if ($this->dn != "new"){
- del_lock ($this->dn);
+ if (!isset($_POST['edit_apply'])){
+ /* Group has been saved successfully, remove lock from LDAP. */
+ if ($this->dn != "new"){
+ del_lock ($this->dn);
+ }
+
+ /* There's no page reload so we have to read new users at this point. */
+ //$this->reload ();
+ unset ($this->grouptab);
+ $this->grouptab= NULL;
+ unset ($_SESSION['objectinfo']);
}
-
- /* There's no page reload so we have to read new users at this point. */
- //$this->reload ();
- unset ($this->grouptab);
- $this->grouptab= NULL;
- unset ($_SESSION['objectinfo']);
-
} else {
/* Ok. There seem to be errors regarding to the tab data,
show message and continue as usual. */
/* Cancel dialogs */
if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){
- del_lock ($this->grouptab->dn);
+ if(isset($this->grouptab->dn)){
+ del_lock ($this->grouptab->dn);
+ }
unset ($this->grouptab);
$this->grouptab= NULL;
unset($_SESSION['objectinfo']);
$display= $this->grouptab->execute();
/* Don't show buttons if tab dialog requests this */
- if (!$this->grouptab->by_object[$this->grouptab->current]->dialog){
- $display.= "<p style=\"text-align:right\">\n";
- $display.= "<input type=submit name=\"edit_finish\" value=\""._("Save")."\">\n";
- $display.= " \n";
- $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
- $display.= "</p>";
+ if(isset($this->grouptab->by_object)){
+ if (!$this->grouptab->by_object[$this->grouptab->current]->dialog){
+ $display.= "<p style=\"text-align:right\">\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>";
+ }
}
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();
/* Add departments if subsearch is disabled */
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();
/* Prepare ldap class */
$ldap= $this->config->get_ldap_link();
$ldap->cd($base);
+ $ldap->set_size_limit($_SESSION['size_limit']);
/********************
Create filter depending on selected checkboxes
********************/
- /* Add Mail Groups */
- if ($ShowMailGroups){
- $filter.= "(objectClass=gosaMailAccount)";
- }
-
/* Add application groups */
if ($ShowApplicationGroups){
$filter.= "(objectClass=gosaApplicationGroup)";
}
+
+ /* Add Mail Groups */
+ if ($ShowMailGroups){
+ $filter.= "(objectClass=gosaMailAccount)";
+ }
- /*
- #FIXME Why is "sfilter" or "filter" set ?
- Please verify && add comment
- */
$sfilter= "";
if ($this->config->current['SAMBAVERSION'] == 3){
if (!$ShowPrimaryGroups){
********************/
/* Collect primary groupIDs to show primary groups
- if this option is enabled in gosa conf && the checkbox is checked */
- if(($this->ShowPrimaryCheckBox) && ($ShowPrimaryGroups)){
- $ldap->search("(&(uid=$Regex)(!(uid=*$))(objectClass=posixAccount)(gidNumber=*))", array("gidNumber", "cn"));
- show_ldap_error($ldap->get_error());
- while ($attrs= $ldap->fetch()){
+ 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);
+ 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 */
- if(!$ShowFunctionalGroups){
- $ldap->cd(get_groups_ou().$base);
- $ldap->set_size_limit($_SESSION['size_limit']);
- $ldap->search("(&(cn=$Regex)(objectClass=posixGroup)(!(|(objectClass=gosaMailAccount)(objectClass=gosaApplicationGroup)$sfilter)))", array("cn", "gidNumber", "description"));
- $error2= $ldap->error;
- while ($attrs= $ldap->fetch()){
- if (!isset($primaries[$attrs['gidNumber'][0]])){
- $functional[$attrs['gidNumber'][0]]= $attrs['gidNumber'][0];
- }
+ 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);
+ foreach($res as $attrs){
+ if (!isset($primaries[$attrs['gidNumber'][0]])){
+ $functional[$attrs['gidNumber'][0]]= $attrs['gidNumber'][0];
}
}
-
+
/********************
Search for the prepared filter
********************/
-
+
/* If subsearch is activated search for subobjects too */
- $attrs = array("cn", "description", "gidNumber", "objectClass");
+ $attrs = array("cn", "description", "gidNumber", "objectClass","FAIrelease");
if ($SubSearch){
$res= get_list($filter, $this->ui->subtreeACL, $base, $attrs, GL_SIZELIMIT| GL_SUBSEARCH);
/* Sort values into grouplist*/
$tmp = $tmp2 = array();
foreach ($res as $value){
-
/* Skip functional groups if checkbox isn't checked */
if (!$ShowFunctionalGroups && isset($functional[$value['gidNumber'][0]])){
continue;
}
/* If gidNumber is in $primaries skip this entry */
- if (!isset($primaries[$value['gidNumber'][0]])){
+ if (($ShowPrimaryGroups) || (!$ShowPrimaryGroups && !isset($primaries[$value['gidNumber'][0]]))){
$tmp2[$value['cn'][0]] = $value;
$tmp [$value['cn'][0]] = $value['cn'][0];
}
return( $str);
};
/* Ensure that the new object is shown in the list now */
- $this->relaod();
+ $this->reload();
}
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:
?>