forked from shaba/openuds
now getValidGroups returns a generator, not a list, so it does not have len :-)
This commit is contained in:
parent
a319f82e64
commit
10843cbca2
@ -109,7 +109,7 @@ class IPAuth(Authenticator):
|
|||||||
# doAutoLogin = Config.section('IPAUTH').value('autoLogin', '0').getBool()
|
# doAutoLogin = Config.section('IPAUTH').value('autoLogin', '0').getBool()
|
||||||
gm = GroupsManager(self.dbAuthenticator())
|
gm = GroupsManager(self.dbAuthenticator())
|
||||||
self.getGroups(request.ip, gm)
|
self.getGroups(request.ip, gm)
|
||||||
if len(gm.getValidGroups()) > 0 and self.dbAuthenticator().isValidUser(request.ip, True):
|
if len(list(gm.getValidGroups())) > 0 and self.dbAuthenticator().isValidUser(request.ip, True):
|
||||||
passw = ''.join(random.choice(string.letters + string.digits) for __ in xrange(12))
|
passw = ''.join(random.choice(string.letters + string.digits) for __ in xrange(12))
|
||||||
self.cache().put(request.ip, passw)
|
self.cache().put(request.ip, passw)
|
||||||
return '<script type="text/javascript">$("#id_user").val("' + request.ip + '");$("#id_password").val("' + passw + '");$("#loginform").submit();</script>'
|
return '<script type="text/javascript">$("#id_user").val("' + request.ip + '");$("#id_password").val("' + passw + '");$("#loginform").submit();</script>'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user