parent
414a78d532
commit
fc8873ec0a
|
@ -58,8 +58,8 @@ class ExternalBackend implements UserBackendInterface
|
||||||
*/
|
*/
|
||||||
public function authenticate(User $user, $password = null)
|
public function authenticate(User $user, $password = null)
|
||||||
{
|
{
|
||||||
if (isset($_SERVER['REMOTE_USER'])) {
|
$username = getenv('REMOTE_USER');
|
||||||
$username = $_SERVER['REMOTE_USER'];
|
if ($username !== false) {
|
||||||
$user->setExternalUserInformation($username, 'REMOTE_USER');
|
$user->setExternalUserInformation($username, 'REMOTE_USER');
|
||||||
|
|
||||||
if ($this->stripUsernameRegexp) {
|
if ($this->stripUsernameRegexp) {
|
||||||
|
|
|
@ -269,11 +269,11 @@ class AdminAccountPage extends Form
|
||||||
*/
|
*/
|
||||||
protected function getUsername()
|
protected function getUsername()
|
||||||
{
|
{
|
||||||
if (false === isset($_SERVER['REMOTE_USER'])) {
|
$name = getenv('REMOTE_USER');
|
||||||
|
if ($name === false) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = $_SERVER['REMOTE_USER'];
|
|
||||||
if (isset($this->backendConfig['strip_username_regexp']) && $this->backendConfig['strip_username_regexp']) {
|
if (isset($this->backendConfig['strip_username_regexp']) && $this->backendConfig['strip_username_regexp']) {
|
||||||
// No need to silence or log anything here because the pattern has
|
// No need to silence or log anything here because the pattern has
|
||||||
// already been successfully compiled during backend configuration
|
// already been successfully compiled during backend configuration
|
||||||
|
|
|
@ -30,7 +30,7 @@ class AuthenticationPage extends Form
|
||||||
*/
|
*/
|
||||||
public function createElements(array $formData)
|
public function createElements(array $formData)
|
||||||
{
|
{
|
||||||
if (isset($formData['type']) && $formData['type'] === 'external' && !isset($_SERVER['REMOTE_USER'])) {
|
if (isset($formData['type']) && $formData['type'] === 'external' && getenv('REMOTE_USER') === false) {
|
||||||
$this->info(
|
$this->info(
|
||||||
$this->translate(
|
$this->translate(
|
||||||
'You\'re currently not authenticated using any of the web server\'s authentication '
|
'You\'re currently not authenticated using any of the web server\'s authentication '
|
||||||
|
|
Loading…
Reference in New Issue