如何在Plone中处理LDAP整数属性?

时间:2011-04-14 11:01:00

标签: python ldap plone

我正在使用PloneLDAP插件。

即使我在架构定义中设置了binary ='on',现在也可以在plone中创建用户时吞下一个整数。

这是因为在调用之前,必需的属性(login,pwd,uid除外)被强制为字符串“unset”:

Products.PloneLDAP.mixins.useradder.py,第30行:

 # Evil: grab all schema attributes and will them with a default
 # text. This is needed to be able to create LDAP entries where
 # attributes besides uid, login and rdn are required.
 for (key,name) in acl.getLDAPSchema():
      if key not in attrs:
          attrs[key]="unset"

 res=acl.manage_addUser(kwargs=attrs)

所以底层的python_ldap除了:

INVALID_SYNTAX: {'info': 'myIntegerAttribute': value #0 invalid per syntax', 'desc': 'Invalid syntax'}

我是否被迫写下一个完整的plone_pas user_adder插件?

0 个答案:

没有答案