1484 def set_schema(self, schema): |
1484 def set_schema(self, schema): |
1485 """set the instance'schema""" |
1485 """set the instance'schema""" |
1486 if 'CWUser' in schema: # probably an empty schema if not true... |
1486 if 'CWUser' in schema: # probably an empty schema if not true... |
1487 # rql syntax trees used to authenticate users |
1487 # rql syntax trees used to authenticate users |
1488 self._passwd_rqlst = self.source.compile_rql(self.passwd_rql, self._sols) |
1488 self._passwd_rqlst = self.source.compile_rql(self.passwd_rql, self._sols) |
1489 self._auth_rqlst = self.source.compile_rql(self.auth_rql, self._sols) |
1489 if 'CWSource' in schema: |
|
1490 self._auth_rqlst = self.source.compile_rql(self.auth_rql, self._sols) |
|
1491 else: |
|
1492 self._auth_rqlst = self.source.compile_rql( |
|
1493 u'Any X WHERE X is CWUser, X login %(login)s, X upassword %(pwd)s', |
|
1494 ({'X': 'CWUser', 'P': 'Password'},)) |
1490 |
1495 |
1491 def authenticate(self, cnx, login, password=None, **kwargs): |
1496 def authenticate(self, cnx, login, password=None, **kwargs): |
1492 """return CWUser eid for the given login/password if this account is |
1497 """return CWUser eid for the given login/password if this account is |
1493 defined in this source, else raise `AuthenticationError` |
1498 defined in this source, else raise `AuthenticationError` |
1494 |
1499 |