In Global Configuration, set the New User Account Activation
to None
Then try to register a new user.
The user is created with no errors or warnings
The user is created with the following errors/warnings
Warning :
Message
The mail function has been disabled by an administrator.
Error :
An error was encountered while sending the registration email. A message has been sent to the administrator of this site.
apache 2.4.18-2ubuntu3.9
Joomla 3.8.13
I am in a localhost and do not have mail setup. So I understand why I get those errors.
The problem is that I am developing a component and in my controller I call the register() method
of the UsersModelRegistration.
Because there is no mail in my system the method returns false which is not true because the user is created.
The point is that since the New User Account Activation is set to None and the user is created then the returned value from the UsersModelRegistration::register method should return true (even with warnings) because the requested action (user registration) is completed.
In the UsersModelRegistration :
public function register($temp)
{
$params = JComponentHelper::getParams('com_users');
JLog::add('$params :' . print_r($params,1), JLog::DEBUG, 'site.user.registration.model.register');
...
The log
DEBUG 127.0.0.1 site.user.registration.model.register $params :Joomla\Registry\Registry Object
(
[data:protected] => stdClass Object
(
[allowUserRegistration] => 1
[new_usertype] => 2
[guest_usergroup] => 9
[sendpassword] => 0
[useractivation] => 0
[mail_to_admin] => 0
[captcha] =>
[frontend_userparams] => 1
[site_language] => 0
[change_login_name] => 0
[reset_count] => 10
[reset_time] => 1
[minimum_length] => 4
[minimum_integers] => 0
[minimum_symbols] => 0
[minimum_uppercase] => 0
[save_history] => 1
[history_limit] => 5
[mailSubjectPrefix] =>
[mailBodySuffix] =>
[debugUsers] => 1
[debugGroups] => 1
[sef_advanced] => 0
[custom_fields_enable] => 1
)
[initialized:protected] => 1
[separator] => .
)
Labels |
Added:
?
|
Labels |
Added:
J3 Issue
|
Labels |
Removed:
J3 Issue
|
Labels |
Added:
J3 Issue
|
In the frontend.
Right now I installed postfix and sendmail in my system and it works fine.
I have a register function in my Controller.
function register() {
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$lang = JFactory::getLanguage();
$lang->load('com_users', JPATH_SITE, $lang->getTag(), true);
$input = $app->input;
$currentUri = (string) JUri::getInstance();
jimport('joomla.application.component.helper');
$user = new JUser;
$data = $input->get('jform', array(), 'array');
require_once JPATH_SITE . '/components/com_users/models/registration.php';
$regModel = $this->getModel('Registration', 'UsersModel');
$return = $regModel->register($data);
$app->setUserState('com_client.registration.data', $data);
if (!$return) {
$this->setMessage($regModel->getError(), 'error');
$this->setRedirect(JRoute::_($currentUri, false));
return false;
} else {
$this->setRedirect(JRoute::_('index.php));
return true;
}
}
Status | New | ⇒ | Information Required |
@mixahlos can this Issue be closed?
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-03-16 06:10:53 |
Closed_By | ⇒ | joomla-cms-bot |
Closed_By | joomla-cms-bot | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/22857
closed as no Response; please reopen if needed.
Were you creating this user in the admin or the frontend?