Version 0.1.0 0.1.0
authorThierry Florac <thierry.florac@onf.fr>
Wed, 17 Jun 2015 09:57:26 +0200
changeset 8 bbc24a6bd6f0
parent 7 913baa65c3ea
child 9 3544949bb01a
Version 0.1.0
buildout.cfg
src/pyams_ldap.egg-info/SOURCES.txt
src/pyams_ldap/plugin.py
src/pyams_ldap/query.py
src/pyams_ldap/zmi/plugin.py
--- a/buildout.cfg	Wed May 20 12:26:01 2015 +0200
+++ b/buildout.cfg	Wed Jun 17 09:57:26 2015 +0200
@@ -19,6 +19,7 @@
 src = src
 develop = .
           ../pyams_form
+          ../pyams_file
           ../pyams_pagelet
           ../pyams_security
           ../pyams_skin
--- a/src/pyams_ldap.egg-info/SOURCES.txt	Wed May 20 12:26:01 2015 +0200
+++ b/src/pyams_ldap.egg-info/SOURCES.txt	Wed Jun 17 09:57:26 2015 +0200
@@ -3,7 +3,6 @@
 docs/HISTORY.txt
 docs/README.txt
 src/pyams_ldap/__init__.py
-src/pyams_ldap/configure.zcml
 src/pyams_ldap/plugin.py
 src/pyams_ldap/query.py
 src/pyams_ldap.egg-info/PKG-INFO
--- a/src/pyams_ldap/plugin.py	Wed May 20 12:26:01 2015 +0200
+++ b/src/pyams_ldap/plugin.py	Wed Jun 17 09:57:26 2015 +0200
@@ -204,7 +204,7 @@
         if not self.enabled:
             return None
 
-    def get_principal(self, principal_id):
+    def get_principal(self, principal_id, info=True):
         if not self.enabled:
             return None
         if not principal_id.startswith(self.prefix + ':'):
--- a/src/pyams_ldap/query.py	Wed May 20 12:26:01 2015 +0200
+++ b/src/pyams_ldap/query.py	Wed Jun 17 09:57:26 2015 +0200
@@ -38,9 +38,9 @@
     def execute(self, conn, **kwargs):
         key = (self.base_dn.format(**kwargs),
                self.filter_tmpl.format(**kwargs))
-        logger.debug(">>> executing LDAP query: {0} (base {1}) <<< {1}".format(self.filter_tmpl,
-                                                                               self.base_dn,
-                                                                               str(kwargs.items())))
+        logger.debug(">>> LDAP query: {0} (base {1}) <<< {2}".format(self.filter_tmpl,
+                                                                     self.base_dn,
+                                                                     str(kwargs)))
         ret = conn.search(search_scope=self.scope,
                           attributes=self.attributes,
                           *key)
--- a/src/pyams_ldap/zmi/plugin.py	Wed May 20 12:26:01 2015 +0200
+++ b/src/pyams_ldap/zmi/plugin.py	Wed Jun 17 09:57:26 2015 +0200
@@ -37,6 +37,7 @@
 from pyams_ldap.query import LDAPQuery
 from pyams_pagelet.pagelet import pagelet_config
 from pyams_security.zmi.utility import SecurityManagerPluginsTable
+from pyams_skin.page import DefaultPageHeaderAdapter
 from pyams_skin.skin import apply_skin
 from pyams_skin.table import I18nColumn
 from pyams_skin.viewlet.toolbar import ToolbarMenuItem
@@ -119,7 +120,7 @@
     """LDAP plug-in add form connection"""
 
     id = 'ldap_connection_form'
-    tabLabel = _("Connection")
+    tab_label = _("Connection")
     legend = None
     fields = field.Fields(ILDAPPlugin).select('server_uri', 'bind_dn', 'bind_password', 'use_tls',
                                               'use_pool', 'pool_size', 'pool_lifetime')
@@ -131,7 +132,7 @@
     """LDAP plug-in add form users schema"""
 
     id = 'ldap_users_form'
-    tabLabel = _("Users schema")
+    tab_label = _("Users schema")
     legend = None
     fields = field.Fields(ILDAPPlugin).select('base_dn', 'search_scope', 'login_attribute', 'login_query',
                                               'uid_attribute', 'uid_query', 'title_format')
@@ -143,7 +144,7 @@
     """LDAP plug-in add form groups schema"""
 
     id = 'ldap_groups_form'
-    tabLabel = _("Groups schema")
+    tab_label = _("Groups schema")
     legend = None
     fields = field.Fields(ILDAPPlugin).select('groups_base_dn', 'groups_search_scope', 'groups_query',
                                               'group_prefix', 'group_uid_attribute', 'group_title_format')
@@ -155,7 +156,7 @@
     """LDAP plug-in add form search settings"""
 
     id = 'ldap_search_form'
-    tabLabel = _("Search settings")
+    tab_label = _("Search settings")
     legend = None
     fields = field.Fields(ILDAPPlugin).select('users_select_query', 'users_search_query',
                                               'groups_select_query', 'groups_search_query')
@@ -211,7 +212,7 @@
     """LDAP plug-in connection edit form"""
 
     id = 'ldap_connection_form'
-    tabLabel = _("Connection")
+    tab_label = _("Connection")
     legend = None
     fields = field.Fields(ILDAPPlugin).select('server_uri', 'bind_dn', 'bind_password', 'use_tls',
                                               'use_pool', 'pool_size', 'pool_lifetime')
@@ -223,7 +224,7 @@
     """LDAP plug-in users schema edit form"""
 
     id = 'ldap_users_form'
-    tabLabel = _("Users schema")
+    tab_label = _("Users schema")
     legend = None
     fields = field.Fields(ILDAPPlugin).select('base_dn', 'search_scope', 'login_attribute', 'login_query',
                                               'uid_attribute', 'uid_query', 'title_format')
@@ -235,7 +236,7 @@
     """LDAP plug-in groups schema edit form"""
 
     id = 'ldap_groups_form'
-    tabLabel = _("Groups schema")
+    tab_label = _("Groups schema")
     legend = None
     fields = field.Fields(ILDAPPlugin).select('groups_base_dn', 'groups_search_scope', 'groups_query',
                                               'group_prefix', 'group_uid_attribute', 'group_title_format')
@@ -247,7 +248,7 @@
     """LDAP plug-in search settings"""
 
     id = 'ldap_search_form'
-    tabLabel = _("Search settings")
+    tab_label = _("Search settings")
     legend = None
     fields = field.Fields(ILDAPPlugin).select('users_select_query', 'users_search_query',
                                               'groups_select_query', 'groups_search_query')
@@ -270,18 +271,17 @@
 
 
 @adapter_config(context=(ILDAPPlugin, IAdminLayer, LDAPPluginSearchView), provides=IPageHeader)
-class LDAPPluginSearchViewHeaderAdapter(ContextRequestViewAdapter):
+class LDAPPluginSearchViewHeaderAdapter(DefaultPageHeaderAdapter):
     """LDAP users folder search view header adapter"""
 
     back_url = '#security-manager.html'
     icon_class = 'fa fa-fw fa-sitemap'
+    title = _("Security manager")
 
     @property
-    def title(self):
+    def subtitle(self):
         return self.context.title
 
-    subtitle = _("Search users and groups")
-
 
 @view_config(name='search-results.html', context=ILDAPPlugin, request_type=IPyAMSLayer,
              permission='system.view')