Skip to content

Commit 2d546fe

Browse files
authored
Merge pull request #522 from Sae126V/GT-469-Update-to-CheckIn-related-entitlement-error-Dev-fork
Update code to reflect the new EGI checkin error message(Master)
2 parents 356ac65 + 2ff1254 commit 2d546fe

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

htdocs/web_portal/static_html/goc5_logo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- <img src="img/Logo-1.6.png" class="logo_image" height="39" style="vertical-align: middle;"/>-->
55
<h3 class="Logo_Text Small_Bottom_Margin Standard_Padding"
66
style="vertical-align: middle; margin-left: 0.2em;">
7-
GOCDB 5.12.0
7+
GOCDB 5.12.1
88
</h3>
99

1010
</a>

lib/Authentication/AuthTokens/ShibAuthToken.php

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private function getAttributesInitToken(){
122122
}
123123
if(empty($_SERVER['entitlement'])){
124124
//die('Did not recieve the required entitlement attribute from the EGI Proxy IdP, please contact gocdb-admins');
125-
$HTML = '<ul><li>Login requires a GOCDB entitlement value <a href="https://wiki.egi.eu/wiki/URN_Registry:aai.egi.eu:gocdb" target="_blank">https://wiki.egi.eu/wiki/URN_Registry:aai.egi.eu:gocdb</a></li><li>Please, logout or restart your browser and attempt to login again using an identity provider that provides a GOCDB entitlement</li></ul>';
125+
$HTML = $this->getEntitlementErrorMessage();
126126
$HTML .= "<div style='text-align: center;'>";
127127
$HTML .= '<a href="'.htmlspecialchars(\Factory::$properties['LOGOUTURL']).'"><b><font colour="red">Logout</font></b></a>';
128128
$HTML .= "</div>";
@@ -132,7 +132,7 @@ private function getAttributesInitToken(){
132132

133133
$entitlementValuesArray = explode(';', $_SERVER['entitlement']);
134134
if( !in_array('urn:mace:egi.eu:res:gocdb#aai.egi.eu', $entitlementValuesArray) ){
135-
$HTML = '<ul><li>Login requires a GOCDB entitlement <a href="https://wiki.egi.eu/wiki/URN_Registry:aai.egi.eu:gocdb" target="_blank">https://wiki.egi.eu/wiki/URN_Registry:aai.egi.eu:gocdb</a></li><li>Please, logout or restart your browser and attempt to login again using an identity provider that provides a GOCDB entitlement</li></ul>';
135+
$HTML = $this->getEntitlementErrorMessage();
136136
$HTML .= "<div style='text-align: center;'>";
137137
$HTML .= '<a href="'.htmlspecialchars(\Factory::$properties['LOGOUTURL']).'"><b><font colour="red">Logout</font></b></a>';
138138
$HTML .= "</div>";
@@ -204,4 +204,27 @@ public static function isStateless() {
204204
return true;
205205
}
206206

207+
private function getEntitlementErrorMessage()
208+
{
209+
$refedsResAndSchURL = "https://refeds.org/category/research-and-scholarship";
210+
$refedsSirtfiURL = "https://refeds.org/sirtfi";
211+
$resourceLink = "https://docs.egi.eu/internal/configuration-database/access";
212+
$sectionFragmentInfo = "/#using-institutional-account-via-egi-check-in";
213+
$documentationURL = $resourceLink . $sectionFragmentInfo;
214+
215+
return "<ul>"
216+
. "<li>Login requires the entitlement "
217+
. "urn:mace:egi.eu:res:gocdb#aai.egi.eu, "
218+
. "which was not provided.</li>"
219+
. "<li>This entitlement is automatically granted "
220+
. "when using an identity provider compliant with "
221+
. "<a href=\"{$refedsResAndSchURL}\" target='_blank'>"
222+
. "REFEDS R&amp;S</a> and "
223+
. "<a href=\"{$refedsSirtfiURL}\" target='_blank'>"
224+
. "REFEDS Sirtfi</a>.</li>"
225+
. "<li>Please see here for more information: "
226+
. "<a href=\"{$documentationURL}\" target='_blank'>"
227+
. "{$documentationURL}</a>.</li>"
228+
. "</ul>";
229+
}
207230
}

0 commit comments

Comments
 (0)