1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
3 require_once 'Interface/Auth.php';
5 /* all the clever stuff happens in openid.php */
6 class MTrackAuth_OpenID implements IMTrackAuth, IMTrackNavigationHelper {
7 function __construct() {
8 MTrackAuth::registerMech($this);
9 MTrackNavigation::registerHelper($this);
12 function augmentUserInfo(&$content) {
14 if (isset($_SESSION['openid.id'])) {
15 $content .= " | <a href='{$ABSWEB}openid.php/signout'>Log off</a>";
17 $content = "<a href='{$ABSWEB}openid.php'>Log In</a>";
21 function augmentNavigation($id, &$items) {
24 function authenticate() {
25 if (!strlen(session_id()) && php_sapi_name() != 'cli') {
28 if (isset($_SESSION['openid.id'])) {
29 if (isset($_SESSION['openid.userid'])) {
30 return $_SESSION['openid.userid'];
32 return $_SESSION['openid.id'];
37 function doAuthenticate($force = false) {
40 header("Location: {$ABSWEB}openid.php");
46 function enumGroups() {
50 function getGroups($username) {
54 function addToGroup($username, $groupname) {
58 function removeFromGroup($username, $groupname) {
62 function getUserData($username) {