You are here

function user_pages_user_user_password in User Pages 6

Same name and namespace in other branches
  1. 7 plugins/tasks/user_password.inc \user_pages_user_user_password()
1 string reference to 'user_pages_user_user_password'
user_pages_user_user_password_menu_alter in plugins/tasks/user_password.inc

File

plugins/tasks/user_password.inc, line 53

Code

function user_pages_user_user_password() {

  // If we aren't admin but already logged on, go to the user page instead.
  global $user;
  $admin = user_access('administer users');
  if (!$admin && $user->uid) {
    drupal_goto('user/' . $user->uid);
  }

  // Load my task plugin
  $task = page_manager_get_task('user_password');
  ctools_include('context');
  ctools_include('context-task-handler');
  $output = ctools_context_handler_render($task, '', array(), array());
  if ($output !== FALSE) {
    return $output;
  }
  module_load_include('inc', 'user', 'user.pages');
  $function = NULL;
  foreach (module_implements('page_manager_override') as $module) {
    $call = $module . '_page_manager_override';
    if (($rc = $call('user_password')) && function_exists($rc)) {
      $function = $rc;
      break;
    }
  }
  if ($function) {
    return $function();
  }

  // Otherwise, fall back.
  return drupal_get_form('user_pass');
}