-
Notifications
You must be signed in to change notification settings - Fork 790
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
[REFACTORING/IMPROVEMENT] 1-minimal deep rewrite #98
Conversation
Rewrite by taking advantage of PHP filter functions
typo fix
added charset set up in DB connection parameters
added DB charset and using PHP 5.3+ const definition
Updated Error message to better handle internationalisation move DB connection into the constructor method
typo fix
Merge methods and properties between Registration.php and Login.php
Login is rewrite to extends Auth
Base Class to be extended by Login and Registration
using Auth::$regexp to normalize pattern info
Excellent work, BIG thanks from my side! But unfortunatly you have written this in the master branch. All changes are always pushed into develop branch and tested there until declared stable, and then merged into master branch. So, can you please open a new branch for your changes OR do it in the develop ? As a lot of people download this every day we cannot publish untested stuff directly in master... Thanks again, i love your work! |
Another note on that: Your code is really professional, and i think it's TOO professional! The problem here is that it's not self-explaining and easy-to-change for most people (?). The goal of this project was always to keep the code very easy, understandable and without high-end-code-constructs. Please don't me wrong, i totally love your code, but some parts of Registration.php might be too advanced to this SIMPLE script. I think a lot of non-advanced people are using the script and they should be able to understand nearly every line of code by simply reading them... Let's discuss this! |
@the4ndy Don't know what you mean, maybe you have unintentionally subscribed to this thread ? Usually you should not get any mails from github unless you are the author of a project or have explicitly subscribed to something. It's not in my hands, sorry... |
Okay I'll create a new branch then not a problem. As for the TOO professional I think the major problem would be with the error reporting and the session timeout other than that everything else is self explanatory (in my view) . When I did the error changes I though of that myself but I think it can be mitigated with a good example ? What do you think ? |
I have rewrote the Minimal to better filter and validated input data and to simplify the code. In doing so I have:
Auth
class that is extended by theRegistration
and theLogin
classAuth
class initiate the database connection and handles the possible errors;Auth
class to better handle script localization and are always attach to a context.filter_
functions to better validate user input datauser_token
property in the session to also validate a user already connected this can help to prevent session corruption and add a session timeout functionnality.db.php
file I have added the constantDB_CHARSET
which is needed to better sanitize data before injecting them into the database.Of course, the views and the mains script have been updated accordingly by adding a require to the
Auth.php
class