Since we're only permitting logging in via the Drupal Admin and LDAP.
How might I turn off or hide these fields in the User's Edit Account (user/xx/edit
) tab?
To hide the password fields on the user edit form, put this code in your custom module, which implements hook_form_FORM_ID_alter():
function YOURMODULE_form_user_profile_form_alter(&$form, &$form_state, $form_id) {
hide($form['account']['pass']);
}
You may also want to prevent users from going to user/password
page and change their passwords on that page:
function YOURMODULE_menu_alter(&$items) {
$items['user/password']['access callback'] = 'user_access';
$items['user/password']['access arguments'] = array('administer users');
}
One more hint, if you want to remove the links on the user login block:
function YOURMODULE_form_user_login_block_alter(&$form, &$form_state, $form_id) {
$form['links'] = '';
}