[Product-Developers] Products.PloneLDAP: adduser with integer required ldap attribute...
vitaliypodoba at gmail.com
Thu Apr 14 14:44:20 UTC 2011
In article <BANLkTikc1ZzRGcQjyAQawjTirO=hdf047w at mail.gmail.com>,
SauZheR <sauzher at gmail.com> wrote:
> Hi there.
> These are 7 loc in Products.PloneLDAP/mixin/useradder.py
> 1 # Evil: grab all schema attributes and will them with a default
> 2 # text. This is needed to be able to create LDAP entries where
> 3 # attributes besides uid, login and rdn are required.
> 4 for (key,name) in acl.getLDAPSchema():
> 5 if key not in attrs:
> 6 attrs[key]="unset"
> 7 res=acl.manage_addUser(kwargs=attrs)
> There is an _integer_ ldap attribute in schema definition for which "unset"
> is rejected by lower tier cause it is obviously a string.
> any suggestions?
While doing client's project I had the same issue as had to maintain
users with a bunch of extra ldap properties of different data types. For
this I developed enhanced ldap plugin which did all data type conversion
between python data types and ldap attribute syntaxes.
Here is just a quick extraction of that client project's code I made a
while ago. Not sure if it'll work w/o any issues for you. At least it'll
give you an idea on how to do data type conversions.
Actually I'm planning to make a full-featured release of these
enhancements. But it won't be within the next couple of months
unfortunately as I don't have enough time for this yet.
Another option could be bda.ldap approach to integrate ldap with plone,
but I'm not sure about it's state. Half a year ago it was in a
development mode yet.
More information about the Product-Developers