Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
matsuo authored Jun 27, 2024
2 parents 3e2fd10 + 8fe7233 commit 7fc5b33
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 4 deletions.
5 changes: 5 additions & 0 deletions dist-docs/change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ Ver.13 (In Development)
- Field values from SAML attributes can merge from multiple entries.
- Variables $limitEnrollSecond and $limitPwChangeSecond in the params.php file can specify the limit seconds for
the enrollment mail and password reset mail.
- INTERMediatorOnPage.authPanelExp and INTERMediatorOnPage.authPanelExp2FA can display any explanation
on authentication panels.
- In the params.php file, variables $authPanelTitle, $authPanelTitle2FA, $authPanelExp and $authPanelExp2FA can
describe and set any strings including html. These are elements of auth panels as the same name properties of
INTERMediatorOnPage object.
- [BUG FIX] On the Ver.12, SAML authentication didn't work in spite of Ver.11 can do. It didn't check with SAML manual
test on Ver.12 after added types to php codes. Ver.13 works SAML.

Expand Down
7 changes: 6 additions & 1 deletion params.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@

/* Authorization
* =================== */

$authStoring = 'credential'; // 'session-storage' or 'credential'
$authExpired = 3600;
//$authRealm = '';
Expand All @@ -159,6 +158,12 @@
//$expiringSeconds2FA = 1000; // 2FA effective seconds from code input.
$fixed2FACode = "5555"; // Fixed 2FA code for the testing purpose. On the real system, this has to comment out.

/* Authentication panels customizing */
//$authPanelTitle= "そうだ"; // Auth Panel's title
//$authPanelTitle2FA= null; // 2FA Auth Panel's title
//$authPanelExp= "温泉に行こう"; // Auth Panel's explanations
//$authPanelExp2FA= null; // 2FA Auth Panel's explanations

// The 'issuedhash' table for storing challenges of authentication can be use another database.
//$issuedHashDSN = 'sqlite:/var/db/im/sample.sq3';

Expand Down
2 changes: 2 additions & 0 deletions samples/Sample_Auth/MySQL_form_auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<script>
INTERMediatorOnPage.doBeforeConstruct = function () {
INTERMediatorLog.suppressDebugMessageOnPage = true
// INTERMediatorOnPage.authPanelExp = "説明です。"
INTERMediatorOnPage.authPanelExp2FA = "説明です。"
}
</script>
</head>
Expand Down
19 changes: 19 additions & 0 deletions src/js/INTER-Mediator-Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ let INTERMediatorOnPage = {
isSetDefaultStyle: false,
authPanelTitle: null,
authPanelTitle2FA: null,
authPanelExp: null,
authPanelExp2FA: null,
isOAuthAvailable: false, // @Private
oAuthClientID: null, // @Private
oAuthClientSecret: null, // @Private
Expand Down Expand Up @@ -674,6 +676,14 @@ let INTERMediatorOnPage = {
INTERMediatorLib.getInsertedStringFromErrorNumber(2024)))
frontPanel.appendChild(resetMessage)
}
if(INTERMediatorOnPage.authPanelExp){
breakLine = document.createElement('HR')
frontPanel.appendChild(breakLine)
const addingNode = document.createElement('DIV')
addingNode.className = '_im_auth_exp'
addingNode.innerHTML = INTERMediatorOnPage.authPanelExp
frontPanel.appendChild(addingNode)
}
}
passwordBox.onkeydown = function (event) {
if (event.code === 'Enter') {
Expand Down Expand Up @@ -895,6 +905,15 @@ let INTERMediatorOnPage = {
explain.appendChild(document.createTextNode(INTERMediatorLib.getInsertedStringFromErrorNumber(2030)))
frontPanel.appendChild(explain)

if(INTERMediatorOnPage.authPanelExp2FA){
breakLine = document.createElement('HR')
frontPanel.appendChild(breakLine)
const addingNode = document.createElement('DIV')
addingNode.className = '_im_auth_exp_2fa'
addingNode.innerHTML = INTERMediatorOnPage.authPanelExp2FA
frontPanel.appendChild(addingNode)
}

window.scrollTo(0, 0)
codeBox.focus()
INTERMediatorOnPage.authCount++
Expand Down
11 changes: 10 additions & 1 deletion src/php/GenerateJSCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public function generateInitialJSCode(?array $dataSource, ?array $options, ?arra
$this->generateAssignJS("INTERMediatorOnPage.realm", $q, $realmValue, $q);
$req2FAValue = $options['authentication']['is-required-2FA']
?? Params::getParameterValue("isRequired2FA", '');
$this->generateAssignJS("INTERMediatorOnPage.isRequired2FA", $req2FAValue? "true" : "false");
$this->generateAssignJS("INTERMediatorOnPage.isRequired2FA", $req2FAValue ? "true" : "false");
$digitsOf2FACodeValue = $options['authentication']['digits-of-2FA-Code']
?? Params::getParameterValue("digitsOf2FACode", 4);
$this->generateAssignJS("INTERMediatorOnPage.digitsOf2FACode", intval($digitsOf2FACodeValue));
Expand Down Expand Up @@ -401,6 +401,15 @@ public function generateInitialJSCode(?array $dataSource, ?array $options, ?arra
if ($activateGenerator) {
$this->generateAssignJS("INTERMediatorOnPage.activateMaintenanceCall", "true");
}

$this->generateAssignJS("INTERMediatorOnPage.authPanelTitle",
$q, Params::getParameterValue('authPanelTitle', ""), $q);
$this->generateAssignJS("INTERMediatorOnPage.authPanelTitle2FA", $q,
Params::getParameterValue('authPanelTitle2FA', ""), $q);
$this->generateAssignJS("INTERMediatorOnPage.authPanelExp",
$q, Params::getParameterValue('authPanelExp', ""), $q);
$this->generateAssignJS("INTERMediatorOnPage.authPanelExp2FA",
$q, Params::getParameterValue('authPanelExp2FA', ""), $q);
}

/**
Expand Down
9 changes: 7 additions & 2 deletions themes/default/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ span.IM_POSTMESSAGE {
color: #50506c;
}

#_im_authpback,#_im_authpback_2FA {
#_im_authpback, #_im_authpback_2FA {
position: absolute;
height: 100%;
width: 100%;
Expand Down Expand Up @@ -357,7 +357,7 @@ span.IM_POSTMESSAGE {
text-align: center;
}

._im_authlabel,._im_authlabel_2FA {
._im_authlabel, ._im_authlabel_2FA {
text-align: right;
float: left;
color: #bdbdee;
Expand Down Expand Up @@ -433,6 +433,11 @@ span.IM_POSTMESSAGE {
color: red;
}

._im_auth_exp_2fa, ._im_auth_exp {
font-size: 85%;
}


/* Widget Pop-up Panel */
._im_widget_popup_panelback {
position: absolute;
Expand Down

0 comments on commit 7fc5b33

Please sign in to comment.