Skip to content

Commit 4e66c3e

Browse files
committed
Merge branch 'origin/develop' into phoenix
2 parents f7dfb95 + 422886d commit 4e66c3e

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ os:
44
- linux
55
sudo: false
66
php:
7-
# - 5.3 (doesn't recognize $var=[], only recognizes $var=array())
8-
# - 5.4 (doesn't have finally{} in try blocks)
9-
- 5.5
10-
- 5.6
11-
- 7.0
7+
- 7.2
8+
- 7.3
129
- nightly
1310
matrix:
1411
allow_failures:

etc/config.sample.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
"username_length_min": 3
4141
}
4242
},
43+
"email": {
44+
"smtp_host": "smtp.example.com",
45+
"smtp_password": "",
46+
"smtp_port": 587,
47+
"smtp_user": ""
48+
},
4349
"memcache": {
4450
"connect_timeout": 1.0,
4551
"tcp_nodelay": true,

src/controllers/User/Register.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ protected function tryRegister(Router &$router, UserRegisterModel &$model) {
136136
return;
137137
}
138138
} catch (UserNotFoundException $e) {}
139+
140+
try {
141+
if (User::findIdByUsername($username)) {
142+
$model->error = "USERNAME_TAKEN";
143+
return;
144+
}
145+
} catch (UserNotFoundException $e) {}
139146

140147
try {
141148

src/templates/User/Register.phtml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ switch ($this->getContext()->error) {
7070
$af = "email";
7171
$message = "The email address is already in use, use another.";
7272
break;
73+
case "USERNAME_TAKEN":
74+
$af = "username";
75+
$message = "That username is taken, try another.";
76+
break;
7377
case "INTERNAL_ERROR":
7478
$af = null;
7579
$message = "An internal error occurred while processing your request. "

0 commit comments

Comments
 (0)