/[drupal]/contributions/sandbox/alex_b/mtk/helper/user.inc
ViewVC logotype

Contents of /contributions/sandbox/alex_b/mtk/helper/user.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Aug 7 17:25:18 2008 UTC (15 months, 2 weeks ago) by alexb
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -0 lines
File MIME type: text/x-php
Add version string.
1 <?php
2 // $Id:$
3
4 /**
5 * Retrieve role id for a given role name.
6 */
7 function mtk_user_get_role_rid($role_name) {
8 static $rids;
9 if (!$rids[$role_name]) {
10 $rid = db_result(db_query('SELECT rid FROM {role} WHERE name = "%s"', $role_name));
11 if ($rid) {
12 $rids[$role_name] = $rid;
13 }
14 else {
15 drupal_set_message('Couldn\'t retrieve valid rid FOR role name !role_name', array('!role_name' => $role_name), 'error');
16 }
17 }
18 return $rids[$role_name];
19 }

  ViewVC Help
Powered by ViewVC 1.1.2