Skip to content
Snippets Groups Projects
Commit 990e7fa4 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

mfa class:

- automatic submit to jump to MFA server
- generate automatic back url to current page
parent ba0813dd
Branches
No related tags found
No related merge requests found
......@@ -234,7 +234,7 @@ class mfaclient
? ''
: "<script>
window.onload = function() {
// document.getElementById('$sFormId').submit();
document.getElementById('$sFormId').submit();
}
</script>"
)
......@@ -428,8 +428,8 @@ class mfaclient
/**
* Get an html button to open mfa setup page
*
* @param string $sSubmitBtn html code for a submit button
* @param string $sBackUrl url to return from mfa server to the application
* @param string $sSubmitBtn optional: html code for a submit button; default: '<button>MFA Setup</button>'
* @param string $sBackUrl optional: url to return from mfa server to the application; default: current url
* @return void
*/
public function getButtonSetup(string $sSubmitBtn = '<button>MFA Setup</button>', $sBackUrl = ''): string
......@@ -438,7 +438,7 @@ class mfaclient
// print_r($aBody);
$sUrl = $aBody['setup'] ?? '';
if ($sUrl) {
$sBackUrl = $sBackUrl ?: $_SERVER['HTTP_REFERER'];
$sBackUrl = $sBackUrl ?: ( "http".(($_SERVER['HTTPS']??'') === 'on' ? "s" : "")."://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
return $this->jumpform($sUrl, $sSubmitBtn, $sBackUrl);
} else {
return $aBody['message']??'';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment