Notes |
(0022425)
hola (reporter)
11-01-07 01:03
|
Offending code below - this is quite urgent as it is reporting wrong results to my clients
case "owner":
$table_list = $tables["user"].','.$tables["listuser"].','.$tables["list"].$findtables;
$subselect = "{$tables["user"]}.id = {$tables["listuser"]}.userid and {$tables["listuser"]}.listid = {$tables["list"]}.id and {$tables["list"]}.owner = ".$_SESSION["logindetails"]["id"];
if ($find) {
$listquery = "select {$tables["user"]}.email,{$tables["user"]}.id,$findfield,confirmed from ".$table_list." where $subselect and $findbyselect";
$count = Sql_query("SELECT count({$tables["user"]}.id) FROM ".$table_list ." where $subselect and $findbyselect");
$unconfirmedcount = Sql_query("SELECT count({$tables["user"]}.id) FROM ".$table_list ." where $subselect and !confirmed and $findbyselect");
} else {
$listquery = "select {$tables["user"]}.email,{$tables["user"]}.id,$findfield,confirmed from ".$table_list." where $subselect";
$count = Sql_query("SELECT count({$tables["user"]}.id) FROM ".$table_list ." where $subselect");
$unconfirmedcount = Sql_query("SELECT count({$tables["user"]}.id) FROM ".$table_list ." where !confirmed and $subselect");
}
if ($_GET["unconfirmed"])
$listquery .= ' and !confirmed ';
if ($_GET["blacklisted"])
$listquery .= ' and blacklisted ';
break; |
|
(0025517)
yan (reporter)
06-04-07 06:45
|
Another way to describe the issue is this: a superadmin will have the correct tally of 'all users'. Any restricted admin won't, as users will be counted differently: theyt are counted based on the lists the admin owns. If one user is on 3 lists owned by a restricted admin, the email will be counted 3 times.
To count users correctly, you'd have to look at the ownership of lists and then at the user membership of those lists, and then at the users. Currently, the user handling keeps it simple, by just checking the user table, where "admin ownership" isn't known. |
|
(0030989)
bas (developer)
23-08-07 19:56
|
Added DISTINCT to sql queries |
|