From 61a8dfbe6186c29b5bec36c971a80b081b366091 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 12 Jul 2012 01:16:37 +0200 Subject: Display nice error message if username exists already Signed-off-by: Florian Pritz --- application/controllers/user.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'application/controllers/user.php') diff --git a/application/controllers/user.php b/application/controllers/user.php index af908a63d..29d9eaeeb 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -152,6 +152,10 @@ class User extends CI_Controller { $error[]= "Invalid email."; } + if ($this->muser->username_exists($username)) { + $error[] = "Username already exists."; + } + if (!$password || $password != $password_confirm) { $error[]= "No password or passwords don't match."; } -- cgit v1.2.3-24-g4f1b