Bugfix: undefined $_POST array key

This commit is contained in:
the-djmaze 2022-11-11 17:11:44 +01:00
parent 07db91c7ce
commit 8e7569c8f3
2 changed files with 7 additions and 7 deletions

View file

@ -23,11 +23,11 @@ class LoginExternalSsoPlugin extends \RainLoop\Plugins\AbstractPlugin
$oActions = \RainLoop\Api::Actions(); $oActions = \RainLoop\Api::Actions();
$oActions->Http()->ServerNoCache(); $oActions->Http()->ServerNoCache();
$sKey = $this->Config()->Get('plugin', 'key', ''); $sKey = $this->Config()->Get('plugin', 'key', '');
$sEmail = $_POST['Email']; $sEmail = isset($_POST['Email']) ? $_POST['Email'] : '';
$sPassword = $_POST['Password']; $sPassword = isset($_POST['Password']) ? $_POST['Password'] : '';
if ($sEmail && $sPassword && $sKey && $_POST['SsoKey'] == $sKey) { if ($sEmail && $sPassword && $sKey && isset($_POST['SsoKey']) && $_POST['SsoKey'] == $sKey) {
$sResult = \RainLoop\Api::CreateUserSsoHash($sEmail, $sPassword); $sResult = \RainLoop\Api::CreateUserSsoHash($sEmail, $sPassword);
if ('json' === \strtolower($_POST['Output'] ?? '')) { if (isset($_POST['Output']) && 'json' === \strtolower($_POST['Output'])) {
\header('Content-Type: application/json; charset=utf-8'); \header('Content-Type: application/json; charset=utf-8');
echo \json_encode(array( echo \json_encode(array(
'Action' => 'ExternalSso', 'Action' => 'ExternalSso',

View file

@ -26,8 +26,8 @@ class LoginExternalPlugin extends \RainLoop\Plugins\AbstractPlugin
$oAccount = null; $oAccount = null;
$oException = null; $oException = null;
$sEmail = \trim($_POST['Email']); $sEmail = isset($_POST['Email']) ? $_POST['Email'] : '';
$sPassword = $_POST['Password']; $sPassword = isset($_POST['Password']) ? $_POST['Password'] : '';
try try
{ {
@ -44,7 +44,7 @@ class LoginExternalPlugin extends \RainLoop\Plugins\AbstractPlugin
$oLogger && $oLogger->WriteException($oException); $oLogger && $oLogger->WriteException($oException);
} }
if ('json' === \strtolower($_POST['Output'] ?? '')) { if (isset($_POST['Output']) && 'json' === \strtolower($_POST['Output'])) {
\header('Content-Type: application/json; charset=utf-8'); \header('Content-Type: application/json; charset=utf-8');
$aResult = array( $aResult = array(
'Action' => 'ExternalLogin', 'Action' => 'ExternalLogin',