Add default auth realm

This commit is contained in:
Cyril 2019-10-30 12:19:18 +01:00
parent eca2625d33
commit 43b8287caa
3 changed files with 25 additions and 4 deletions

View File

@ -1,13 +1,30 @@
Davis
---
A simple admin interface for `sabre/dav` based on Symfony 4.
A simple, fully translatable admin interface for `sabre/dav` based on Symfony 4.
# Requirements
PHP > 7.1.3
# Installation
1. Retrieve the dependencies
composer install
2. Migrate the database
bin/console migrate
# Development
If you change or add translations, you need to update the `messages` XLIFF file with :
bin/console translation:update en --force --domain=messages+intl-icu
# Libraries used
- Bootstrap 4 (Licence : MIT)
- Bootstrap 4 (Licence : MIT)
This project does not use any pipeline for the assets since the frontend side is relatively simple, and based on Bootstrap.

View File

@ -42,7 +42,7 @@ class DAVController extends AbstractController
$this->calDAVEnabled = $calDAVEnabled;
$this->cardDAVEnabled = $cardDAVEnabled;
$this->inviteAddress = $inviteAddress ?? null;
$this->authRealm = $authRealm ?? 'SabreDAV';
$this->authRealm = $authRealm ?? User::DEFAULT_AUTH_REALM;
}
/**

View File

@ -10,6 +10,8 @@ use Doctrine\ORM\Mapping as ORM;
*/
class User
{
const DEFAULT_AUTH_REALM = 'SabreDAV';
/**
* @ORM\Id()
* @ORM\GeneratedValue()
@ -57,7 +59,9 @@ class User
return $this->password;
}
public function setPassword(string $password): self
// $password _can_ be NULL here, in the case when we edit a user
// and do not change its password
public function setPassword(?string $password): self
{
$this->password = $password;