NConf 1.3.0 Pass-through HTTPD Auth

If you’d like to use NConf, but want your HTTPD, e.g. Apache, to do the auth for it, apply the below patch to set the NConf user to the currently authenticated user.

--- include/head.php.orig    2012-04-03 19:34:13.774594705 +0000
+++ include/head.php    2012-04-03 19:21:39.470169672 +0000
@@ -70,7 +70,12 @@
 }else{
     // NO authentication
     $_SESSION['group'] = GROUP_ADMIN;
-    $_SESSION["userinfos"]['username'] = GROUP_ADMIN;
+    # M@
+    if( isset($_SERVER['REMOTE_USER']) ){
+    $_SESSION["userinfos"]['username'] = $_SERVER['REMOTE_USER'];
+    }else{
+        $_SESSION["userinfos"]['username'] = GROUP_ADMIN;
+    }
     message($debug, 'authentication is disabled');
     message($debug, $_SESSION["group"].' access granted');
 }
This entry was posted in Coding, Linuxy, Work. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *