SQL-Statement doesn't return max-/minnodes values for non-role-members

sanduhrs - October 29, 2006 - 12:28
Project:Shoutcast Streaming Server
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

The SQL-Statement in nodelimit_max_for_user() doesn't return any values if the user is not member of a role.

When I changed the statement from
$query = "SELECT max(nl.maxnodes) as maxnodes, min(nl.maxnodes) as minnodes FROM {nodelimit_types} nl JOIN users_roles ur WHERE (nl.role=ur.rid OR nl.role=2) AND ur.uid=%d AND nl.nodetype='%s'";
to
$query = "SELECT max(nl.maxnodes) as maxnodes, min(nl.maxnodes) as minnodes FROM {nodelimit_types} nl JOIN users_roles ur WHERE ((nl.role=ur.rid AND ur.uid=%d) OR nl.role=2) AND nl.nodetype='%s'";
it seemed to work, but I'm no SQL-guru, so please have a close look at it.
Patch attached.

AttachmentSize
nodelimit.module-diff-2006-10-29-13-20-40.patch991 bytes

#1

eurekaloop - July 19, 2007 - 23:01

Hey, I couldn't find this line anywhere in the code to be replaced.
???

#2

sanduhrs - December 19, 2007 - 08:05
Project:» Shoutcast Streaming Server
Version:HEAD» HEAD
Status:needs review» closed
 
 

Drupal is a registered trademark of Dries Buytaert.