Skip to content

Commit

Permalink
Merge pull request GOCDB#523 from Sae126V/GT-469-Update-to-CheckIn-re…
Browse files Browse the repository at this point in the history
…lated-entitlement-error-Dev-fork

Update code to reflect the new EGI checkin error message(Dev)
  • Loading branch information
gregcorbett authored Sep 17, 2024
2 parents 9926026 + 2ff1254 commit ebbb7e2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion htdocs/web_portal/static_html/goc5_logo.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- <img src="img/Logo-1.6.png" class="logo_image" height="39" style="vertical-align: middle;"/>-->
<h3 class="Logo_Text Small_Bottom_Margin Standard_Padding"
style="vertical-align: middle; margin-left: 0.2em;">
GOCDB 5.12.0
GOCDB 5.12.1
</h3>

</a>
Expand Down
27 changes: 25 additions & 2 deletions lib/Authentication/AuthTokens/ShibAuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private function getAttributesInitToken(){
}
if(empty($_SERVER['entitlement'])){
//die('Did not recieve the required entitlement attribute from the EGI Proxy IdP, please contact gocdb-admins');
$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>';
$HTML = $this->getEntitlementErrorMessage();
$HTML .= "<div style='text-align: center;'>";
$HTML .= '<a href="'.htmlspecialchars(\Factory::$properties['LOGOUTURL']).'"><b><font colour="red">Logout</font></b></a>';
$HTML .= "</div>";
Expand All @@ -132,7 +132,7 @@ private function getAttributesInitToken(){

$entitlementValuesArray = explode(';', $_SERVER['entitlement']);
if( !in_array('urn:mace:egi.eu:res:gocdb#aai.egi.eu', $entitlementValuesArray) ){
$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>';
$HTML = $this->getEntitlementErrorMessage();
$HTML .= "<div style='text-align: center;'>";
$HTML .= '<a href="'.htmlspecialchars(\Factory::$properties['LOGOUTURL']).'"><b><font colour="red">Logout</font></b></a>';
$HTML .= "</div>";
Expand Down Expand Up @@ -204,4 +204,27 @@ public static function isStateless() {
return true;
}

private function getEntitlementErrorMessage()
{
$refedsResAndSchURL = "https://refeds.org/category/research-and-scholarship";
$refedsSirtfiURL = "https://refeds.org/sirtfi";
$resourceLink = "https://docs.egi.eu/internal/configuration-database/access";
$sectionFragmentInfo = "/#using-institutional-account-via-egi-check-in";
$documentationURL = $resourceLink . $sectionFragmentInfo;

return "<ul>"
. "<li>Login requires the entitlement "
. "urn:mace:egi.eu:res:gocdb#aai.egi.eu, "
. "which was not provided.</li>"
. "<li>This entitlement is automatically granted "
. "when using an identity provider compliant with "
. "<a href=\"{$refedsResAndSchURL}\" target='_blank'>"
. "REFEDS R&amp;S</a> and "
. "<a href=\"{$refedsSirtfiURL}\" target='_blank'>"
. "REFEDS Sirtfi</a>.</li>"
. "<li>Please see here for more information: "
. "<a href=\"{$documentationURL}\" target='_blank'>"
. "{$documentationURL}</a>.</li>"
. "</ul>";
}
}

0 comments on commit ebbb7e2

Please sign in to comment.