Commit b465f196 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! fixup! [by Vincent] Get rid of all module-global callables. Use PAS API...

fixup! fixup! [by Vincent] Get rid of all module-global callables. Use PAS API instead. Use all non-PAS API public methods. Use PAS API instead. Implement IAuthenticationPlugin API better, so PAS API becomes usable for ERP5-based authentication.
parent 39bfe1dc
...@@ -71,10 +71,15 @@ class Login(XMLObject, LoginAccountProviderMixin, EncryptedPasswordMixin): ...@@ -71,10 +71,15 @@ class Login(XMLObject, LoginAccountProviderMixin, EncryptedPasswordMixin):
activate_kw['tag'] = tag = \ activate_kw['tag'] = tag = \
self.getPortalType() + '_setReference_' + value.encode('hex') self.getPortalType() + '_setReference_' + value.encode('hex')
# Check that there no existing user # Check that there no existing user
erp5_users = portal.acl_users.erp5_users user_list = [x for x in portal.acl_users.searchUsers(
user_list = erp5_users.enumerateUsers(login=value) exact_match=True,
if [x for x in user_list if x.get('login', {}).get('path', '') != self.getPath()]: login=self.getReference(),
raise RuntimeError, 'user id %s already exist' % (value,) ) if 'login_list' in x]
if user_list:
for user in user_list:
login, = user['login_list']
if login['path'] == self.getPath():
raise RuntimeError, 'user id %s already exist' % (value,)
# Check that there is no reindexation related to reference indexation # Check that there is no reindexation related to reference indexation
if portal.portal_activities.countMessageWithTag(tag): if portal.portal_activities.countMessageWithTag(tag):
raise RuntimeError, 'user id %s already exist' % (value,) raise RuntimeError, 'user id %s already exist' % (value,)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment