From 737d18edfe81212c42a6975f9690fce09c3d919d Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 9 Feb 2007 06:30:07 +0000 Subject: [PATCH] Updates .... git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5711 594d385d-05f5-0310-b6e9-bd551577e9d8 --- TODO | 19 +++++++++++-------- ihtml/themes/default/acl.tpl | 6 ++++++ include/class_acl.inc | 19 +++++++++++++++---- include/class_ldap.inc | 19 +++++++++++++++++++ .../{class_acl_role.inc => class_aclRole.inc} | 0 5 files changed, 51 insertions(+), 12 deletions(-) rename plugins/admin/acl/{class_acl_role.inc => class_aclRole.inc} (100%) diff --git a/TODO b/TODO index 64d85409b..cef784a5e 100644 --- a/TODO +++ b/TODO @@ -4,19 +4,19 @@ Target for 2.6: * Move from gosa.conf-trunk to gosa.conf when we're ready * ACL - - Acl roles should be selectable in acl dialog. + - Acl roles should be selectable in acl dialog - Role checks are missing - - Copy & Paste tmplates for acl roles. + - Copy & Paste tmplates for acl roles - Check Title strings - Check role and acl remove - - Check Base select dialog within roles. + - Check Base select dialog within roles - Implement a kind of "umask" - - Ensure that acls will be the same after renaming and moving objects. + - Ensure that acls will be the same after renaming and moving objects -* Create a Bugtracker - * Redo the setup +* Create a bug submitter + * Make plugin loader react on predefined info values from plugins itself instead of gosa.conf @@ -39,7 +39,9 @@ Target for 2.6: * Evaluate patches for certificate generation -* Bug submitter + +Target for 3.0: +=============== * Complete PHP5 compliance and optimization @@ -47,6 +49,8 @@ Target for 2.6: * Replace PHP IMAP module by self made module +* Make IMAP namespace configurable + * Add possibility to add referrals in department dialog * Fine tuning in Kerberos support @@ -70,5 +74,4 @@ Target for 2.6: * Automatic passwords? Generate a password for a newly created user and display it. -* Make IMAP namespace configurable diff --git a/ihtml/themes/default/acl.tpl b/ihtml/themes/default/acl.tpl index 5df679383..3afb976ea 100644 --- a/ihtml/themes/default/acl.tpl +++ b/ihtml/themes/default/acl.tpl @@ -64,6 +64,12 @@ {$aclSelector} {/if} +{if $aclType eq 'role'} +

 

+

{t}Available roles{/t}

+{$roleSelector} +{/if} +

 

diff --git a/include/class_acl.inc b/include/class_acl.inc index 2d9e72501..41082b310 100644 --- a/include/class_acl.inc +++ b/include/class_acl.inc @@ -154,8 +154,8 @@ class acl extends plugin "one" => _("One level"), "base" => _("Current object"), "sub" => _("Complete subtree"), - "psub" => _("Complete subtree (permanent)")); - //"role" => _("Use ACL defined in role")); + "psub" => _("Complete subtree (permanent)"), + "role" => _("Use ACL defined in role")); } else { $this->aclTypes= array("base" => _("Current object"), "role" => _("Use ACL defined in role")); @@ -451,6 +451,11 @@ class acl extends plugin if ($this->aclType == 'base'){ $smarty->assign('aclSelector', $this->buildAclSelector($this->myAclObjects)); } + + /* Role selector if scope is base */ + if ($this->aclType == 'role'){ + $smarty->assign('roleSelector', "Role selector");#, $this->buildRoleSelector($this->myAclObjects)); + } } if ($this->dialogState == 'edit'){ @@ -466,7 +471,13 @@ class acl extends plugin if ($this->aclObject == 'all'){ $aclObjects['all']= _("All objects in current subtree"); } - $smarty->assign('aclSelector', $this->buildAclSelector($aclObjects)); + + /* Role selector if scope is base */ + if ($this->aclType == 'role'){ + $smarty->assign('roleSelector', "Role selector");#, $this->buildRoleSelector($this->myAclObjects)); + } else { + $smarty->assign('aclSelector', $this->buildAclSelector($aclObjects)); + } } /* Show main page */ @@ -712,7 +723,7 @@ class acl extends plugin break; case 'role': - echo "Role"; + echo "Role: $acl"; break; case 'reset': diff --git a/include/class_ldap.inc b/include/class_ldap.inc index a93aa96c0..c8397fd4a 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -1233,6 +1233,25 @@ class LDAP{ } } } + + function get_naming_contexts($server, $admin= "", $password= "") + { + /* Build LDAP connection */ + $ds= ldap_connect ($server); + if (!$ds) { + die ("Can't bind to LDAP. No check possible!"); + } + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + $r= ldap_bind ($ds, $admin, $password); + + /* Get base to look for naming contexts */ + $sr = @ldap_read ($ds, "", "objectClass=*", array("namingContexts")); + $attr= @ldap_get_entries($ds,$sr); + + return ($attr[0]['namingcontexts']); + } + + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/acl/class_acl_role.inc b/plugins/admin/acl/class_aclRole.inc similarity index 100% rename from plugins/admin/acl/class_acl_role.inc rename to plugins/admin/acl/class_aclRole.inc -- 2.30.2