loginpagefoo/README.MD
2021-01-10 17:48:16 +01:00

1.9 KiB

Login Page POC

GitHub license GitHub forks GitHub issues

Docker Image (GitHub Workflow Status)

Some poc of a login / register setup with php & mysql

Setup:

Dependencies:

  • webserver (tested with nginx)
  • php 7.4
  • mysqld/mariad
  1. Clone this repo
  2. Create a database
  3. Create a user and grant access to database
  4. Change "login.php" & "register.php"
  5. Have fun!

Features:

Implemented

  • Login
  • PHP Session ID
  • Password Validation
  • Name & Surname
  • Menu with different options for logged in users on the /secure.php page
  • Reset password
  • Profile page (/profile.php)
  • User activation

Need implementation:

  • Change password (#2) (currently only via forgot password)
  • Change email (#6)
  • Change Names (#4)
  • Page only accessible for users that are validated (#16)

Thanks for flying penguin stack overflow stealing! <3

Database Setup:

# mysql -u root -p

in the mysql shell do the following:

CREATE DATABASE usertable;
CREATE USER 'usertable'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON usertable.* TO 'usertable'@'localhost';
FLUSH PRIVILEGES;
exit

Test if you were successfull with:

# mysql -u usertable -p

Import the empty database like this:

# mysql -u usertable --password=password usertable < usertable.sql