mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -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)
|
||||
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
|
||||
|
||||
# basic auth for PHP with fastcgi
|
||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
|
||||
|
||||
SetOutputFilter DEFLATE
|
||||
FileETag MTime Size
|
||||
|
||||
@ -32,3 +35,5 @@ FileETag MTime Size
|
||||
#AuthName "Backend"
|
||||
#AuthUserFile /path/to/.htpasswd #create one with htpasswd -c .htpasswd username
|
||||
#Require user username
|
||||
|
||||
AddHandler php5-fastcgi .php .php5
|
||||
|
@ -21,6 +21,9 @@ class Spamadmin extends CI_Controller
|
||||
//protection
|
||||
$user = $this->config->item('spamadmin_user');
|
||||
$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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user