forked from friendica/friendica-addons
Prevent execution of SAML functions and show or log a message when the addon isn't configured.
This commit is contained in:
parent
e41efd72eb
commit
534b352ebc
|
@ -29,6 +29,11 @@ function saml_init($a)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!saml_is_configured()) {
|
||||||
|
echo "Please configure the SAML add-on via the admin interface.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($a->argv[1]) {
|
switch ($a->argv[1]) {
|
||||||
case "metadata.xml":
|
case "metadata.xml":
|
||||||
saml_metadata();
|
saml_metadata();
|
||||||
|
@ -104,6 +109,7 @@ function saml_is_configured()
|
||||||
function saml_sso_initiate(&$a, &$b)
|
function saml_sso_initiate(&$a, &$b)
|
||||||
{
|
{
|
||||||
if (!saml_is_configured()) {
|
if (!saml_is_configured()) {
|
||||||
|
Logger::warning('SAML SSO tried to trigger, but the SAML addon is not configured yet!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,6 +174,11 @@ function saml_sso_reply($a)
|
||||||
|
|
||||||
function saml_slo_initiate(&$a, &$b)
|
function saml_slo_initiate(&$a, &$b)
|
||||||
{
|
{
|
||||||
|
if (!saml_is_configured()) {
|
||||||
|
Logger::warning('SAML SLO tried to trigger, but the SAML addon is not configured yet!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$auth = new \OneLogin\Saml2\Auth(saml_settings());
|
$auth = new \OneLogin\Saml2\Auth(saml_settings());
|
||||||
|
|
||||||
$sloBuiltUrl = $auth->logout();
|
$sloBuiltUrl = $auth->logout();
|
||||||
|
|
Loading…
Reference in a new issue