Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code to reflect the new EGI checkin error message(Dev) #523

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>";
}
}