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->Http()->ServerNoCache();
$sKey = $this->Config()->Get('plugin', 'key', '');
$sEmail = $_POST['Email'];
$sPassword = $_POST['Password'];
if ($sEmail && $sPassword && $sKey && $_POST['SsoKey'] == $sKey) {
$sEmail = isset($_POST['Email']) ? $_POST['Email'] : '';
$sPassword = isset($_POST['Password']) ? $_POST['Password'] : '';
if ($sEmail && $sPassword && $sKey && isset($_POST['SsoKey']) && $_POST['SsoKey'] == $sKey) {
$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');
echo \json_encode(array(
'Action' => 'ExternalSso',

View file

@ -26,8 +26,8 @@ class LoginExternalPlugin extends \RainLoop\Plugins\AbstractPlugin
$oAccount = null;
$oException = null;
$sEmail = \trim($_POST['Email']);
$sPassword = $_POST['Password'];
$sEmail = isset($_POST['Email']) ? $_POST['Email'] : '';
$sPassword = isset($_POST['Password']) ? $_POST['Password'] : '';
try
{
@ -44,7 +44,7 @@ class LoginExternalPlugin extends \RainLoop\Plugins\AbstractPlugin
$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');
$aResult = array(
'Action' => 'ExternalLogin',