Add login icon

This commit is contained in:
Yorin Anne De Jong 2018-02-13 16:24:16 +01:00
parent e93b07f890
commit fe1e012db3
1 changed files with 8 additions and 2 deletions

View File

@ -29,14 +29,20 @@ function loginBar($sp = 'default-sp') {
require_once(__DIR__ . '/../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple($sp);
$svg = '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 64 64">
<circle cx="32" cy="27" r="14" stroke-width="0" fill="white" />
<ellipse cx="32" cy="66" rx="24" ry="28" stroke-width="0" fill="white" />
</svg>
';
$attr = $as->getAttributes();
if($attr) {
$uname = $attr['uid'][0];
$result .= "\t<p id=\"login\">logget inn som: " . htmlspecialchars($uname) . "</p>\n";
} else {
$result .= "\t<a id=\"login\" href=\"" . htmlspecialchars($as->getLoginURL()) . "\">logg inn</a>\n";
$result .= "\t<a id=\"login\" href=\"" . htmlspecialchars($as->getLoginURL()) . "\">${svg}Logg inn</a>\n";
}
$result .= "\t<a href=\"#menu\" id=\"menu_toggle\">MENU<big>&nbsp;&#9776;</big></a>\n";
$result .= "\t<a href=\"#menu\" id=\"menu_toggle\"><big>&#9776;&nbsp;</big>MENU</a>\n";
return $result;
}