You are here

user_badges.autoassignrole.inc in User Badges 7.3

Same filename and directory in other branches
  1. 7 user_badges.autoassignrole.inc
  2. 7.2 user_badges.autoassignrole.inc

Actions for User Badges module.

File

user_badges.autoassignrole.inc
View source
<?php

/**
 * @file
 * Actions for User Badges module.
 */

/**
 * Implements hook_cron().
 * Enables User Badges to work along with Auto Assign Role.
 * Notes: - this is a quite fast solution in order to solve Auto Assign Role issue.
 *   - do not forget to set up your cron
 */
function user_badges_cron() {
  $results = db_query('SELECT * FROM {user_badges_roles}');
  $roles = array();
  foreach ($results as $result) {
    $roles[$result->rid] = $result->bid;
  }
  user_badges_save_roles($roles);

  // Yuck!
}

Functions

Namesort descending Description
user_badges_cron Implements hook_cron(). Enables User Badges to work along with Auto Assign Role. Notes: - this is a quite fast solution in order to solve Auto Assign Role issue.