diff --git a/upload/admin/controller/user/user.php b/upload/admin/controller/user/user.php index a8674c41bd5..475751f735f 100644 --- a/upload/admin/controller/user/user.php +++ b/upload/admin/controller/user/user.php @@ -476,6 +476,12 @@ protected function validateForm() { } } + $total_users = $this->model_user_user->getTotalUsers(); + + if ($total_users <= 1 && isset($this->request->post['status']) && $this->request->post['status'] == 0) { + $this->error['warning'] = $this->language->get('error_single_user'); + } + return !$this->error; } diff --git a/upload/admin/language/en-gb/user/user.php b/upload/admin/language/en-gb/user/user.php index 6bc6c1f25b8..7e594ca5d46 100644 --- a/upload/admin/language/en-gb/user/user.php +++ b/upload/admin/language/en-gb/user/user.php @@ -35,4 +35,5 @@ $_['error_firstname'] = 'First Name must be between 1 and 32 characters!'; $_['error_lastname'] = 'Last Name must be between 1 and 32 characters!'; $_['error_email'] = 'E-Mail Address does not appear to be valid!'; -$_['error_exists_email'] = 'Warning: E-Mail Address is already registered!'; \ No newline at end of file +$_['error_exists_email'] = 'Warning: E-Mail Address is already registered!'; +$_['error_single_user'] = 'Warning: You can not disable your own account!'; \ No newline at end of file