You are here

function mobile_tools_roles_get_mobile_role in Mobile Tools 6.3

Same name and namespace in other branches
  1. 6.2 modules/mobile_tools_roles/mobile_tools_roles.module \mobile_tools_roles_get_mobile_role()

Function helping in getting information for each role:

Parameters

$identifier: array('id' => id) or array('name' => name)

Return value

0 in case there is not mobile role rid of the mobile role

2 calls to mobile_tools_roles_get_mobile_role()
mobile_tools_roles_configuration_form_submit in ./mobile_tools_roles.admin.inc
Submit function for the mobile tools / mobile roles configuration page
mobile_tools_roles_init in ./mobile_tools_roles.module
Being called in the hook_init() implementation This function is in charge of changing the user role

File

./mobile_tools_roles.module, line 53
Contains the functionality to add mobile user roles

Code

function mobile_tools_roles_get_mobile_role($rid) {
  $query = "SELECT m.mrid, r.name FROM {mobile_tools_roles_relations} m JOIN {role} r ON m.mrid = r.rid WHERE m.rid = %d";
  $mobile_role = db_fetch_array(db_query($query, $rid));
  if (empty($mobile_role)) {
    return NULL;
  }
  else {
    return $mobile_role;
  }
}