Updating user_force_term from D5 to D6

  1. /*
  2. I am in the process of updating the user_force_term module from Drupal 5 to Drupal 6.
  3.  
  4. Update seems completed except for this notice:
  5.  
  6. notice: Undefined property: stdClass::$uid in /....../d6/sites/all/modules/user_force_term/user_force_term.module on line 118.
  7.  
  8. The line containing "$uid = $account->uid;" is line 118.
  9.  
  10. Related code snippet from user_force_term:
  11. */
  12.  
  13. /**
  14.  * Implementation of hook_user().
  15.  */
  16. function user_force_term_user($op, &$edit, &$account, $category = NULL) {
  17.         print_r($account);
  18.   $uid = $account->uid;        
  19.         print_r($uid);
  20.  
  21. // ...
  22.  
  23. }
  24.  
  25. /*
  26. Result of 1st print_r:
  27. --8<----8<----8<----8<----8<----8<--
  28. stdClass Object
  29. (
  30. )
  31. stdClass Object
  32. (
  33.     [uid] => 1
  34.     [name] => admin
  35.     [pass] => 21232f297a57a5a743894a0e4a801fc3
  36.     [mail] => webmaster@d6.local
  37.     [mode] => 0
  38.     [sort] => 0
  39.     [threshold] => 0
  40.     [theme] =>
  41.     [signature] =>
  42.     [created] => 1215524521
  43.     [access] => 1215791938
  44.     [login] => 1215524589
  45.     [status] => 1
  46.     [timezone] =>
  47.     [language] =>
  48.     [picture] =>
  49.     [init] => webmaster@d6.local
  50.     [data] => a:0:{}
  51.     [roles] => Array
  52.         (
  53.             [2] => authenticated user
  54.         )
  55.  
  56. )
  57. --8<----8<----8<----8<----8<----8<--
  58.  
  59. Result of 2nd print_r:
  60.  
  61. --8<----8<----8<----8<----8<----8<--
  62. 1
  63. --8<----8<----8<----8<----8<----8<--
  64.  
  65.  */