Commit 08f464fc authored by Leigh B. Stoller's avatar Leigh B. Stoller

Speed up query that determines if a user has new users to approve.

parent 14e86b6a
...@@ -154,19 +154,19 @@ function WRITESIDEBAR() { ...@@ -154,19 +154,19 @@ function WRITESIDEBAR() {
# Only project/group leaders can do these options # Only project/group leaders can do these options
# Show a "new" icon if there are people waiting for approval # Show a "new" icon if there are people waiting for approval
$query_result = $query_result =
DBQueryFatal("SELECT g.* FROM group_membership as g ". DBQueryFatal("select g.* from group_membership as authed ".
"LEFT JOIN group_membership as authed ". "left join group_membership as g on ".
"ON g.pid=authed.pid and g.gid=authed.gid ". " g.pid=authed.pid and g.gid=authed.gid ".
"and g.uid!='$auth_usr' and g.trust='none' ".
"left join users as u on u.uid=g.uid ". "left join users as u on u.uid=g.uid ".
"WHERE u.status!='". "where u.status!='".
TBDB_USERSTATUS_UNVERIFIED . "' and ". TBDB_USERSTATUS_UNVERIFIED . "' and ".
"u.status!='" . TBDB_USERSTATUS_NEWUSER . " u.status!='" . TBDB_USERSTATUS_NEWUSER .
"' and authed.uid='$login_uid' and ". "' and g.uid!='$login_uid' and ".
"(authed.trust='group_root' or ". " g.trust='". TBDB_TRUSTSTRING_NONE . "' ".
" authed.trust='project_root') ". " and authed.uid='$login_uid' and ".
" (authed.trust='group_root' or ".
" authed.trust='project_root') ".
"ORDER BY g.uid,g.pid,g.gid"); "ORDER BY g.uid,g.pid,g.gid");
if (mysql_num_rows($query_result) > 0) { if (mysql_num_rows($query_result) > 0) {
WRITESIDEBARBUTTON_NEW("New User Approval", WRITESIDEBARBUTTON_NEW("New User Approval",
$TBBASE, "approveuser_form.php3"); $TBBASE, "approveuser_form.php3");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment