From 6065c98547d254284b5907356e347c6e8d554ab4 Mon Sep 17 00:00:00 2001 From: Dirk Jahnke Date: Thu, 10 Oct 2019 13:08:33 +0200 Subject: [PATCH] Create error if email address is missing. --- Classes/Controller/SsoController.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Classes/Controller/SsoController.php b/Classes/Controller/SsoController.php index 6cb1d42..0fc607c 100644 --- a/Classes/Controller/SsoController.php +++ b/Classes/Controller/SsoController.php @@ -133,6 +133,13 @@ class SsoController extends ActionController } if (is_array($user) === true) { + if (is_null($user['email']) || strlen($user['email']) < 4) { + $errorText = '
ERROR!
' . + 'You did not enter your email address to your personal properties.
' . + 'The forum cannot be used without a valid email address.
'; + GeneralUtility::devLog('authenticateAction: email address not available', $extKey, 2, array('error' => $errorText)); + return $errorText; + } $userId = $user['uid']; $userEmail = $user['email']; $userName = $user['username']; @@ -159,12 +166,10 @@ class SsoController extends ActionController .'You should not see this message!
' .'This plugin should be made available only, if a Frontend User is logged in.
' .'Please change this in the setup of this content element.'; - GeneralUtility::devLog('authenticateAction bad configuration', $extKey, 2, array('error' => $errorText)); + GeneralUtility::devLog('authenticateAction: bad configuration', $extKey, 2, array('error' => $errorText)); return $errorText; }//end if }//end if - + return '
Internal Error!
Unreachable code.
'; }//end authenticateAction() - - }