diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-07-12 01:16:37 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-07-12 01:16:37 +0200 |
commit | 61a8dfbe6186c29b5bec36c971a80b081b366091 (patch) | |
tree | 97a1c615e9dbee795f679845d5e9a7dbbf36c1fd /application/models/muser.php | |
parent | 700fc306106c7acebb73e9479f93006388ea80a0 (diff) |
Display nice error message if username exists already
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/models/muser.php')
-rw-r--r-- | application/models/muser.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/application/models/muser.php b/application/models/muser.php index eb7c3d385..a93865fd4 100644 --- a/application/models/muser.php +++ b/application/models/muser.php @@ -87,6 +87,21 @@ class Muser extends CI_Model { exit(); } + function username_exists($username) + { + $query = $this->db->query(" + SELECT id + FROM users + WHERE username = ? + ", array($username)); + + if ($query->num_rows() > 0) { + return true; + } else { + return false; + } + } + function hash_password($password) { |