You are here

function xmlsitemap_user_user in XML sitemap 6.2

Same name and namespace in other branches
  1. 5.2 xmlsitemap_user/xmlsitemap_user.module \xmlsitemap_user_user()
  2. 5 xmlsitemap_user/xmlsitemap_user.module \xmlsitemap_user_user()
  3. 6 xmlsitemap_user/xmlsitemap_user.module \xmlsitemap_user_user()

Implements hook_user().

File

xmlsitemap_user/xmlsitemap_user.module, line 77

Code

function xmlsitemap_user_user($op, &$edit, $account, $category = NULL) {
  switch ($op) {
    case 'insert':
    case 'update':
    case 'after_update':

      // We need to check both update and after update since the user hooks
      // won't have an updated $account object until after_update.
      $link = xmlsitemap_user_create_link($account);
      if (isset($edit['xmlsitemap'])) {
        $link = $edit['xmlsitemap'] + $link;

        // Unset since we don't want this saved to $user->data.
        unset($edit['xmlsitemap']);
      }
      xmlsitemap_link_save($link);
      break;
    case 'delete':
      xmlsitemap_link_delete('user', $account->uid);
      break;
  }
}