diff options
| author | Olivier Dony <odo@openerp.com> | 2011-12-13 17:15:54 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2011-12-13 17:15:54 +0100 |
| commit | 9835cebe195bc9ca9bffd5d4e2cba680d366b82b (patch) | |
| tree | 441881a902a8f01fea04a97d76f6bbc3b35e6669 /addons/web/common | |
| parent | 020c0927e43b55f897fb4a990db4db051c8a55d3 (diff) | |
| parent | 5ea774f883f1ac71ca98906a5ec5811b7e55e132 (diff) | |
[MERGE] Use the new authenticate() API instead of login()
Using the new authenticate() API instead allows to pass
a user-agent environment along with the credentials.
The main use for the UA environment at this point is
to pass the base URL used to login, so that the server
may initialize its "web.base.url" global config parameters
bzr revid: odo@openerp.com-20111213161554-jbtrp94aatcnibne
Diffstat (limited to 'addons/web/common')
| -rw-r--r-- | addons/web/common/openerplib/main.py | 3 | ||||
| -rw-r--r-- | addons/web/common/session.py | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/addons/web/common/openerplib/main.py b/addons/web/common/openerplib/main.py index 773ea020d52..0f0be088e54 100644 --- a/addons/web/common/openerplib/main.py +++ b/addons/web/common/openerplib/main.py @@ -363,7 +363,8 @@ class Connection(object): if not self.database or not self.login or self.password is None: raise AuthenticationError("Credentials not provided") - + + # TODO use authenticate instead of login self.user_id = self.get_service("common").login(self.database, self.login, self.password) if not self.user_id: raise AuthenticationError("Authentication failure") diff --git a/addons/web/common/session.py b/addons/web/common/session.py index e8027db8ea4..1fa76e30b1d 100644 --- a/addons/web/common/session.py +++ b/addons/web/common/session.py @@ -58,8 +58,9 @@ class OpenERPSession(object): self._login = login self._password = password - def login(self, db, login, password): - uid = self.proxy('common').login(db, login, password) + def authenticate(self, db, login, password, env): + # TODO use the openerplib API once it exposes authenticate() + uid = self.proxy('common').authenticate(db, login, password, env) self.bind(db, uid, login, password) if uid: self.get_context() |
