Code Monkey home page Code Monkey logo

htadmin's Introduction

HTAdmin

HTAdmin is a simple htpasswd editor implemented in PHP with a nice frontend (based on bootstrap). It's intended to update and maintain users and password hashes in a .htpasswd file. The admin has to create a user, but every user can change his password by himself using a self service area. It is also possible to send a password reset mail. You can use the .htpasswd with nginx and Apache, in the example we use nginx.

It comes with a preconfigured docker-compose.yml, so you don't have to install a LAMP stack locally for testing but can use docker instead.

You find the application in app/htadmin and the area to secure for testing in app/test.

Screenshot

Since both the nginx and the php-fpm run as the www-data user, change the group for the app folder and everything within:

chgrp -R www-data app

PHP needs write permission for the user www-data.

Create a config.ini within app/htadmin/config from the included example file config.ini.example.

Install a recent docker and docker-compose and run:

docker-compose up -d

After the build of the PHP image and startup of the containers point your browser to:

http://localhost/htadmin/

Standard access: admin / admin, make sure to change that in your ...config/config.ini for other purposes than testing. You have to enter a hashed password, there is a tool for its generation included in the webapp:

http://localhost/htadmin/adminpwd.php

the .htaccess and .htpasswd files are configured for this folder:

http://localhost/test/

Uses the following libraries:

https://github.com/PHPMailer/PHPMailer

Enjoy!

htadmin's People

Contributors

soster avatar stefanostermann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

htadmin's Issues

support for groups in the management, as doen in meta file

when 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

this issue is not only the usage of a new class as https://www.kavoir.com/2012/04/php-class-for-handling-htpasswd-and-htgroup-member-login-user-management.html ( that class provides a htpasswd with group support! )

but also the management of the gui ones.. at includes/user_table.php (that list only user and mail, will now must list group also) and model/meta_model.php (that abstract for OOP the user object from .htpasswd and .meta files now must hable a group array and now only a grou item)

i request for this cos the main clases index.php it calls itselft to manage all the things.. by the usage of the rest of clasess. too abstrac and great .. but complicated for me! thanks` in advance.

support independient path for htpasswd file

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.