Skip to content

Commit 50d46f1

Browse files
committed
Merge branch '2.4' of github.com:CachetHQ/Cachet into 2.4
2 parents beb0d42 + fe154be commit 50d46f1

File tree

6 files changed

+23
-19
lines changed

6 files changed

+23
-19
lines changed

app/Http/Controllers/SetupController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function postStep1()
195195
});
196196

197197
$v->sometimes(['env.mail_address', 'env.mail_username', 'env.mail_password'], 'required', function ($input) {
198-
return $input->env['mail_driver'] !== 'log';
198+
return !in_array($input->env['mail_driver'], ['log', 'smtp']);
199199
});
200200

201201
if ($v->passes()) {

public/dist/css/dashboard/dashboard.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/dist/js/all.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/dist/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/assets/js/components/Setup.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
cache_driver: null,
88
queue_driver: null,
99
session_driver: null,
10-
mail_driver: null,
10+
mail_driver: 'smtp',
1111
},
1212
mail: {
1313
host: null,
@@ -19,8 +19,8 @@ module.exports = {
1919
password: null,
2020
2121
requiresHost: true,
22-
requiresUsername: true,
23-
requiresPassword: true,
22+
requiresUsername: false,
23+
requiresPassword: false,
2424
},
2525
system: {
2626
name: null,
@@ -40,6 +40,10 @@ module.exports = {
4040
this.mail.requiresHost = false
4141
this.mail.requiresUsername = true
4242
this.mail.requiresPassword = true
43+
} else if (driver === 'smtp') {
44+
this.mail.requiresHost = true
45+
this.mail.requiresUsername = false
46+
this.mail.requiresPassword = false
4347
} else {
4448
this.mail.requiresHost = true
4549
this.mail.requiresUsername = true

resources/views/setup/index.blade.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@
8686
<span class="text-danger">{{ $errors->first('env.mail_driver') }}</span>
8787
@endif
8888
</div>
89-
<div class="form-group" v-if="mail.requiresHost">
90-
<label>{{ trans('forms.setup.mail_host') }} (optional)</label>
91-
<input type="text" class="form-control" name="env[mail_host]" value="{{ Binput::old('env.mail_host', $mail_config['host']) }}" placeholder="{{ trans('forms.setup.mail_host') }}">
89+
<div class="form-group">
90+
<label>{{ trans('forms.setup.mail_host') }}</label>
91+
<input type="text" class="form-control" name="env[mail_host]" value="{{ Binput::old('env.mail_host', $mail_config['host']) }}" placeholder="{{ trans('forms.setup.mail_host') }}" :required="mail.requiresHost">
9292
@if($errors->has('env.mail_host'))
9393
<span class="text-danger">{{ $errors->first('env.mail_host') }}</span>
9494
@endif
@@ -100,16 +100,16 @@
100100
<span class="text-danger">{{ $errors->first('env.mail_address') }}</span>
101101
@endif
102102
</div>
103-
<div class="form-group" v-if="mail.requiresUsername">
103+
<div class="form-group">
104104
<label>{{ trans('forms.setup.mail_username') }}</label>
105-
<input type="text" class="form-control" name="env[mail_username]" value="{{ Binput::old('env.mail_username', $mail_config['username']) }}" placeholder="{{ trans('forms.setup.mail_username') }}">
105+
<input type="text" class="form-control" name="env[mail_username]" value="{{ Binput::old('env.mail_username', $mail_config['username']) }}" placeholder="{{ trans('forms.setup.mail_username') }}" :required="mail.requiresUsername">
106106
@if($errors->has('env.mail_username'))
107107
<span class="text-danger">{{ $errors->first('env.mail_username') }}</span>
108108
@endif
109109
</div>
110-
<div class="form-group" v-if="mail.requiresPassword">
110+
<div class="form-group">
111111
<label>{{ trans('forms.setup.mail_password') }}</label>
112-
<input type="password" class="form-control" name="env[mail_password]" value="{{ Binput::old('env.mail_password', $mail_config['password']) }}" autocomplete="off" placeholder="{{ trans('forms.setup.mail_password') }}">
112+
<input type="password" class="form-control" name="env[mail_password]" value="{{ Binput::old('env.mail_password', $mail_config['password']) }}" autocomplete="off" placeholder="{{ trans('forms.setup.mail_password') }}" :required="mail.requiresUsername">
113113
@if($errors->has('env.mail_password'))
114114
<span class="text-danger">{{ $errors->first('env.mail_password') }}</span>
115115
@endif

0 commit comments

Comments
 (0)