index b74463f09c95b18cf4d461b81f67d2fab3d6b4a2..48c913c09216d960002e09b18156fbb0abbc985c 100644 (file)
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/*! \brief ACL management plugin */
class acl extends plugin
{
/* Definitions */
}
$this->groups['G:'.$attrs['dn']]= $attrs['cn'][0].' ['.$dsc.']';
}
+ $this->groups['G:*']= _("All users");
ksort($this->groups);
/* Roles */
}
}
- if(isset($_POST['selected_role'])){
+ // Remember the selected ACL role.
+ if(isset($_POST['selected_role']) && $_POST['aclType'] == 'role'){
$this->aclContents = "";
$this->aclContents = base64_decode($_POST['selected_role']);
}
/* Generate list */
$tmp= array();
+ if ($this->target == "group" && !isset($this->recipients["G:*"])){
+ $tmp["G:*"]= _("All users");
+ }
foreach (array("user" => "users", "group" => "groups") as $field => $arr){
if ($this->target == $field){
foreach ($this->$arr as $key => $value){
"\n <tr>".
"\n <td style='background-color:{$back_color};height:1.8em;' colspan=".($cols-1)."><b>"._("Object").": $name</b></td>".
"\n <td align='right' style='background-color:{$back_color};height:1.8em;'>".
- "\n <input type='button' onclick='divGOsa_toggle(\"$tname\");' value='"._("Show/hide advanced settings")."' /></td>".
+ "\n <input type='button' onclick=\"$('{$tname}').toggle();\" value='"._("Show/hide advanced settings")."' /></td>".
"\n </tr>";
} else if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/ie/i",$_SERVER['HTTP_USER_AGENT'])) {
$display.= "\n<table style='width:100%;border:1px solid #A0A0A0' cellspacing=0 cellpadding=2>".
"\n <tr>".
"\n <td style='background-color:#C8C8C8;height:1.8em;' colspan=".($cols-1)."><b>"._("Object").": $name</b></td>".
"\n <td align='right' style='background-color:#C8C8C8;height:1.8em;'>".
- "\n <input type='button' onclick='divGOsa_toggle(\"$tname\");' value='"._("Show/hide advanced settings")."' /></td>".
+ "\n <input type='button' onclick=\"$('{$tname}').toggle();\" value='"._("Show/hide advanced settings")."' /></td>".
"\n </tr>";
} else {
$display.= "\n<table style='width:100%;border:1px solid #A0A0A0' cellspacing=0 cellpadding=2>".
(preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) || (preg_match("/presto/i",$_SERVER['HTTP_USER_AGENT']))) {
$display.= "\n <tr id='tr_$tname' style='vertical-align:top;height:0px;'>".
"\n <td colspan=".$cols.">".
- "\n <div id='$tname' style='overflow:hidden;visibility:hidden;height:0px;vertical-align:top;width:100%;'>".
+ "\n <div id='$tname' style='overflow:hidden; display:none;vertical-align:top;width:100%;'>".
"\n <table style='width:100%;'>";
} else if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/ie/i",$_SERVER['HTTP_USER_AGENT'])) {
$display.= "\n <tr id='tr_$tname' style='vertical-align:top;height:0px;'>".
"\n <td colspan=".$cols.">".
- "\n <div id='$tname' style='position:absolute;overflow:hidden;visibility:hidden;height:0px;vertical-align:top;width:100%;'>".
+ "\n <div id='$tname' style='position:absolute;overflow:hidden;display:none;;vertical-align:top;width:100%;'>".
"\n <table style='width:100%;'>";
}else{
}
/* Decode dn's, fill with informations from LDAP */
$ldap= $config->get_ldap_link();
foreach ($ma as $memberdn){
+ // Check for wildcard here
$dn= base64_decode($memberdn);
- $ldap->cat($dn, array('cn', 'objectClass', 'description', 'uid'));
+ if ($dn != "*") {
+ $ldap->cat($dn, array('cn', 'objectClass', 'description', 'uid'));
+
+ /* Found entry... */
+ if ($ldap->count()){
+ $attrs= $ldap->fetch();
+ if (in_array_ics('gosaAccount', $attrs['objectClass'])){
+ $a['U:'.$dn]= $attrs['cn'][0]." [".$attrs['uid'][0]."]";
+ } else {
+ $a['G:'.$dn]= $attrs['cn'][0];
+ if (isset($attrs['description'][0])){
+ $a['G:'.$dn].= " [".$attrs['description'][0]."]";
+ }
+ }
- /* Found entry... */
- if ($ldap->count()){
- $attrs= $ldap->fetch();
- if (in_array_ics('gosaAccount', $attrs['objectClass'])){
- $a['U:'.$dn]= $attrs['cn'][0]." [".$attrs['uid'][0]."]";
+ /* ... or not */
} else {
- $a['G:'.$dn]= $attrs['cn'][0];
- if (isset($attrs['description'][0])){
- $a['G:'.$dn].= " [".$attrs['description'][0]."]";
- }
+ $a['U:'.$dn]= sprintf(_("Unknown entry '%s'!"), $dn);
}
- /* ... or not */
} else {
- $a['U:'.$dn]= sprintf(_("Unknown entry '%s'!"), $dn);
+ $a['G:*']= sprintf(_("All users"));
}
}