News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

accessing / authenticating user/pass through .htpasswd

Started by bit bit spears, March 29, 2004, 01:41:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bit bit spears

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;

?>


Weps

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?

Joachim Müller

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