summaryrefslogtreecommitdiffstats
path: root/lib/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/user.php')
-rw-r--r--lib/user.php6
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');
}