AuthApache::challenge()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
rs 10
1
<?php
2
/*
3
 * SPDX-License-Identifier: AGPL-3.0-or-later
4
 * SPDX-FileCopyrightText: 2025 grommunio GmbH
5
 *
6
 * Use this class when the HTTP server is in charge of authentication.
7
 */
8
9
namespace grommunio\DAV;
10
11
use Sabre\DAV\Auth\Backend\Apache;
12
use Sabre\HTTP\RequestInterface;
13
use Sabre\HTTP\ResponseInterface;
14
15
class AuthApache extends Apache {
16
	protected $stored_realm;
17
	public function setRealm($r)
18
	{
19
		$stored_realm = $r;
0 ignored issues
show
Unused Code introduced by
The assignment to $stored_realm is dead and can be removed.
Loading history...
20
	}
21
	public function challenge(RequestInterface $rq, ResponseInterface $rs)
22
	{
23
		$rs->addHeader("WWW-Authenticate", "Basic realm=$stored_realm");
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $stored_realm seems to be never defined.
Loading history...
24
	}
25
}
26