From 5e12e47c87f70006488df1febbafec3dec592201 Mon Sep 17 00:00:00 2001 From: jke-openerp Date: Tue, 28 Jan 2014 15:32:24 +0100 Subject: [PATCH] [REF] Replace login as anonymous in im_livechat with auth_method_public bzr revid: jke@openerp.com-20140128143224-139yby4apcrvjf54 --- addons/im_livechat/im_livechat.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/im_livechat/im_livechat.py b/addons/im_livechat/im_livechat.py index e322467e64e..ca4a5f3ac20 100644 --- a/addons/im_livechat/im_livechat.py +++ b/addons/im_livechat/im_livechat.py @@ -40,10 +40,10 @@ class LiveChatController(http.Controller): def _auth(self, db): reg = openerp.modules.registry.RegistryManager.get(db) - uid = openerp.netsvc.dispatch_rpc('common', 'authenticate', [db, "anonymous", "anonymous", None]) + uid = request.uid return reg, uid - @http.route('/im_livechat/loader', auth="none") + @http.route('/im_livechat/loader', auth="public") def loader(self, **kwargs): p = json.loads(kwargs["p"]) db = p["db"] @@ -59,7 +59,7 @@ class LiveChatController(http.Controller): return request.make_response(env.get_template("loader.js").render(info), headers=[('Content-Type', "text/javascript")]) - @http.route('/im_livechat/web_page', auth="none") + @http.route('/im_livechat/web_page', auth="public") def web_page(self, **kwargs): p = json.loads(kwargs["p"]) db = p["db"] @@ -72,7 +72,7 @@ class LiveChatController(http.Controller): return request.make_response(env.get_template("web_page.html").render(info), headers=[('Content-Type', "text/html")]) - @http.route('/im_livechat/available', type='json', auth="none") + @http.route('/im_livechat/available', type='json', auth="public") def available(self, db, channel): reg, uid = self._auth(db) with reg.cursor() as cr: