diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2012-05-06 18:04:31 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2012-05-06 18:04:48 -0400 |
commit | e0db22cc0741abaebe44e245f2da6ca1a34f7cac (patch) | |
tree | 94d9765246bb305d0b34b194e7d0edaa61fec3f2 /lib/user.php | |
parent | 333345d20190212200b10ae01d925807e1b10ece (diff) | |
download | nextcloud-server-e0db22cc0741abaebe44e245f2da6ca1a34f7cac.tar.gz nextcloud-server-e0db22cc0741abaebe44e245f2da6ca1a34f7cac.zip |
Provide feedback when user creation fails
Diffstat (limited to 'lib/user.php')
-rw-r--r-- | lib/user.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/user.php b/lib/user.php index 8b887559df3..816caff8dd8 100644 --- a/lib/user.php +++ b/lib/user.php @@ -117,15 +117,15 @@ class OC_User { // Check the name for bad characters // Allowed are: "a-z", "A-Z", "0-9" and "_.@-" if( preg_match( '/[^a-zA-Z0-9 _\.@\-]/', $uid )){ - return false; + throw new Exception('Only the following characters are allowed in a username: "a-z", "A-Z", "0-9", and "_.@-"'); } // No empty username if(trim($uid) == ''){ - return false; + throw new Exception('A valid username must be provided'); } // Check if user already exists if( self::userExists($uid) ){ - return false; + throw new Exception('The username is already being used'); } |