Skip to content
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

Registration.php - code improvement #187

Merged
merged 3 commits into from
Aug 24, 2013
Merged

Conversation

devplanete
Copy link
Contributor

Rather than directly use $_POST and $_GET inside functions of the class, I have added some parameters to class functions.

It's far more easy to know now input data needed by each functions

  • registerNewUser($user_name, $user_email, $user_password, $user_password_repeat, $captcha)
  • verifyNewUser($user_id, $user_activation_hash)
  • sendVerificationEmail($user_id, $user_email, $user_activation_hash)

Some private variables have been removed because not use anymore.

At user creation, I record inside database the current datetime and the ip address used

devplanete added 3 commits August 24, 2013 11:15
Rather than directly use $_POST and $_GET inside functions of the class, I have added some parameters to class functions.

It's far more easy to know now input data needed by each functions 
- registerNewUser($user_name, $user_email, $user_password, $user_password_repeat, $captcha)
- verifyNewUser($user_id, $user_activation_hash)
- sendVerificationEmail($user_id, $user_email, $user_activation_hash)

Some private variables have been removed because not use anymore.

At user creation, I record inside database the current datetime and the ip address used
@panique
Copy link
Owner

panique commented Aug 24, 2013

I really like your work! Thanks ;)

panique added a commit that referenced this pull request Aug 24, 2013
Registration.php - code improvement
@panique panique merged commit 31c8623 into panique:develop Aug 24, 2013
@GrahamCampbell
Copy link
Contributor

@panique I agree!
@devplanete Good stuff here!

@panique
Copy link
Owner

panique commented Aug 25, 2013

@devplanete Sorry man, but this this broke the code of 2-advanced ! :(

#1067 - Invalid default value for 'user_registration_datetime' when trying to create the database table. Can you please fix that ?

@panique
Copy link
Owner

panique commented Aug 25, 2013

This seems to be an impossible combination of table coloumn type & default value, please check this StackOverflow-question/answer: How do you set a default value for a MySQL Datetime column?.

@panique
Copy link
Owner

panique commented Aug 25, 2013

Btw another little thing: current_timestamp in a datetime field seems to be invalid, but possible in MySQL 5.6.5, see this comment from stackoverflow. We should really make the script as backwards-compatible as possible ;)

It is possible from version 5.6.5, see Gustav's answer below (I realize your answer was posted when MySQL was still 5.0!) – ring0 Mar 3 at 13:57

@GrahamCampbell
Copy link
Contributor

I'd say this script should retain compatibility with MySQL 5.1.

@devplanete
Copy link
Contributor Author

I have just reinstall my mysql server, so I use the last version of it.

I will fix the issue in a few minutes...

@GrahamCampbell
Copy link
Contributor

Fixed by @devplanete at #189.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants