SetEnv PHP_VER 5_3
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
</IfModule>
.
.
.
/**
* Helper function, checks for login..
*
*/
function passwordcheck_login($page) {
global $PIVOTX;
if (trim($PIVOTX['config']->get('passwordprotect_allaccessip')) != '') {
$allaccessip = trim($PIVOTX['config']->get('passwordprotect_allaccessip'));
$ipnumbers = explode(',',$allaccessip);
$granted = false;
foreach($ipnumbers as $ipnumber) {
$ipnumber = trim($ipnumber);
if (substr($ipnumber,-1) == '.') {
// simple pattern
if (strpos($_SERVER['REMOTE_ADDR'],$ipnumber) !== false) {
$granted = true;
}
}
else if ($ipnumber == $_SERVER['REMOTE_ADDR']) {
$granted = true;
}
}
if ($granted === true) {
return true;
}
}
if((!$_SERVER['PHP_AUTH_USER'] || !$_SERVER['PHP_AUTH_USER'])
&& preg_match('/Basic\s+(.*)$/i',$_SERVER['REMOTE_USER'], $matches)) {
list($name, $password) = explode(':', base64_decode($matches[1]));
$_SERVER['PHP_AUTH_USER'] = strip_tags($name);
$_SERVER['PHP_AUTH_PW'] = strip_tags($password);
}
$user = $_SERVER['PHP_AUTH_USER'];
$passed_password = $_SERVER['PHP_AUTH_PW'];
$default_password = $PIVOTX['config']->get('passwordprotect_default');
.
.
.
Users browsing this forum: No registered users and 5 guests