Add login icon
This commit is contained in:
parent
e93b07f890
commit
fe1e012db3
@ -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> ☰</big></a>\n";
|
||||
$result .= "\t<a href=\"#menu\" id=\"menu_toggle\"><big>☰ </big>MENU</a>\n";
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user