getIndex(),get_request('template','REQUEST',false,null));
$request['page']->setDN($request['dn']);
$request['page']->accept(true);
$request['template'] = $request['page']->getTemplate();
if (! is_null($request['dn']))
$rdn = get_rdn($request['dn']);
else
$rdn = null;
# Get all current group members
$current_members = $app['server']->getDNAttrValue($request['dn'],$request['attr']);
usort($current_members,'pla_compare_dns');
# Loop through all base dn's and search possible member entries
$query = array();
# Get all entries that can be added to the group
if (preg_match("/^".$request['attr']."$/i",$_SESSION[APPCONFIG]->getValue('modify_member','posixgroupattr'))) {
$query['filter'] = $_SESSION[APPCONFIG]->getValue('modify_member','posixfilter');
$attr = $_SESSION[APPCONFIG]->getValue('modify_member','posixattr');
} else {
$query['filter'] = $_SESSION[APPCONFIG]->getValue('modify_member','filter');
$attr = $_SESSION[APPCONFIG]->getValue('modify_member','attr');
}
$query['attrs'] = array($attr);
$possible_values = array();
foreach ($app['server']->getBaseDN() as $base) {
$query['base'] = $base;
$possible_values = array_merge($possible_values,$app['server']->query($query,null));
}
usort($possible_values,'pla_compare_dns');
$request['page']->drawTitle(sprintf('%s %s',_('Modify group'),htmlspecialchars(get_rdn($request['dn']))));
$request['page']->drawSubTitle();
printf(_('There are %s members in group %s:'),
count($current_members),htmlspecialchars(get_rdn($request['dn'])));
$possible_members = array();
for ($i=0;$igetValue('modify_member','posixgroupattr')))
$possible_members[$i] = $possible_values[$i][$_SESSION[APPCONFIG]->getValue('modify_member','posixattr')][0];
else
$possible_members[$i] = $possible_values[$i][$_SESSION[APPCONFIG]->getValue('modify_member','attr')];
}
# Show only user that are not already in group.
$possible_members = array_diff($possible_members,$current_members);
usort($possible_members,'pla_compare_dns');
/* Draw form with select boxes, left for all possible members and
* right one for those that belong to group */
# Modifications will be sent to update_confirm which takes care of rest of the processing
echo ' ';
echo ' ';
echo '';
printf('',JSDIR);
?>