diff --git a/api/v1/entries/user.php b/api/v1/entries/user.php index d419d970d4..87782cf8c3 100644 --- a/api/v1/entries/user.php +++ b/api/v1/entries/user.php @@ -408,8 +408,12 @@ class userEntry extends entry $this->setPost('gender', $gender); $password = $this->request('password', zget($_POST, 'password', '')); - $this->setPost('password1', md5($password)); - $this->setPost('password2', md5($password)); + if($password) + { + $this->setPost('password1', md5($password)); + $this->setPost('password2', md5($password)); + $this->setPost('passwordStrength', 2); + } $this->setPost('verifyPassword', md5($this->app->user->password . $this->app->session->rand)); $control = $this->loadController('user', 'edit'); diff --git a/module/user/model.php b/module/user/model.php index 12626b46c3..b03f2abb1f 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -567,8 +567,6 @@ class userModel extends model ->remove('new, password1, password2, groups,verifyPassword, passwordStrength,passwordLength') ->get(); - /* Fix bug for api requests using json. */ - if($this->app->getViewType() == 'json') $this->post->verifyPassword = md5(md5($this->post->verifyPassword) . $this->session->rand); if(empty($_POST['verifyPassword']) or $this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) { dao::$errors['verifyPassword'][] = $this->lang->user->error->verifyPassword;