Skip to content
Snippets Groups Projects
Commit d0341635 authored by Martin Haase's avatar Martin Haase
Browse files

now valid XHTML

git-svn-id: https://textgridlab.org/svn/textgrid/trunk/middleware/tgauth@6233 7c539038-3410-0410-b1ec-0f2a7bf1c452
parent 26b415bc
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ $authZinstance = $_REQUEST["authZinstance"]; ...@@ -21,7 +21,7 @@ $authZinstance = $_REQUEST["authZinstance"];
$rbacInstance = $xpath->query("/c:conf/c:authz[@instance='${authZinstance}']"); $rbacInstance = $xpath->query("/c:conf/c:authz[@instance='${authZinstance}']");
if ($rbacInstance->length == 0) if ($rbacInstance->length == 0)
{ {
echo "Error: '${authZinstance}' has no RBAC base configured!<br>\n"; echo "Error: '${authZinstance}' has no RBAC base configured!<br/>\n";
exit; exit;
} }
...@@ -236,8 +236,15 @@ try { ...@@ -236,8 +236,15 @@ try {
// We will arrive here only if all went well. // We will arrive here only if all went well.
// Otherwise, format_error() will be called which prints its own header and footer // Otherwise, format_error() will be called which prints its own header and footer
echo "<HTML><HEAD>\n"; // Header -----------------------------
// Header ------------------------------------------------------------
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n";
echo "<head>\n";
echo "<title>Authentication Succeeded</title>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n";
// Data --------------------------------------------------------------
echo "<meta name=\"remote_principal\" content=\"$remote_user\"/>\n"; echo "<meta name=\"remote_principal\" content=\"$remote_user\"/>\n";
echo "<meta name=\"rbac_session_status\" content=\"$scstatus\"/>\n"; echo "<meta name=\"rbac_session_status\" content=\"$scstatus\"/>\n";
echo "<meta name=\"rbac_sessionid\" content=\"$newSid\"/>\n"; echo "<meta name=\"rbac_sessionid\" content=\"$newSid\"/>\n";
...@@ -254,16 +261,16 @@ echo "}\n"; ...@@ -254,16 +261,16 @@ echo "}\n";
echo "-->\n"; echo "-->\n";
echo "</script>\n"; echo "</script>\n";
echo "</HEAD>\n\n<BODY>\n"; echo "</head>\n<body>\n";
echo "<H2>Authentication Succeeded</H2>\n"; echo "<h2>Authentication Succeeded</h2>\n";
echo "You were successfully authenticated with User ID '<b>" . $remote_user . "</b>'. You may now access remote resources using the TextGrid Lab. This window can be closed.<br>\n"; echo "<p>You were successfully authenticated with User ID '<b>" . $remote_user . "</b>'. You may now access remote resources using the TextGrid Lab. This window can be closed.</p>\n";
// experimental: Logout // experimental: Logout
//echo "<br/><br/>"; //echo "<br/><br/>";
// das hier beendet nur die SP-Session, IdP bleibt... // das hier beendet nur die SP-Session, IdP bleibt...
//echo "Click <A HREF=\"https://auth.textgrid.daasi.de/Shibboleth.sso/Logout\">here</A> if you want to log out."; //echo "Click <a href=\"https://auth.textgrid.daasi.de/Shibboleth.sso/Logout\">here</a> if you want to log out.";
// das hier sollte den Browser schließen, tuts aber nicht... // das hier sollte den Browser schließen, tuts aber nicht...
//echo "<form action=\"\"><input type=\"button\" value=\"Log Out\" onclick=\"window.close()\"></form>"; //echo "<form action=\"\"><input type=\"button\" value=\"Log Out\" onclick=\"window.close()\"></form>";
...@@ -272,8 +279,8 @@ echo "</HEAD>\n\n<BODY>\n"; ...@@ -272,8 +279,8 @@ echo "</HEAD>\n\n<BODY>\n";
//s. http://de.selfhtml.org/javascript/objekte/document.htm#cookie... //s. http://de.selfhtml.org/javascript/objekte/document.htm#cookie...
// Details ----------------------------------------------- // Details -----------------------------------------------
echo "More <A HREF=\"javascript:toggle('d123')\">Details</A>.\n"; echo "<p>More <a href=\"javascript:toggle('d123')\">Details</a>.</p>\n";
echo "<div id=\"d123\"> <H2>Authentication Details</H2>\n"; echo "<div id=\"d123\"> <h2>Authentication Details</h2>\n";
echo "<table><tr><td>TgAuth Instance</td><td>". $rbacbase ."</td></tr>\n"; echo "<table><tr><td>TgAuth Instance</td><td>". $rbacbase ."</td></tr>\n";
echo "<tr><td>Shibboleth Identity ProviderID</td><td>". $identity_provider ."</td></tr>\n"; echo "<tr><td>Shibboleth Identity ProviderID</td><td>". $identity_provider ."</td></tr>\n";
echo "<tr><td>User ID Attribute Name</td><td>". $identified_user['authnmethod'] ."</td></tr>\n"; echo "<tr><td>User ID Attribute Name</td><td>". $identified_user['authnmethod'] ."</td></tr>\n";
...@@ -288,7 +295,7 @@ echo "</div>"; ...@@ -288,7 +295,7 @@ echo "</div>";
setNameInRBAC(); setNameInRBAC();
echo "\n</BODY>\n</HTML>"; echo "\n</body>\n</html>";
exit; exit;
...@@ -298,7 +305,13 @@ function format_error ($heading, $detail) { ...@@ -298,7 +305,13 @@ function format_error ($heading, $detail) {
global $remote_user, $scstatus, $newSid, $rbacbase, $identity_provider, $identified_user; global $remote_user, $scstatus, $newSid, $rbacbase, $identity_provider, $identified_user;
echo "<HTML><HEAD>\n"; // Header ------------------------------------------------------------
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">";
echo "<head>\n";
echo "<title>Authentication Failed</title>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n";
echo "<meta name=\"remote_principal\" content=\"$remote_user\"/>\n"; echo "<meta name=\"remote_principal\" content=\"$remote_user\"/>\n";
echo "<meta name=\"rbac_session_status\" content=\"$scstatus\"/>\n"; echo "<meta name=\"rbac_session_status\" content=\"$scstatus\"/>\n";
echo "<meta name=\"rbac_sessionid\" content=\"$newSid\"/>\n"; echo "<meta name=\"rbac_sessionid\" content=\"$newSid\"/>\n";
...@@ -313,16 +326,16 @@ echo " obj.style.display=\"block\";\n"; ...@@ -313,16 +326,16 @@ echo " obj.style.display=\"block\";\n";
echo "}\n"; echo "}\n";
echo "-->\n"; echo "-->\n";
echo "</script>\n"; echo "</script>\n";
echo "</HEAD>\n\n<BODY>\n"; echo "</head>\n\n<body>\n";
echo "<H2>Authentication Failure, $heading</H2>\n"; echo "<h2>Authentication Failure, $heading</h2>\n";
echo "The Authentication system could not authenticate you.<br/>\n"; echo "<p>The Authentication system could not authenticate you.</p>\n";
echo "More <A HREF=\"javascript:toggle('d123')\">Details</A>.\n"; echo "<p>More <a href=\"javascript:toggle('d123')\">Details</a>.</p>\n";
echo "<div id=\"d123\">"; echo "<div id=\"d123\">";
echo "<H2>Error Details</H2>\n"; echo "<h2>Error Details</h2>\n";
echo $detail; echo "<p>". $detail ."</p>" ;
echo "<H2>Authentication Details</H2>\n"; echo "<h2>Authentication Details</h2>\n";
echo "<table><tr><td>TgAuth Instance</td><td>". $rbacbase ."</td></tr>\n"; echo "<table><tr><td>TgAuth Instance</td><td>". $rbacbase ."</td></tr>\n";
echo "<tr><td>Shibboleth Identity ProviderID</td><td>". $identity_provider ."</td></tr>\n"; echo "<tr><td>Shibboleth Identity ProviderID</td><td>". $identity_provider ."</td></tr>\n";
echo "<tr><td>User ID Attribute Name</td><td>". $identified_user['authnmethod'] ."</td></tr>\n"; echo "<tr><td>User ID Attribute Name</td><td>". $identified_user['authnmethod'] ."</td></tr>\n";
...@@ -330,10 +343,10 @@ echo "<tr><td>User ID Value </td><td>".$remote_user."</td></tr>\n"; ...@@ -330,10 +343,10 @@ echo "<tr><td>User ID Value </td><td>".$remote_user."</td></tr>\n";
echo "<tr><td>TgAuth Session ID</td><td>".$newSid."</td></tr></table>\n"; echo "<tr><td>TgAuth Session ID</td><td>".$newSid."</td></tr></table>\n";
echo "</div>"; echo "</div>";
echo "<br/>If not indicated otherwise in the <A HREF=\"javascript:toggle('d123')\">details</A>, it could be that some service is not responding temporarily. In this case, please <a href=\"javascript:history.back()\">go back</a> or re-open the TextGridLab and try again."; echo "<p>If not indicated otherwise in the <a href=\"javascript:toggle('d123')\">details</a>, it could be that some service is not responding temporarily. In this case, please <a href=\"javascript:history.back()\">go back</a> or re-open the TextGridLab and try again.</p>";
echo "<br/>If the problem persists, please report this bug together with its time of occurence (" . date("Y-m-d H:i:s") . "). In the TextGridLab, choose 'Help-&gt;Report Bug'." ; echo "<p>If the problem persists, please report this bug together with its time of occurence (" . date("Y-m-d H:i:s") . "). In the TextGridLab, choose 'Help-&gt;Report Bug'.</p>" ;
echo "\n</BODY>\n</HTML>"; echo "\n</body>\n</html>";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment