aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/userController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controllers/userController.php')
-rw-r--r--app/Controllers/userController.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index b5725e6b5..5da42f5a4 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -284,6 +284,27 @@ class FreshRSS_user_Controller extends Minz_ActionController {
$email = Minz_Request::param('new_user_email', '');
$passwordPlain = Minz_Request::param('new_user_passwordPlain', '', true);
+ if (!self::checkUsername($new_user_name)) {
+ Minz_Request::bad(
+ _t('user.username.invalid'),
+ array('c' => 'auth', 'a' => 'register')
+ );
+ }
+
+ if (FreshRSS_UserDAO::exists($new_user_name)) {
+ Minz_Request::bad(
+ _t('user.username.taken', $new_user_name),
+ array('c' => 'auth', 'a' => 'register')
+ );
+ }
+
+ if (!FreshRSS_password_Util::check($passwordPlain)) {
+ Minz_Request::bad(
+ _t('user.password.invalid'),
+ array('c' => 'auth', 'a' => 'register')
+ );
+ }
+
$tos_enabled = file_exists(join_path(DATA_PATH, 'tos.html'));
$accept_tos = Minz_Request::param('accept_tos', false);