Permalink
Browse files

Merge pull request #6 from snoldak924/patch-1

createNewUser() should return false if it was not able to create the user
  • Loading branch information...
2 parents 762b988 + c28d5a5 commit a0907adb32116cb4c4d6c5a6d9ce03fe14403f38 @tylerhall committed Jun 14, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 includes/class.auth.php
View
@@ -155,6 +155,12 @@ public static function changePassword($id_or_username, $new_password)
public static function createNewUser($username, $password = null)
{
+ $db = Database::getDatabase();
+ $row = $db->getRow("SELECT * FROM users WHERE username = " . $db->quote($username));
+
+ if(!empty($row))
+ return false;
+
if(is_null($password))
$password = Auth::generateStrongPassword();

0 comments on commit a0907ad

Please sign in to comment.