WITH_AUTH

Help
sombragris
2011-11-30
2013-04-23
  • sombragris
    sombragris
    2011-11-30

    I don't have access to the apache configuration as I'm running this manager on a hosting service. In my hosting service the WITH_AUTH option would not work out of the box… probably because it is runing as cgi-fcgi.

    Here is what I did:

    Create an .htaccess file at the root directory of your sqlitemanager with the following contents:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
    </IfModule>
    

    At the bottom of the file SQLiteAuth.class.php located inside the include directory add:

    $sapi_type = php_sapi_name();
    if (substr($sapi_type, 0, 3) == 'cgi') {
        list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['REDIRECT_REMOTE_USER'], 6))); 
    }
    

    When I mean at the end of the file I mean just before the closing "?>" but outside of the class.