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