You are here

function merci_staff_user_load in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6.2

2 calls to merci_staff_user_load()
merci_staff_form_alter in modules/merci_staff/merci_staff.module
merci_staff_node_validate in modules/merci_staff/merci_staff.module
@todo Please document this function.

File

modules/merci_staff/merci_staff.module, line 35
merci_staff functions

Code

function merci_staff_user_load($post = NULL) {
  static $admin_user;
  global $user;
  if (empty($admin_user)) {
    $admin_user = $user;
  }
  if (isset($post) and array_key_exists('override', $post) and !$post['override'] and $newuser = user_load(array(
    'name' => $post['name'],
  ))) {
    $user = $newuser;
  }
  else {
    $user = $admin_user;
  }
}