User email required...
Permalink
We are building a section of a client's site that will allow their employees to login and view information exclusively for them.
We have about 150 employees to enter into a user group and they don't have emails for them all.
How can I fix the Add User form so that the email field isn't required. I've edited the email field in the database to be NULL, but I still get the email error message when trying to add someone without an email address.
Thanks!
We have about 150 employees to enter into a user group and they don't have emails for them all.
How can I fix the Add User form so that the email field isn't required. I've edited the email field in the database to be NULL, but I still get the email error message when trying to add someone without an email address.
Thanks!
hey- I'd just disable the check if the email already exists in the db, and then just use the same email for all of them.
Thought I would update this. 12345j, that was an excellent suggestion, but in the process of looking for the code to do that, I figured it out.
In the add.php, strings.php and search.php files in the dashboard's 'users' folder, find this line and comment it out.
Once all of my users are entered, I will uncomment the line so that on their first login, they will have to update their information with an email address.
In the add.php, strings.php and search.php files in the dashboard's 'users' folder, find this line and comment it out.
if (!$vals->email($_POST['uEmail'])) { $error[] = t('Invalid email address provided.'); } else if (!$valc->isUniqueEmail($_POST['uEmail'])) { $error[] = t("The email address '%s' is already in use. Please choose another.",$_POST['uEmail']); }
Once all of my users are entered, I will uncomment the line so that on their first login, they will have to update their information with an email address.
I have the same problem - any chance to get it solved without a core hack?
Can someone update the solution to include the current location of these files? In the current version of C5, the /concrete/controllers/dashboard/users/add.php and /concrete/controllers/dashboard/users/search.php no longer contain this info and strings.php is not even present. Or if there is a newer solution, that would be great as well. I would like to prevent duplicate emails from being blocked. Thanks!
Hey TeKnoZiz, I found the line following line located in three locations after a find/replace of the entire concrete directory:
and found this:
/concrete/core/controllers/single_pages/dashboard/users/search.php
/concrete/core/controllers/single_pages/dashboard/users/add.php
/concrete/core/controllers/single_pages/register.php
I commented out the code, uploaded changes, added new users (without email) and un-commented the 3 files and reuploaded. The work around was successful. I'm running the latest version of c5 (5.6.2.1)
if (!$vals->email($_POST['uEmail'])) {
and found this:
if (!$vals->email($_POST['uEmail'])) { $this->error->add(t('Invalid email address provided.')); } else if (!$valc->isUniqueEmail($_POST['uEmail']) && $uo->getUserEmail() != $_POST['uEmail']) { $this->error->add(t("The email address '%s' is already in use. Please choose another.",$_POST['uEmail'])); }
/concrete/core/controllers/single_pages/dashboard/users/search.php
/concrete/core/controllers/single_pages/dashboard/users/add.php
/concrete/core/controllers/single_pages/register.php
I commented out the code, uploaded changes, added new users (without email) and un-commented the 3 files and reuploaded. The work around was successful. I'm running the latest version of c5 (5.6.2.1)
Great guys thanks for the replies!
One way to do it would be to automatically generate a bogus email using the login name and automatically save it upon registration so you don't need to hack the core. Something like login_name@bogus.com for everybody. login name is supposed to be unique so email would be unique as well.