summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2197deb)
raw | patch | inline | side by side (parent: 2197deb)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 22 Apr 2010 14:03:31 +0000 (14:03 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 22 Apr 2010 14:03:31 +0000 (14:03 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17794 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/plugins/generic/references/class_aclResolver.inc b/gosa-core/plugins/generic/references/class_aclResolver.inc
index d65aee1e0f3b0f4edeeeb0cd95efe75e04d804a8..f1145560711aef6719ce87aa94ccaf27d5de18fa 100644 (file)
private $acl_category;
private $parent;
+ // Used for the autocompleter
+ private $userMap;
+
function __construct($config, $dn, $parent)
{
$this->config = &$config;
*/
function getReadableACL()
{
+ if(isset($_POST['aclTarget'])){
+ $d = get_post('aclTarget');
+ if(isset($this->userMap[$d])){
+ $this->validateDn = $this->userMap[$d]['dn'];
+ $this->validateUid = $this->userMap[$d]['uid'][0];
+ $this->renderedList = "";
+ }
+ }
+
if(empty($this->renderedList)){
$this->reload();
"\n </tr>";
- $str = "<table summary='"._("Object permissions")."' class='acl-viewer'>";
+ $str = "<br>".sprintf(_("ACL from the viewpoint of user '%s'"), "<b>".$this->validateUid."</b>");
+ $str.= "<table summary='"._("Object permissions")."' class='acl-viewer'>";
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
$ui = get_userinfo();
}
return($str."</ul>");
}
+
+ function processAutocomplete()
+ {
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search("(&(objectClass=gosaAccount)(|(sn=*".get_post('aclTarget')."*)".
+ "(uid=*".get_post('aclTarget')."*)(givenName=*".get_post('aclTarget')."*)))",
+ array('uid','dn','sn','givenName'));
+ echo "<ul>";
+ while($attrs = $ldap->fetch()){
+ $display = $attrs['givenName'][0]." ".$attrs['sn'][0]." [".$attrs['uid'][0]."]";
+ echo "<li>{$display}</li>";
+ $this->userMap[$display] = $attrs;
+ }
+ echo "</ul>";
+ }
}
?>
diff --git a/gosa-core/plugins/generic/references/class_reference.inc b/gosa-core/plugins/generic/references/class_reference.inc
index de7b44f20dc8d9ba279140b024404c343b34f16c..d2a09670e381e14e3c9413fed44630c784461ce1 100644 (file)
/* Set government mode */
$smarty= get_smarty();
+ $smarty->assign("usePrototype", "true");
+ session::set('autocomplete', $this->aclResolver);
if (isset($_GET['show'])){
$dn= base64_decode($_GET['show']);
diff --git a/gosa-core/plugins/generic/references/contents.tpl b/gosa-core/plugins/generic/references/contents.tpl
index ba8193e3f70ba1a2147b3f8c8e3f87d1a8f79af9..e974fb51b76aa15329f34d4fa8c68ad8f8d6a2c5 100644 (file)
{/if}
</td>
<td>
+ <input class='filter_textfield' placeholder='{t}Search{/t}...'
+ id='aclTarget' name='aclTarget' type='text' value=''
+ onChange='document.mainform.submit();'>
<div id='autocomplete' class='autocomplete'></div>
<script type='text/javascript'>
new Ajax.Autocompleter(
- 'bs_input_',
+ 'aclTarget',
'autocomplete',
- 'autocomplete.php?type=base',
+ 'autocomplete.php',
{ minChars: 3, frequency: 0.5 });
</script>
{$acls}