Now wrapping SMTP password in quotes

https://github.com/LinkStackOrg/LinkStack/issues/442
This commit is contained in:
Julian Prieber 2023-05-19 15:30:27 +02:00
parent d99df74cad
commit 3ecaad28e2
2 changed files with 9 additions and 9 deletions

View File

@ -666,8 +666,8 @@ public function SendTestMail(Request $request)
if(EnvEditor::keyExists('MAIL_HOST')){EnvEditor::editKey('MAIL_HOST', $request->MAIL_HOST);} if(EnvEditor::keyExists('MAIL_HOST')){EnvEditor::editKey('MAIL_HOST', $request->MAIL_HOST);}
if(EnvEditor::keyExists('MAIL_PORT')){EnvEditor::editKey('MAIL_PORT', $request->MAIL_PORT);} if(EnvEditor::keyExists('MAIL_PORT')){EnvEditor::editKey('MAIL_PORT', $request->MAIL_PORT);}
if(EnvEditor::keyExists('MAIL_USERNAME')){EnvEditor::editKey('MAIL_USERNAME', $request->MAIL_USERNAME);} if(EnvEditor::keyExists('MAIL_USERNAME')){EnvEditor::editKey('MAIL_USERNAME', '"' . $request->MAIL_USERNAME . '"');}
if(EnvEditor::keyExists('MAIL_PASSWORD')){EnvEditor::editKey('MAIL_PASSWORD', $request->MAIL_PASSWORD);} if(EnvEditor::keyExists('MAIL_PASSWORD')){EnvEditor::editKey('MAIL_PASSWORD', '"' . $request->MAIL_PASSWORD . '"');}
if(EnvEditor::keyExists('MAIL_ENCRYPTION')){EnvEditor::editKey('MAIL_ENCRYPTION', $request->MAIL_ENCRYPTION);} if(EnvEditor::keyExists('MAIL_ENCRYPTION')){EnvEditor::editKey('MAIL_ENCRYPTION', $request->MAIL_ENCRYPTION);}
if(EnvEditor::keyExists('MAIL_FROM_ADDRESS')){EnvEditor::editKey('MAIL_FROM_ADDRESS', $request->MAIL_FROM_ADDRESS);} if(EnvEditor::keyExists('MAIL_FROM_ADDRESS')){EnvEditor::editKey('MAIL_FROM_ADDRESS', $request->MAIL_FROM_ADDRESS);}
} elseif($type === "homeurl") { } elseif($type === "homeurl") {

View File

@ -357,23 +357,23 @@ document.getElementById("MAINTENANCE_MODE-form").addEventListener("change", func
<h5 style="margin-top:50px">Use built in SMTP server</h5> <h5 style="margin-top:50px">Use built in SMTP server</h5>
<p class="text-muted">Uses SMTP server provided by LinkStack. Might not be 100% reliable. Has to be disabled in order to user a custom SMTP server.<br>(Save changes with 'Apply changes' below)</p> <p class="text-muted">Uses SMTP server provided by LinkStack. Might not be 100% reliable. Has to be disabled in order to user a custom SMTP server.<br>(Save changes with 'Apply changes' below)</p>
<div class="input-group"> <div class="input-group">
<div class="mb-3 form-check form-switch toggle-btn"><input name="toggle" class="switch toggle-btn" type="checkbox" id="toggle-smtp" <?php if(EnvEditor::getKey('MAIL_MAILER') != 'built-in'){echo '/>';}else{echo 'checked>';} ?> <label for="toggle-smtp" class="form-check-label">Enable</label></div> <div class="mb-3 form-check form-switch toggle-btn"><input name="toggle" class="switch toggle-btn" type="checkbox" id="toggle-smtp" <?php if(env('MAIL_MAILER') != 'built-in'){echo '/>';}else{echo 'checked>';} ?> <label for="toggle-smtp" class="form-check-label">Enable</label></div>
</div></div> </div></div>
<input type="hidden" name="_token" value="{{csrf_token()}}"> <input type="hidden" name="_token" value="{{csrf_token()}}">
<div style="max-width: 600px; padding-left: 20px;"> <div style="max-width: 600px; padding-left: 20px;">
<br><h5>Custom SMTP server:</h5> <br><h5>Custom SMTP server:</h5>
<label style="margin-top:15px">Host</label> <label style="margin-top:15px">Host</label>
<input type="text" class="form-control form-control-lg" class="form-control form-control-lg" name="MAIL_HOST" value="{{EnvEditor::getKey('MAIL_HOST')}}" /> <input type="text" class="form-control form-control-lg" class="form-control form-control-lg" name="MAIL_HOST" value="{{env('MAIL_HOST')}}" />
<label style="margin-top:15px">Port</label> <label style="margin-top:15px">Port</label>
<input type="text" class="form-control form-control-lg" class="form-control form-control-lg" name="MAIL_PORT" value="{{EnvEditor::getKey('MAIL_PORT')}}" /> <input type="text" class="form-control form-control-lg" class="form-control form-control-lg" name="MAIL_PORT" value="{{env('MAIL_PORT')}}" />
<label style="margin-top:15px">Username</label> <label style="margin-top:15px">Username</label>
<input type="text" class="form-control form-control-lg" class="form-control form-control-lg" name="MAIL_USERNAME" value="{{EnvEditor::getKey('MAIL_USERNAME')}}" /> <input type="text" class="form-control form-control-lg" class="form-control form-control-lg" name="MAIL_USERNAME" value="{{env('MAIL_USERNAME')}}" />
<label style="margin-top:15px">Password</label> <label style="margin-top:15px">Password</label>
<input type="password" class="form-control" name="MAIL_PASSWORD" value="{{EnvEditor::getKey('MAIL_PASSWORD')}}" /> <input type="password" class="form-control" name="MAIL_PASSWORD" value="{{env('MAIL_PASSWORD')}}" />
<label style="margin-top:15px">Encryption type</label> <label style="margin-top:15px">Encryption type</label>
<input type="text" class="form-control form-control-lg" class="form-control form-control-lg" name="MAIL_ENCRYPTION" value="{{EnvEditor::getKey('MAIL_ENCRYPTION')}}" /> <input type="text" class="form-control form-control-lg" class="form-control form-control-lg" name="MAIL_ENCRYPTION" value="{{env('MAIL_ENCRYPTION')}}" />
<label style="margin-top:15px">From adress</label> <label style="margin-top:15px">From adress</label>
<input type="text" class="form-control form-control-lg" class="form-control form-control-lg" name="MAIL_FROM_ADDRESS" value="{{EnvEditor::getKey('MAIL_FROM_ADDRESS')}}" /> <input type="text" class="form-control form-control-lg" class="form-control form-control-lg" name="MAIL_FROM_ADDRESS" value="{{env('MAIL_FROM_ADDRESS')}}" />
<button type="submit" class="btn btn-primary mt-4">Apply changes</button> <button type="submit" class="btn btn-primary mt-4">Apply changes</button>
</div> </div>
</form> </form>