Improve compatibility between 'user' and 'password policy tab' modules

This commit is contained in:
Manuel Cillero 2017-08-18 00:06:44 +02:00
parent 56910ad47f
commit 7ac2bb7013
3 changed files with 15 additions and 3 deletions

View file

@ -1145,7 +1145,8 @@ function user_menu() {
if (($categories = _user_categories($empty_account)) && (count($categories) > 1)) {
foreach ($categories as $key => $category) {
// 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK.
if ($category['name'] != 'account') {
// 'password' is handled by password_policy_password_tab module if it is installed.
if ($category['name'] != 'account' && (!module_exists('password_policy_password_tab') || $category['name'] != 'password')) {
$items['user/%user_category/edit/'. $category['name']] = array(
'title callback' => 'check_plain',
'title arguments' => array($category['title']),

View file

@ -42,7 +42,7 @@ function user_pass() {
function user_pass_validate($form, &$form_state) {
$name = trim($form_state['values']['name']);
// Try to load by email.
$account = user_load(array('mail' => $name, 'status' => 1));