print user name on cas login status page
authorroot <root@login1p.fsf.org>
Fri, 19 Nov 2021 20:32:01 +0000 (15:32 -0500)
committerroot <root@login1p.fsf.org>
Fri, 19 Nov 2021 20:32:01 +0000 (15:32 -0500)
themes/fsftheme/casserver/loggedIn.php

index ee5bb6797d35a71f73b60d0b559716f5eea85f53..8fe436bee6526de60943a9a5226593b53bb40fce 100644 (file)
@@ -27,7 +27,16 @@ $this->includeAtTemplateBase('includes/header.php');
 
     <p>
         <?php
-        echo $this->t('{fsfdrupalauth:fsfdrupalauth:loggedin_as_description}') . "...";
+        $casconfig = SimpleSAML_Configuration::getConfig('module_casserver.php');
+
+        $auth = new SimpleSAML\Auth\Simple($casconfig->getValue('authsource'));
+        $attrs = $auth->getAttributes();
+
+        if (!isset($attrs['name'][0])) {
+              throw new Exception('fsfdrupalauth: "name" attribute missing.');
+       }
+
+       echo $this->t('{fsfdrupalauth:fsfdrupalauth:loggedin_as_description}') . "<strong>" . htmlspecialchars($attrs['name'][0]) . "</strong>.";
         ?>
     </p>