Assigning user don't work ( postgresql )

Submitted by pasnox on 2007-08-10

Hi,

Our server is host on a postgresql server, i create some user name like "User Name <address@email.com>" and assigning items to these users don't work!
By the way, there is a user named "manuel" and i can't assign to him too, so it seem there is a problem assigning users with issues using postgresql.

Cheers, P@sNox,

Your right, thanks for reporting that bug. I don't know why I didn't discover it for such a long time, perhaps I should do better testing... BTW, it also occurs for SQL Server, on MySQL it works fine.

I will release a new version soon, for now just remove the word BINARY from line 308 of include/validation.inc.php. Here's the patch:

Index: validation.inc.php
===================================================================
--- validation.inc.php	(revision 208)
+++ validation.inc.php	(working copy)
@@ -305,7 +305,7 @@
     $query = 'SELECT u.user_id FROM {users} AS u';
     if ( wi_metadata( $info, 'members', 0 ) && $project_id != 0 )
         $query .= ' JOIN {rights} AS r ON r.user_id = u.user_id AND r.project_id = %2$d';
-    $query .= ' WHERE u.user_name = BINARY %1$s';
+    $query .= ' WHERE u.user_name = %1$s';
 
     if ( !wi_query_row( $query, $value, $project_id ) )
         wi_error( 342 );

Regards,
Michał