r6181 - trunk/lib/org/freemedsoftware/api

11 views
Skip to first unread message

subve...@svn.freemedsoftware.org

unread,
Nov 16, 2011, 1:17:33 AM11/16/11
to freemed-d...@googlegroups.com
Author: jeff
Date: 2011-11-16 01:17:33 -0500 (Wed, 16 Nov 2011)
New Revision: 6181

Modified:
trunk/lib/org/freemedsoftware/api/UserInterface.class.php
Log:
Add missing user check for duplicates call.


Modified: trunk/lib/org/freemedsoftware/api/UserInterface.class.php
===================================================================
--- trunk/lib/org/freemedsoftware/api/UserInterface.class.php 2011-11-16 06:16:51 UTC (rev 6180)
+++ trunk/lib/org/freemedsoftware/api/UserInterface.class.php 2011-11-16 06:17:33 UTC (rev 6181)
@@ -76,6 +76,23 @@
return (int) $GLOBALS['sql']->queryOne( $q );
} // end method GetCurrentProvider

+ // Method: CheckDuplicate
+ //
+ // Check for duplicate user record in the system by username.
+ //
+ // Parameters:
+ //
+ // $username - Username
+ //
+ // Returns:
+ //
+ // Boolean.
+ //
+ public function CheckDuplicate( $username ) {
+ $q = "SELECT COUNT(*) FROM user WHERE username = " . $GLOBALS['sql']->quote( $username );
+ return ((int) $GLOBALS['sql']->queryOne( $q )) > 0;
+ } // end method CheckDuplicate
+
// Method: GetUsers
//
// Get picklist formatted user information.

Reply all
Reply to author
Forward
0 new messages