Loading...
 
Skip to main content

Features / Usability


Re: Adding Email Notifications

posts: 215

I regards to your first email notification request, I can tell you how to stop the user validation check. But, are you sure you want allow users to register without any validation? Removing that check could allow malicious users to register with fake email addresses.

The last column of the users_users table is named "waiting". If, in "Registration & Log in", the "Validate new user registrations by email" is checked, then the new user gets inserted into the users_users table with the waiting column set to "u". And they cannot log in until they use the validation link, which would then cause waiting column to be set to NULL.

There is also a second validation check that uses the column waiting. If "Require validation by Admin" is set, the waiting column gets set to "a", and after the Admin uses their validation link, then the waiting column get set to NULL, unless the "Validate new user registrations by email" is also set. If both the "Require validation by Admin" and "Validate new user registrations by email" options are selected, the waiting column first gets set to "a" and after the admin uses their link the column gets set to "u" and waits for the user to user their validation link.

The change below will stop both the "Validate new user registrations by email" check and the "Require validation by Admin" check, but I assume that if you don't want them to have to use the user validation link, then you probably don't want them to have to wait until the Admin validates their registration either.

When a new user registers, their users_users row gets inserted in lib/userslib.php. Replace the $waiting with NULL near the bottom of the section of code listed below.

You still have to modify the creation of the validation email. And you may loose this modification any time you apply Tiki updates.

Copy to clipboard
$query = "insert into `users_users`(`login`, `password`, `email`, `provpass`, `registrationDate`, `hash`, `pass_confirm`, `email_confirm`, `created`, `valid`, `openid_url`, `lastLogin`, `waiting`) values(?,?,?,?,?,?,?,?,?,?,?,?,?)"; $result = $this->query($query, array( $user, $pass, $email, $provpass, (int) $this->now, $hash, (int) $new_pass_confirm, (int) $new_email_confirm, (int) $this->now, $valid, $openid_url, $lastLogin, //(empty($_GLOBALS['user']) && $prefs['validateRegistration'] == 'y')? 'a': ((empty($_GLOBALS['user']) && $prefs['validateUsers'] == 'y')? 'u': NULL) $waiting ));
There are no comments at this time.