[ADD] base_dav

This commit is contained in:
Holger Brunn
2018-12-12 11:51:31 +01:00
committed by fkantelberg
parent c1349bb4bc
commit cb2ecfee46
26 changed files with 1665 additions and 0 deletions

18
base_dav/radicale/auth.py Normal file
View File

@@ -0,0 +1,18 @@
# 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)