forked from science-ation/science-ation
- more unneeded user code
This commit is contained in:
parent
a0d27df91e
commit
d1c7fa968e
27
user.inc.php
27
user.inc.php
@ -109,30 +109,7 @@ function user_load_volunteer(&$u)
|
|||||||
|
|
||||||
function user_load($user)
|
function user_load($user)
|
||||||
{
|
{
|
||||||
$id = 0;
|
$id = intval($user);
|
||||||
|
|
||||||
/* Sort out the type first */
|
|
||||||
if(is_array($user)){
|
|
||||||
/* User already loaded*/
|
|
||||||
$id = $user['id'];
|
|
||||||
$where = "id='$id'";
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$id = intval($user);
|
|
||||||
if($id > 0) {
|
|
||||||
/* Load by ID FIXME: if we enable load-by-email below,
|
|
||||||
* then a user could use a number at the beginning of
|
|
||||||
* their email address to exploit here, must fix that.
|
|
||||||
* */
|
|
||||||
$where = "id='$id'";
|
|
||||||
} else {
|
|
||||||
echo "Can't load user by non-number id";
|
|
||||||
return false;
|
|
||||||
/* Load by email */
|
|
||||||
// $e = stripslashes($user);
|
|
||||||
// $where = "email='$e'";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* So, it turns out that doing one big load is faster than loading just
|
/* So, it turns out that doing one big load is faster than loading just
|
||||||
* from the users table then loading only the specific types the user
|
* from the users table then loading only the specific types the user
|
||||||
@ -142,7 +119,7 @@ function user_load($user)
|
|||||||
LEFT JOIN `users_judge` ON `users_judge`.`users_id`=`users`.`id`
|
LEFT JOIN `users_judge` ON `users_judge`.`users_id`=`users`.`id`
|
||||||
LEFT JOIN `users_volunteer` ON `users_volunteer`.`users_id`=`users`.`id`
|
LEFT JOIN `users_volunteer` ON `users_volunteer`.`users_id`=`users`.`id`
|
||||||
LEFT JOIN `users_fair` ON `users_fair`.`users_id`=`users`.`id`
|
LEFT JOIN `users_fair` ON `users_fair`.`users_id`=`users`.`id`
|
||||||
WHERE $where
|
WHERE `users`.`id`='$id'
|
||||||
AND `users`.`deleted`='no' ";
|
AND `users`.`deleted`='no' ";
|
||||||
$q=mysql_query($query);
|
$q=mysql_query($query);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user