| 1 |
<?php // $Id$ |
<?php // $Id: qb_user.module,v 1.1 2009/02/17 20:43:05 vauxia Exp $ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* Implementation of hook_menu(). |
* Implementation of hook_menu(). |
| 21 |
* Implementation of hook_user(). |
* Implementation of hook_user(). |
| 22 |
*/ |
*/ |
| 23 |
function qb_user_user($op, &$edit, &$account, $category = NULL) { |
function qb_user_user($op, &$edit, &$account, $category = NULL) { |
| 24 |
|
if (!$account->uid) return; |
| 25 |
|
|
| 26 |
// Process users based on the qb_user_enable setting. |
// Process users based on the qb_user_enable setting. |
| 27 |
switch($map = variable_get('qb_user_enable', 'none')) { |
switch($map = variable_get('qb_user_enable', 'none')) { |
| 41 |
// Add the user's data mappings, if available. |
// Add the user's data mappings, if available. |
| 42 |
$res = db_query("SELECT qdvid FROM {qb_user} WHERE uid = %d", $account->uid); |
$res = db_query("SELECT qdvid FROM {qb_user} WHERE uid = %d", $account->uid); |
| 43 |
while ($qdvid = db_result($res)) { |
while ($qdvid = db_result($res)) { |
| 44 |
|
$type = db_result(db_query("SELECT d.request FROM {qb_data_value} v |
| 45 |
|
INNER JOIN {qb_data} d USING ( qdid ) WHERE v.qdvid = %d", $qdvid)); |
| 46 |
if (!isset($account->qb_user)) $account->qb_user = array(); |
if (!isset($account->qb_user)) $account->qb_user = array(); |
| 47 |
$account->qb_user[] = $qdid; |
$account->qb_user[strtolower($type)] = $qdvid; |
| 48 |
} |
} |
| 49 |
return; |
return; |
| 50 |
|
|