mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[ADD] base_dav
This commit is contained in:
committed by
fkantelberg
parent
c1349bb4bc
commit
cb2ecfee46
18
base_dav/radicale/auth.py
Normal file
18
base_dav/radicale/auth.py
Normal 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)
|
||||
Reference in New Issue
Block a user