I have created a custom view for admins to search and filter users, however I cannot access to the users alt_login as a field for display or for use as a filter.

I think if the variable was available to the view the field and filter would become available automatically.

Basically looking to be able to use something like $user->alt_login; to access the users alt_login value.

Comments

hunmonk’s picture

Status: Active » Fixed

this has already been a part of the module for quite some time:

/**
 * Loads the user's alt_login to the user object.
 *
 * @param $user The user object.
 */
function _alt_login_load(&$user) {
  if ($alt_login = db_result(db_query('SELECT alt_login FROM {alt_login} WHERE uid = %d', $user-> uid))) {
    $user->alt_login = $alt_login;
  }
}

that function is invoked in hook_user, 'load' op, so you should already have access to $account->alt_login

Architeck’s picture

Thanks for that info, I must have overlooked that.

Is there a way to access $account->alt_login in the views UI so I can display or search users on the alt login value?

hunmonk’s picture

no idea, thats sounds more like a general views question -- i'd take it up in the support forums.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.