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

When using the CAS module, grab user images from planetred and disable the...

When using the CAS module, grab user images from planetred and disable the change password and change image fields on the user profile page.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@132 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 525df9c9
No related branches found
No related tags found
No related merge requests found
......@@ -86,9 +86,19 @@ function unl_cas_form_alter(&$form, $form_state, $form_id)
if ($form_id == 'user_login') {
$_SESSION['unl_cas']['previous_path'] = request_path();
$cas = unl_cas_get_adapter();
//$cas->setRenew();
drupal_goto($cas->getLoginUrl());
}
if ($form_id == 'user_profile_form') {
$form['account']['pass']['#type'] = 'hidden';
$form['account']['current_pass_required_values']['#type'] = 'hidden';
$form['account']['current_pass']['#type'] = 'hidden';
$form['picture']['#description'] = 'To change your picture, visit <a href="http://planetred.unl.edu">planetred</a>.';
$form['picture']['picture_delete']['#type'] = 'hidden';
$form['picture']['picture_upload']['#type'] = 'hidden';
}
}
function unl_cas_user_logout($account)
......@@ -121,3 +131,10 @@ function unl_cas_import_user($username)
return $user;
}
function unl_cas_preprocess_user_picture(&$variables)
{
//Default image: http://planetred.unl.edu/mod/profile/graphics/defaulttopbar.gif
$username = $variables['account']->name;
$variables['user_picture'] = '<img src="http://planetred.unl.edu/pg/icon/unl_' . $username . '/large" alt="alt" />';
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment