Browse Source

[FIX] compatibility with dbfilter_from_header

[ADD] mention dbfilter_from_header in the module description
pull/2/head
Holger Brunn 11 years ago
parent
commit
616eaa4bcc
  1. 4
      auth_from_http_basic/__init__.py
  2. 7
      auth_from_http_basic/__openerp__.py

4
auth_from_http_basic/__init__.py

@ -19,14 +19,14 @@
#
##############################################################################
from openerp.addons.web.http import WebRequest
from openerp.addons.web.controllers.main import db_list
from openerp.addons.web.controllers import main as web_main
old_init = WebRequest.init
def init(self, params):
old_init(self, params)
if self.httprequest.authorization and not self.session._login:
dbs = db_list(self)
dbs = web_main.db_list(self)
self.session.authenticate(
dbs and dbs[0],
self.httprequest.authorization.username,

7
auth_from_http_basic/__openerp__.py

@ -30,8 +30,11 @@ webserver handle authentication and pass the login information via HTTP headers
to the application it proxies.
This addon allows for this setup. Technically, it picks up the HTTP
Authorization header, extract a username and a password from that and tries to
login into the first database found in the database list.
Authorization header, extracts a username and a password and tries to login
into the first database found in the database list.
If you have to set a specific database, possibly depending on the login
provided, use the addon dbfilter_from_header.
""",
"category" : "",
"depends" : [

Loading…
Cancel
Save