1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
4 /* all the clever stuff happens in openid.php */
5 class MTrackAuth_OpenID implements IMTrackAuth, IMTrackNavigationHelper {
6 function __construct() {
7 MTrackAuth::registerMech($this);
8 MTrackNavigation::registerHelper($this);
11 function augmentUserInfo(&$content) {
13 if (isset($_SESSION['openid.id'])) {
14 $content .= " | <a href='{$ABSWEB}openid.php/signout'>Log off</a>";
16 $content = "<a href='{$ABSWEB}openid.php'>Log In</a>";
20 function augmentNavigation($id, &$items) {
23 function authenticate() {
24 if (!strlen(session_id()) && php_sapi_name() != 'cli') {
27 if (isset($_SESSION['openid.id'])) {
28 if (isset($_SESSION['openid.userid'])) {
29 return $_SESSION['openid.userid'];
31 return $_SESSION['openid.id'];
36 function doAuthenticate($force = false) {
39 header("Location: {$ABSWEB}openid.php");
45 function enumGroups() {
49 function getGroups($username) {
53 function addToGroup($username, $groupname) {
57 function removeFromGroup($username, $groupname) {
61 function getUserData($username) {