Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support independient path for htpasswd file #1

Open
mckaygerhard opened this issue Sep 22, 2021 · 0 comments
Open

support independient path for htpasswd file #1

mckaygerhard opened this issue Sep 22, 2021 · 0 comments

Comments

@mckaygerhard
Copy link

hi i liked your app.. revised the code.. You have a fairly abstract vision, which makes it difficult to collaborate if you don't have good programming skills specially when dont have good OOP skills ... that makes it difficult for any person to collaborate in your application

currently the htpasswd class ( at tools/htpasswd.php) only handles a single file and assumes a single path , so it retrieves the path from the protected directory, that's fine only for shitty apache like noob admins..

in best practice deploys those files are far away from that dir,, so i guess i better to change it on the ini file in that way:

  1. make a new key item named secure_file or htpasswd file
  2. in constructor of htpasswd class ( at tools/htpasswd.php) add the supprot of independient paths
  3. make a first string extract with $fch = substr($htpasswdfile, 0, 1);
  4. compared if start with / suing strcmp($fch, '/') if TRUE then use absolute paths,
  5. make a second string extract with $fch = substr($htpasswdfile, 0, 3);
  6. compared if start with ../ suing strcmp($fch, '../') if TRUE use directory app path as reference
  7. if both fails.. use the protected directory

thanks in advance, i suggest another more advanced option.. by usage the more advanced htpasswd class that support groups

that class provides a htpasswd with group support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant