commit | abd513e5bf3ee93c72a5826e72001cdd2cf03428 | [log] [tgz] |
---|---|---|
author | matheusfillipe <matheusfillipeag@gmail.com> | Tue May 11 03:29:11 2021 -0300 |
committer | matheusfillipe <matheusfillipeag@gmail.com> | Tue May 11 03:29:11 2021 -0300 |
tree | 2f6a4ef53e92e37729e07d58d7a68cb7db767d33 |
test phase
#LDAP SIGNUP
This is a simple registration script for ldap written fully in php that will allow you to have a registration page that does all the form validation, mail confirmation and allowing some basic configuration.
##Registration process
##Dependencies
sudo apt install redis php-pear composer ocrad imagemagick sudo pear install mail sudo pear install Net_SMTP sudo pear install Auth_SASL sudo pear install mail_mime
##Installation
Clone or download this repository to some path and run: composer install
Copy the example config to the right place: mv config.php.example config.php
Then create a corresponding server vhost and a location like this(nginx):
location /signup { alias /var/www/html/; index index.php; location ~ ^/signup/(captcha\.php|index\.php) { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/run/php/php7.4-fpm.sock; include fastcgi_params; } location ~ ^/signup/static/.*(\.html|\.css|\.js)$ { root /var/www/html/; try_files $uri =404; } location ~ ^/ { rewrite ^ /signup/index.php; } }
Add your BASE_URL and other configuration options to the config.php and you might be ready to go!
##Customization
If you want to add custom css, javascript or html you can do it by editing the files on the static/
folder but be aware that all of them are loaded for any page of the registration process.
The pages you might face inside the registration process are inside the html/
folder. You can customized those templates like to add your site url in the end of registration, add a navbar to head.htm and so on.
The blacklists/
Folder contains usernames.php and passwords.php which are lists of usernames and passwords that won't be allowed.
###config.php
The example config contains many comments and the variables are self explanatory. What you need to set up to get going is your redis password, LDAP's USER, PORT, PASSWORD and HOST. You need to set SMTP and you can set $FALLBACK_SMTP = $SMTP
if you don't want to use the fallback feature.
On the BASE_DN variable, '{}' will be replaced by the username.
Don't forget to set your BASE_URL correctly. That is the url the log in page will be presented on, it will end with /signup if you used the example nginx location.
Also you might want to change the email template (MAIL_TEMPLATE variable). It has both a text and a html parameter.
You can also blacklist email services with the MAIL_HOST_BLACKLIST. User registering with those mail services won't be allowed.
MAIL_HOST_DIRECT_FALLBACK variable if set will cause the FALLBACK_SMTP to be used instead of SMTP if the user is trying to register with an email host that is on that list.