Walking through the OOP Login/Register System developed by phpacademy on YouTube.
An object oriented authentication system including the ability to register a user, log in and includes features like validation, remember me, user profiles, CSRF protection, secure password salting and various helper classes to make working with sessions, cookies, input and configuration easier.
DB's Tables needed
- Users
- Groups
- Sessions
7-columns
- id - int - primary - auto-inc
- username - varchar - 20
- password - varchar - 65 (hash)
- salt - varchar - 32
- name - name - 50
- date - datetime
- group - int
3-columns
- id - int - primary - auto-inc
- name - varchar - 20
- permissions - text (json)
- id=1 / name= Standard user / permissions=
- id=2 / name= Administrator / permissions= {"admin": 1}
3-columns
- id - int - primary - auto-inc
- user_id - int
- hash - varchar - 50