Skip to content
Snippets Groups Projects
Commit 3c321442 authored by Tim Steiner's avatar Tim Steiner
Browse files

Enable email address changes without password confirmation when CAS is enabled.

Also make it impossible to edit the user profile form to change a password even thought the fields are normally hidden.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@182 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 219cfdd9
Branches
Tags
No related merge requests found
......@@ -102,10 +102,27 @@ function unl_cas_form_alter(&$form, $form_state, $form_id)
$form['picture']['#description'] = 'To change your picture, visit <a href="http://planetred.unl.edu/pg/profile/unl_' . $GLOBALS['user']->name .'">Planet Red</a>.';
$form['picture']['picture_delete']['#type'] = 'hidden';
$form['picture']['picture_upload']['#type'] = 'hidden';
// Disable checking the current password when changing email.
if ($validate_password_index = array_search('user_validate_current_pass', $form['#validate']) !== FALSE) {
unset($form['#validate'][$validate_password_index]);
}
$form['#validate'][] = 'unl_cas_user_profile_form_validate';
}
}
/**
* Make sure there's no funny business with somebody trying to change a password when we're using CAS.
*/
function unl_cas_user_profile_form_validate(&$form, &$form_state)
{
if ($form_state['values']['pass']) {
form_set_error('current_pass', t('Password changes are not allowed when CAS is enabled!'));
}
}
function unl_cas_user_logout($account)
{
session_destroy();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment