Permalink
Browse files

# [#29679] *Passwords fields not required when creating a new user in

back-end
  • Loading branch information...
1 parent 836c4a4 commit 29f71eb7ffbab3853cee984fb08ed69977bebe67 @infograf768 infograf768 committed Nov 18, 2012
Showing with 12 additions and 0 deletions.
  1. +11 −0 administrator/components/com_users/models/user.php
  2. +1 −0 installation/CHANGELOG
@@ -72,14 +72,25 @@ public function getItem($pk = null)
public function getForm($data = array(), $loadData = true)
{
$app = JFactory::getApplication();
+ $plugin = JPluginHelper::getPlugin('user', 'joomla');
+ $pluginParams = new JRegistry($plugin->params);
// Get the form.
$form = $this->loadForm('com_users.user', 'user', array('control' => 'jform', 'load_data' => $loadData));
+
if (empty($form))
{
return false;
}
+ // Passwords fields are required when mail to user is set to No in joomla user plugin
+ $userId = $form->getValue('id');
+ if ($userId === 0 && $pluginParams->get('mail_to_user') === "0")
+ {
+ $form->setFieldAttribute('password', 'required', 'true');
+ $form->setFieldAttribute('password2', 'required', 'true');
+ }
+
return $form;
}
View
@@ -30,6 +30,7 @@ $ -> Language fix or change
# [#29684] Wrong HTML markup on category edit. Thanks Ofer
# [#29528] Incorrect arrows in table heading. Thanks Dennis
# [#29687] *Adapting hathor to new message using editor
+ # [#29679] *Passwords fields not required when creating a new user in back-end
16-Nov-2012 Jean-Marie Simonet
$+ Adding Uyghur ug-CN installation files

0 comments on commit 29f71eb

Please sign in to comment.