AuthBasicBackend   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 25
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validateUserPass() 0 2 1
A __construct() 0 2 1
1
<?php
2
/*
3
 * SPDX-License-Identifier: AGPL-3.0-only
4
 * SPDX-FileCopyrightText: Copyright 2016 - 2018 Kopano b.v.
5
 * SPDX-FileCopyrightText: Copyright 2020-2024 grommunio GmbH
6
 *
7
 * grommunio basic authentication backend class.
8
 */
9
10
namespace grommunio\DAV;
11
12
use Sabre\DAV\Auth\Backend\AbstractBasic;
13
14
class AuthBasicBackend extends AbstractBasic {
15
	protected $gDavBackend;
16
17
	/**
18
	 * Constructor.
19
	 */
20
	public function __construct(GrommunioDavBackend $gDavBackend) {
21
		$this->gDavBackend = $gDavBackend;
22
	}
23
24
	/**
25
	 * Validates a username and password.
26
	 *
27
	 * This method should return true or false depending on if login
28
	 * succeeded.
29
	 *
30
	 * @see \Sabre\DAV\Auth\Backend\AbstractBasic::validateUserPass()
31
	 *
32
	 * @param string $username
33
	 * @param string $password
34
	 *
35
	 * @return bool
36
	 */
37
	protected function validateUserPass($username, $password) {
38
		return $this->gDavBackend->Logon($username, $password);
39
	}
40
}
41