Prevent undefined $_POST['Output']

This commit is contained in:
the-djmaze 2022-11-11 16:55:47 +01:00
parent ef6b95722d
commit 5e9c8eb39e
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ class LoginExternalSsoPlugin extends \RainLoop\Plugins\AbstractPlugin
REQUIRED = '2.21.0',
CATEGORY = 'Login',
LICENSE = 'MIT',
DESCRIPTION = '';
DESCRIPTION = 'More secure version of Login External with an SSO key';
public function Init() : void
{
@ -27,7 +27,7 @@ class LoginExternalSsoPlugin extends \RainLoop\Plugins\AbstractPlugin
$sPassword = $_POST['Password'];
if ($sEmail && $sPassword && $sKey && $_POST['SsoKey'] == $sKey) {
$sResult = \RainLoop\Api::CreateUserSsoHash($sEmail, $sPassword);
if ('json' == \strtolower($_POST['Output'] ?? 'Plain')) {
if ('json' === \strtolower($_POST['Output'] ?? '')) {
\header('Content-Type: application/json; charset=utf-8');
echo \json_encode(array(
'Action' => 'ExternalSso',

View file

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