coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: bit bit spears on March 29, 2004, 01:41:16 AM

Title: accessing / authenticating user/pass through .htpasswd
Post by: bit bit spears on March 29, 2004, 01:41:16 AM
Ok, i scrunged up this code to produce an htaccess password login screen, but am having trouble coding it into coppermine, any ideas?

<?php 

// --------- DATABASE INFORMATION --------- 
$USER "user"
$PASS "pass"
    
function 
error &#40;$error_message&#41; &#123; 
   
echo $error_message."The information you have entered does not match the information in our database please try again."
   exit; 
&
#125; 
if &#40; &#40;!isset&#40;$PHP_AUTH_USER&#41;&#41; || ! &#40;&#40;$PHP_AUTH_USER == $USER&#41; && &#40; $PHP_AUTH_PW == "$PASS" &#41;&#41; &#41; &#123; 
   
header&#40;"WWW-Authenticate&#58; Basic entrer=\"Form2txt admin\""&#41;; 
   
header&#40;"HTTP/1.0 401 Unauthorized"&#41;; 
   
error&#40;""&#41;; 
&#125;

?>

Title: Re: accessing / authenticating user/pass through .htpasswd
Post by: Weps on June 20, 2004, 03:35:56 PM
I would also like to use a htaccess protection, synchronized with the coppermine users database.  So if you enter the user information in de the htaccess password box, you should be logged in in coppermine.  Is this possible?
Title: Re: accessing / authenticating user/pass through .htpasswd
Post by: Joachim Müller on June 20, 2004, 04:15:42 PM
There's a reason why nobody answered tb's thread in the first place. After all, things are not that easy, so for now it's just wishfull thinking.

GauGau