[mythtv] Simple MythWeb hack...help needed

Michael Tiller michael.tiller at gmail.com
Fri Nov 16 12:53:13 UTC 2007

OK, here is what I did and it seems to work.

First, I installed the mod_auth_openid
module<http://butterfat.net/wiki/Projects/ModAuthOpenID>(I had to use
the one from the SVN repository to get it to build).  Then I
just turned on the authentication with the directive:

AuthOpenIDEnabled                 On

This passes the authenticated users OpenID as "REMOTE_USER" in the request.
So then I modified session.php in MythWeb to include this fragment of PHP

    if (!empty($_SERVER['REMOTE_USER'])) {
      $authusers = array("http://openid1", "http://openid2"); // Obviously,
I put legit URLs in mine
      $remuser = $_SERVER['REMOTE_USER'];
      $authorized = False;
      foreach ($authusers as $authuser) {
        if ($authuser==$remuser) {
          $authorized = True;
      if (!$authorized) {
        echo "Sorry, '".$remuser."' is not authorized to access this site.

Now remember, I don't know PHP so I'm happy for constructive feedback on how
to make this better.  So if anybody wants to make their MythWeb OpenID
enabled, this is one way to do it.


On Nov 15, 2007 6:05 PM, Michael Tiller <michael.tiller at gmail.com> wrote:

> I'm a big OpenID <http://openid.net/> fan and I want to put my MythWeb
> behind an OpenID authentication check.  That wasn't so much of a problem,
> but the mod_auth_openid module for Apache only handles authentication, not
> authorization.  The rationale there is that the web app should handle
> authorization.  So I need a way *in MythWeb* to bounce users based on the
> value of REMOTE_USER.  I don't know PHP so I thought perhaps somebody here
> might be able to give me some hints about how to formulate and where to put
> code that would bounce people.
> Any help greatly appreciated and I'd be glad to contribute back a complete
> write up on how I did it.
> --
> Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-dev/attachments/20071116/2538f3d5/attachment.htm 

More information about the mythtv-dev mailing list