diff --git a/user.inc.php b/user.inc.php index 09f24898..3c3e5d81 100644 --- a/user.inc.php +++ b/user.inc.php @@ -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 "
User load returning: \n"; -// print_r($ret); -// echo ""; - +/* echo "
User load returning: \n"; + print_r($ret); + echo ""; +*/ return $ret; }