Skip to content
Snippets Groups Projects
Verified Commit a0078b79 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #12735 TIME 0:20 admin email server with enabled from field

parent 4760c6f3
No related branches found
No related tags found
No related merge requests found
...@@ -82,6 +82,9 @@ class ConfigurationController ...@@ -82,6 +82,9 @@ class ConfigurationController
if (!Validator::stringType()->notEmpty()->validate($aArgs['type'])) { if (!Validator::stringType()->notEmpty()->validate($aArgs['type'])) {
return ['errors' => 'Configuration type is missing', 'code' => 400]; return ['errors' => 'Configuration type is missing', 'code' => 400];
} }
if (!Validator::stringType()->notEmpty()->validate($aArgs['from'])) {
return ['errors' => 'Configuration from is missing or not well formatted', 'code' => 400];
}
if (in_array($aArgs['type'], ['smtp', 'mail'])) { if (in_array($aArgs['type'], ['smtp', 'mail'])) {
$check = Validator::stringType()->notEmpty()->validate($aArgs['host']); $check = Validator::stringType()->notEmpty()->validate($aArgs['host']);
...@@ -92,7 +95,6 @@ class ConfigurationController ...@@ -92,7 +95,6 @@ class ConfigurationController
$check = $check && Validator::stringType()->notEmpty()->validate($aArgs['password']); $check = $check && Validator::stringType()->notEmpty()->validate($aArgs['password']);
} }
$check = $check && Validator::stringType()->validate($aArgs['secure']); $check = $check && Validator::stringType()->validate($aArgs['secure']);
$check = $check && Validator::stringType()->validate($aArgs['from']);
if (!$check) { if (!$check) {
return ['errors' => "Configuration data is missing or not well formatted", 'code' => 400]; return ['errors' => "Configuration data is missing or not well formatted", 'code' => 400];
} }
......
...@@ -80,10 +80,10 @@ ...@@ -80,10 +80,10 @@
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<div class="form-group" [style.opacity]="['smtp', 'mail'].indexOf(sendmail.type) > -1 ? '1' : '0.5'"> <div class="form-group">
<div class="col-md-12"> <div class="col-md-12">
<mat-form-field> <mat-form-field>
<input name="mailFrom" [(ngModel)]="sendmail.from" [disabled]="['smtp', 'mail'].indexOf(sendmail.type) == -1" <input name="mailFrom" [(ngModel)]="sendmail.from" required
matInput placeholder="{{lang.mailFrom}}" pattern="(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)"> matInput placeholder="{{lang.mailFrom}}" pattern="(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)">
</mat-form-field> </mat-form-field>
</div> </div>
...@@ -125,4 +125,4 @@ ...@@ -125,4 +125,4 @@
</div> </div>
</mat-sidenav> </mat-sidenav>
</mat-sidenav-container> </mat-sidenav-container>
</div> </div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment