diff --git a/gosa-core/plugins/admin/groups/class_group.inc b/gosa-core/plugins/admin/groups/class_group.inc
index e570f1244cd9c855929472ee1522e86aba353e06..6860f8e1a4f7997659ff28e80b0fe859510b8dee 100644 (file)
var $multiple_support = TRUE;
var $multiple_support = TRUE;
+
+ // Lists
+ private $memberList; // Single group editing
+ private $commonList; // (Multiple support active)
+ private $partialList; // (Multiple support active)
+
+
function group (&$config, $dn= NULL)
{
/* Set rfc2307bis flag */
function group (&$config, $dn= NULL)
{
/* Set rfc2307bis flag */
- if ($config->get_cfg_value("rfc2307bis") == "true"){
+ if ($config->get_cfg_value("core","rfc2307bis") == "true"){
$this->rfc2307bis= TRUE;
$this->attributes[]= "member";
$this->objectclasses[]= "groupOfNames";
$this->rfc2307bis= TRUE;
$this->attributes[]= "member";
$this->objectclasses[]= "groupOfNames";
if(isset($attrs['sambaAlgorithmicRidBase'])){
$this->ridBase= $attrs['sambaAlgorithmicRidBase'][0];
} else {
if(isset($attrs['sambaAlgorithmicRidBase'])){
$this->ridBase= $attrs['sambaAlgorithmicRidBase'][0];
} else {
- $this->ridBase= $this->config->get_cfg_value("sambaRidBase");
+ $this->ridBase= $this->config->get_cfg_value("core","sambaRidBase");
}
/* Get domain name for SID */
}
/* Get domain name for SID */
}
}
} else {
}
}
} else {
- if ($this->config->get_cfg_value("sambaRidBase") != ""){
+ if ($this->config->get_cfg_value("core","sambaRidBase") != ""){
$this->sambaDomainName= "DEFAULT";
$this->sambaDomainName= "DEFAULT";
- $this->ridBase= $this->config->get_cfg_value("sambaRidBase");
- $this->SID= $this->config->get_cfg_value("sid");
+ $this->ridBase= $this->config->get_cfg_value("core","sambaRidBase");
+ $this->SID= $this->config->get_cfg_value("core","sid");
} else {
msg_dialog::display(_("Configuration error"), _("Cannot find group SID in your configuration!"), ERROR_DIALOG);
}
} else {
msg_dialog::display(_("Configuration error"), _("Cannot find group SID in your configuration!"), ERROR_DIALOG);
}
$this->baseSelector->setHeight(300);
$this->baseSelector->update(true);
$this->baseSelector->setHeight(300);
$this->baseSelector->update(true);
+
+
// Prepare lists
$this->memberList = new sortableListing();
$this->memberList->setDeleteable(true);
// Prepare lists
$this->memberList = new sortableListing();
$this->memberList->setDeleteable(true);
return ($display);
}
return ($display);
}
- /* Delete user from group */
- $this->memberList->save_object();
- $action = $this->memberList->getAction();
- if($action['action'] == 'delete' && preg_match("/w/",$this->getacl("memberUid"))){
- foreach ($action['targets'] as $id){
- $value = $this->memberList->getKey($id);
- unset ($this->members["$value"]);
- $this->removeUser($value);
- }
- $this->reload();
+ // Act on list events
+ foreach(array('memberList','commonList','partialList') as $list){
+
+ // Check if list is available, depends on multi- or sinlge- group editing.
+ if($this->$list){
+ $this->$list->save_object();
+ $action = $this->$list->getAction();
+ if($action['action'] == 'delete' && preg_match("/w/",$this->getacl("memberUid"))){
+ foreach ($action['targets'] as $id){
+ $value = $this->$list->getKey($id);
+ unset ($this->members["$value"]);
+ $this->removeUser($value);
+ }
+ $this->reload();
+ }
+ }
}
/* Add objects? */
}
/* Add objects? */
}
$smarty->assign("trustModeDialog" , $trustModeDialog);
}
$smarty->assign("trustModeDialog" , $trustModeDialog);
- $smarty->assign("usePrototype", "true");
- if($this->config->search("nagiosaccount", "CLASS",array('menu'))){
- $smarty->assign("nagios",true);
- }else{
- $smarty->assign("nagios",false);
- }
-
- if($this->config->search("phoneAccount", "CLASS",array('menu'))){
- $smarty->assign("pickupGroup",true);
- }else{
- $smarty->assign("pickupGroup",false);
- }
+
+ $smarty->assign("nagios", $this->config->pluginEnabled("nagiosAccount"));
+ $smarty->assign("pickupGroup", $this->config->pluginEnabled("phoneAccount"));
/* Manage object add dialog */
if ($this->userSelect){
/* Manage object add dialog */
if ($this->userSelect){
/* Members and users */
/* Members and users */
- $this->memberList->setAcl($this->getacl("memberUid"));
- $data = $lData = array();
-
- foreach($this->members as $uid => $member){
-
- $data[$uid] = $member;
- $givenName = $sn = _("Unknown");
- if(isset($member['sn'][0])) $sn = $member['sn'][0];
- if(isset($member['givenName'][0])) $givenName = $member['givenName'][0];
-
- $image = image('images/false.png');
- if(isset($member['sn'])){
- $image = image('plugins/users/images/select_user.png');
+ if(!$this->multiple_support_active){
+ $this->memberList->setAcl($this->getacl("memberUid"));
+ $data = $lData = array();
+ foreach($this->members as $uid => $member){
+ $data[$uid] = $member;
+ $givenName = $sn = _("Unknown");
+ if(isset($member['sn'][0])) $sn = $member['sn'][0];
+ if(isset($member['givenName'][0])) $givenName = $member['givenName'][0];
+ $image = image('images/false.png');
+ if(isset($member['sn'])){
+ $image = image('plugins/users/images/select_user.png');
+ }
+ $lData[$uid] = array('data' => array($image,$sn, $givenName, $uid));
}
}
-
- $lData[$uid] = array('data' => array($image,$sn, $givenName, $uid));
+ $this->memberList->setListData($data,$lData);
+ $this->memberList->update();
+ $smarty->assign("memberList", $this->memberList->render());
+ }else{
+
+ $this->commonList->setAcl($this->getacl("memberUid"));
+ $this->partialList->setAcl($this->getacl("memberUid"));
+
+ $data = $lData = array();
+ foreach($this->memberUid as $uid => $member){
+ $member = $this->members[$member];
+ $data[$uid] = $member;
+ $givenName = $sn = _("Unknown");
+ if(isset($member['sn'][0])) $sn = $member['sn'][0];
+ if(isset($member['givenName'][0])) $givenName = $member['givenName'][0];
+ $image = image('images/false.png');
+ if(isset($member['sn'])){
+ $image = image('plugins/users/images/select_user.png');
+ }
+ $lData[$uid] = array('data' => array($image,$sn, $givenName, $uid));
+ }
+ $this->commonList->setListData($data,$lData);
+ $this->commonList->update();
+ $smarty->assign("commonList", $this->commonList->render());
+
+ $data = $lData = array();
+ foreach($this->memberUid_used_by_some as $uid => $member){
+ $member = $this->members[$member];
+ $data[$uid] = $member;
+ $givenName = $sn = _("Unknown");
+ if(isset($member['sn'][0])) $sn = $member['sn'][0];
+ if(isset($member['givenName'][0])) $givenName = $member['givenName'][0];
+ $image = image('images/false.png');
+ if(isset($member['sn'])){
+ $image = image('plugins/users/images/select_user.png');
+ }
+ $lData[$uid] = array('data' => array($image,$sn, $givenName, $uid));
+ }
+ $this->partialList->setListData($data,$lData);
+ $this->partialList->update();
+ $smarty->assign("partialList", $this->partialList->render());
}
}
- $this->memberList->setListData($data,$lData);
- $this->memberList->update();
-
- $smarty->assign("memberList", $this->memberList->render());
-
/* Checkboxes */
foreach (array("force_gid", "smbgroup") as $val){
if ($this->$val == "1"){
/* Checkboxes */
foreach (array("force_gid", "smbgroup") as $val){
if ($this->$val == "1"){
/* Multiple edit handling */
$smarty->assign("multiple_support",$this->multiple_support_active);
/* Multiple edit handling */
$smarty->assign("multiple_support",$this->multiple_support_active);
- $smarty->assign("memberUid_All",$this->memberUid);
- $smarty->assign("memberUid_Some",$this->memberUid_used_by_some);
foreach($this->attributes as $val){
if(in_array($val,$this->multi_boxes)){
foreach($this->attributes as $val){
if(in_array($val,$this->multi_boxes)){
to be prepared when adding/deleting users)
*/
$filter = "";
to be prepared when adding/deleting users)
*/
$filter = "";
- if ($this->config->get_cfg_value("ldapFilterNestingLimit") == "" ||
- count($this->memberUid) < $this->config->get_cfg_value("ldapFilterNestingLimit")){
- foreach ($this->memberUid as $value){
+
+ // Merge in partial uids in multiple edit
+ $uids = array_keys($this->memberUid);
+ if($this->multiple_support_active) {
+ $uids = array_merge($uids, array_keys($this->memberUid_used_by_some));
+ }
+
+ if ($this->config->get_cfg_value("core","ldapFilterNestingLimit") == "" ||
+ count($uids) < $this->config->get_cfg_value("core","ldapFilterNestingLimit")){
+ foreach ($uids as $value){
if(!isset($this->members[$value])){
$filter .= "(uid=".normalizeLdap($value).")";
}
if(!isset($this->members[$value])){
$filter .= "(uid=".normalizeLdap($value).")";
}
}
/* check if all uids are resolved */
}
/* check if all uids are resolved */
- if ($this->config->get_cfg_value("ldapFilterNestingLimit") == "" ||
- count($this->memberUid) < $this->config->get_cfg_value("ldapFilterNestingLimit")){
+ if ($this->config->get_cfg_value("core","ldapFilterNestingLimit") == "" ||
+ count($this->memberUid) < $this->config->get_cfg_value("core","ldapFilterNestingLimit")){
foreach ($this->memberUid as $value){
if(!isset($this->members[$value])){
$this->members[$value] = "";
foreach ($this->memberUid as $value){
if(!isset($this->members[$value])){
$this->members[$value] = "";
/* User wants me to fake the idMappings? This is useful for
making winbind resolve the group names in a reasonable amount
of time in combination with larger databases. */
/* User wants me to fake the idMappings? This is useful for
making winbind resolve the group names in a reasonable amount
of time in combination with larger databases. */
- if ($this->config->get_cfg_value("sambaidmapping") == "true"){
+ if ($this->config->get_cfg_value("core","sambaidmapping") == "true"){
$this->attrs['objectClass'][]= "sambaIdmapEntry";
}
$this->attrs['objectClass'][]= "sambaIdmapEntry";
}
$ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
}
$ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
}
- $this->trustModeDialog->dn = $this->dn;
- $this->trustModeDialog->save();
-
/* Check generated gidNumber, it may be used by another group.
*/
if($this->gidNumber != ""){
/* Check generated gidNumber, it may be used by another group.
*/
if($this->gidNumber != ""){
$ret= 1;
}
$ret= 1;
}
+ $this->trustModeDialog->dn = $this->dn;
+ $this->trustModeDialog->save();
+
/* Remove uid lock */
del_lock ("gidnumber");
/* Remove uid lock */
del_lock ("gidnumber");
if (!tests::is_id($this->gidNumber)){
$message[]= msgPool::invalid(_("GID"), $this->gidNumber, "/[0-9]/");
} else {
if (!tests::is_id($this->gidNumber)){
$message[]= msgPool::invalid(_("GID"), $this->gidNumber, "/[0-9]/");
} else {
- if ($this->gidNumber < $this->config->get_cfg_value("minId")){
- $message[]= msgPool::toosmall(_("GID"), $this->config->get_cfg_value("minId"));
+ if ($this->gidNumber < $this->config->get_cfg_value("core","minId")){
+ $message[]= msgPool::toosmall(_("GID"), $this->config->get_cfg_value("core","minId"));
}
}
}
}
"plSection" => array("administration"),
"plCategory" => array("groups" => array("objectClass" => "posixGroup", "description" => _("Groups"))),
"plSection" => array("administration"),
"plCategory" => array("groups" => array("objectClass" => "posixGroup", "description" => _("Groups"))),
+ "plProperties" =>
+ array(
+ array(
+ "name" => "ogroupRDN",
+ "type" => "rdn",
+ "default" => "ou=groups,",
+ "description" => "The 'ogroupRDN' statement defines the location where new accounts will be created. The default is 'ou=groups,'.",
+ "check" => "gosaProperty::isRdn",
+ "migrate" => "",
+ "group" => "plugin",
+ "mandatory" => FALSE)),
+
+
"plProvidedAcls" => array(
"cn" => _("Name"),
"description" => _("Description"),
"plProvidedAcls" => array(
"cn" => _("Name"),
"description" => _("Description"),
}
}
}
}
- foreach (array( "smbgroup" => "sambaGroupType" ,"nagios_group" => "nagios_group") as $val => $aclname) {
+ foreach (array( "smbgroup" => "sambaGroupType" ,"nagios_group" => "nagiosGroup") as $val => $aclname) {
if ($this->acl_is_writeable($aclname)){
if(isset($_POST["$val"])){
$this->$val= TRUE;
if ($this->acl_is_writeable($aclname)){
if(isset($_POST["$val"])){
$this->$val= TRUE;
}
ksort($this->memberUid_used_by_some);
}
}
ksort($this->memberUid_used_by_some);
}
+
+ $this->reload(TRUE);
+
+ // We've two lists in mutliple support
+ // - one which represents those users which are part of ALL groups.
+ // - ond one which represents those users which are only part of SOME groups.
+ $this->commonList = new sortableListing();
+ $this->commonList->setDeleteable(true);
+ $this->commonList->setInstantDelete(true);
+ $this->commonList->setEditable(false);
+ $this->commonList->setWidth("100%");
+ $this->commonList->setHeight("120px");
+ $this->commonList->setHeader(array('~',_("Given name"),_("Surename"),_("Uid")));
+ $this->commonList->setColspecs(array('20px','*','*','*','20px'));
+ $this->commonList->setDefaultSortColumn(1);
+
+ $this->partialList = new sortableListing();
+ $this->partialList->setDeleteable(true);
+ $this->partialList->setInstantDelete(true);
+ $this->partialList->setEditable(false);
+ $this->partialList->setWidth("100%");
+ $this->partialList->setHeight("120px");
+ $this->partialList->setHeader(array('~',_("Given name"),_("Surename"),_("Uid")));
+ $this->partialList->setColspecs(array('20px','*','*','*','20px'));
+ $this->partialList->setDefaultSortColumn(1);
}
}