Files
server-backend/base_dav/radicale/auth.py
Holger Brunn cb2ecfee46 [ADD] base_dav
2020-01-12 21:03:57 +01:00

19 lines
542 B
Python

# Copyright 2018 Therp BV <https://therp.nl>
# Copyright 2019-2020 initOS GmbH <https://initos.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.http import request
try:
from radicale.auth import BaseAuth
except ImportError:
BaseAuth = None
class Auth(BaseAuth):
def is_authenticated2(self, login, user, password):
env = request.env
uid = env['res.users']._login(env.cr.dbname, user, password)
if uid:
request._env = env(user=uid)
return bool(uid)