The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP and password protection

Discussion in 'General Discussion' started by lvanblerk, Sep 2, 2004.

  1. lvanblerk

    lvanblerk Registered

    Joined:
    Sep 2, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    Is there a way to use PHP to add new users to a password protected folder?

    I'd like to write a script that would take a users details and then add the username and password they supplied to the list of users allowed to access a password protected folder. Is this possible? Anybody have any suggestions?

    Thanks
    Luke
     
  2. lvanblerk

    lvanblerk Registered

    Joined:
    Sep 2, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Just discovered the passwd file

    Ok just after I posted that I discovered the .htpasswds folder and the passwd files. The format is fairly simple with a username and base64-encoded, crypted password separated by a colon, 1 per line. To add a new user would I just use the systems crypt command or would I have to have a secret key for cpanel / apache to understand the crypting?

    I hope that makes sense.

    Thanks
    Luke
     
Loading...

Share This Page