Thread: Netvision 3
View Single Post
  #3  
Old 4th April 2010, 11:27
benjaminbih benjaminbih is offline
Senior Member
 
Join Date: Jul 2008
Bosnia-Herzegovina
Posts: 70
Default
Very nice!

@hellix do you have a list of included mods?

ANd i think you need to workarround the httpauth() function to make it work with both php as apache module and php as mod_fastcgi with SuExec.
Otherwize there is no chance to login in to AdminCP if you use mod_fastcgi.

This works with suexec and php as mod_fast_cgi

Make .htaccess in root folder:
PHP Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule 
.* - [E=REMOTE_USER:%{HTTP:Authorization},L]
</
IfModule>
ErrorDocument 404 /404.php 
and change in /include/security_functions.php the function httpatuh() to this:
PHP Code:
function httpauth(){
global 
$CURUSER,$lang;

  if(isset(
$_SERVER['REDIRECT_REMOTE_USER'])) {
  
$auth_params explode(":" base64_decode(substr($_SERVER['REDIRECT_REMOTE_USER'], 6)));
  
$_SERVER['PHP_AUTH_USER'] = $auth_params[0];
  unset(
$auth_params[0]);
  
$_SERVER['PHP_AUTH_PW'] = implode('',$auth_params);
}

  if (
$CURUSER['passhash'] != md5($CURUSER['secret'].$_SERVER["PHP_AUTH_PW"].$CURUSER['secret'])) {
 
header("WWW-Authenticate: Basic realm=\"Login and Password\"");
    
header("HTTP/1.0 401 Unauthorized");
    
stderr("Error""Permission denied");

    }



Last edited by benjaminbih; 4th April 2010 at 13:12.
Reply With Quote
The Following User Says Thank You to benjaminbih For This Useful Post:
hellix (4th April 2010)