AuthBasicBackend::validateUserPass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nop 2
dl 0
loc 2
rs 10
nc 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