Make alt_login available in $user object

Architeck - November 3, 2009 - 20:49
Project:Alternate Login
Version:6.x-1.1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

#1

hunmonk - November 4, 2009 - 12:39
Status:active» fixed

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

<?php
/**
* 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

#2

Architeck - November 16, 2009 - 20:49

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?

#3

hunmonk - November 16, 2009 - 22:48

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

#4

System Message - November 30, 2009 - 22:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.