mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-29 15:01:08 -05:00
make login work for php-fastcgi
This commit is contained in:
parent
15ad0457e5
commit
6d00897ed1
@ -3,6 +3,9 @@ RewriteEngine on
|
|||||||
RewriteCond $1 !^(index\.php|static|favicon\.ico|robots\.txt|sitemap.xml|google(.+)\.html)
|
RewriteCond $1 !^(index\.php|static|favicon\.ico|robots\.txt|sitemap.xml|google(.+)\.html)
|
||||||
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
|
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
|
||||||
|
|
||||||
|
# basic auth for PHP with fastcgi
|
||||||
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
|
||||||
|
|
||||||
SetOutputFilter DEFLATE
|
SetOutputFilter DEFLATE
|
||||||
FileETag MTime Size
|
FileETag MTime Size
|
||||||
|
|
||||||
@ -32,3 +35,5 @@ FileETag MTime Size
|
|||||||
#AuthName "Backend"
|
#AuthName "Backend"
|
||||||
#AuthUserFile /path/to/.htpasswd #create one with htpasswd -c .htpasswd username
|
#AuthUserFile /path/to/.htpasswd #create one with htpasswd -c .htpasswd username
|
||||||
#Require user username
|
#Require user username
|
||||||
|
|
||||||
|
AddHandler php5-fastcgi .php .php5
|
||||||
|
@ -22,6 +22,9 @@ class Spamadmin extends CI_Controller
|
|||||||
$user = $this->config->item('spamadmin_user');
|
$user = $this->config->item('spamadmin_user');
|
||||||
$pass = $this->config->item('spamadmin_pass');
|
$pass = $this->config->item('spamadmin_pass');
|
||||||
|
|
||||||
|
// basic auth for fastcgi
|
||||||
|
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
|
||||||
|
|
||||||
if ($user == '' || $pass == '' || !isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != $user || $_SERVER['PHP_AUTH_PW'] != $pass)
|
if ($user == '' || $pass == '' || !isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != $user || $_SERVER['PHP_AUTH_PW'] != $pass)
|
||||||
{
|
{
|
||||||
header('WWW-Authenticate: Basic realm="Spamadmin"');
|
header('WWW-Authenticate: Basic realm="Spamadmin"');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user