From: hickert Date: Thu, 22 Apr 2010 14:03:31 +0000 (+0000) Subject: Test X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7f5932fcf2f0e1bfb7339655da037e33bb26c5a9;p=gosa.git Test 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 d65aee1e0..f11455607 100644 --- a/gosa-core/plugins/generic/references/class_aclResolver.inc +++ b/gosa-core/plugins/generic/references/class_aclResolver.inc @@ -14,6 +14,9 @@ class aclResolver private $acl_category; private $parent; + // Used for the autocompleter + private $userMap; + function __construct($config, $dn, $parent) { $this->config = &$config; @@ -111,6 +114,15 @@ class aclResolver */ 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(); @@ -159,7 +171,8 @@ class aclResolver "\n "; - $str = ""; + $str = "
".sprintf(_("ACL from the viewpoint of user '%s'"), "".$this->validateUid.""); + $str.= "
"; $ldap = $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); $ui = get_userinfo(); @@ -268,6 +281,22 @@ class aclResolver } return($str.""); } + + 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 ""; + } } ?> diff --git a/gosa-core/plugins/generic/references/class_reference.inc b/gosa-core/plugins/generic/references/class_reference.inc index de7b44f20..d2a09670e 100644 --- a/gosa-core/plugins/generic/references/class_reference.inc +++ b/gosa-core/plugins/generic/references/class_reference.inc @@ -87,6 +87,8 @@ class reference extends plugin /* 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 ba8193e3f..e974fb51b 100644 --- a/gosa-core/plugins/generic/references/contents.tpl +++ b/gosa-core/plugins/generic/references/contents.tpl @@ -22,12 +22,15 @@ {/if}
+
{$acls}