- update the user_load routine to use the new method.

This commit is contained in:
dave 2008-10-26 17:21:26 +00:00
parent c41be1a17e
commit 4789bd4d60

View File

@ -109,17 +109,8 @@ function user_load_volunteer(&$u)
function user_load_sponsor($u)
{
/* Double check, make sure the user is of this type */
if(!in_array('sponsor', $u['types'])) return false;
$q = mysql_query("SELECT * FROM users_sponsor
WHERE users_id='{$u['id']}'");
if(mysql_num_rows($q)!=1) return false;
$r = mysql_fetch_object($q);
$ret = array();
$ret['sponsors_id'] = $r->sponsors_id;
return $ret;
$u['sponsors_id'] = intval($u['sponsors_id']);
return true;
}
function user_load($user)
@ -155,7 +146,7 @@ function user_load($user)
foreach($ret['types'] as $t) {
/* These all pass $ret by reference, and can modify
* $ret */
$r = call_user_func("user_load_$t", $ret);
$r = call_user_func("user_load_$t", &$ret);
if($r != true) {
echo "user_load_$t returned false!\n";
return false;
@ -178,10 +169,10 @@ function user_load($user)
$orig = $ret;
$ret['orig'] = $orig;
// echo "<pre>User load returning: \n";
// print_r($ret);
// echo "</pre>";
/* echo "<pre>User load returning: \n";
print_r($ret);
echo "</pre>";
*/
return $ret;
}