make more than one email receipient possible

This commit is contained in:
Joerg Lehmann 2021-06-08 09:49:24 +02:00
parent 19b52e4971
commit 6a451aae99
3 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@
<div class="field">
<label class="label">Alarm E-Mail</label>
<div class="control has-icons-right">
<input id="email" class="input" type="text" maxlength="50"> <span id="email_exclamation" class="icon is-small is-right">
<input id="email" class="input" type="text" maxlength="100"> <span id="email_exclamation" class="icon is-small is-right">
<i class="fas fa-exclamation-triangle"></i>
</span>
</div>

View File

@ -8,7 +8,7 @@ function validate(what, text) {
} else if (what == 'smsnumber') {
var re = /^\+[0-9]{11,11}$/;
} else if (what == 'email') {
var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
var re = /^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([,.](([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$/;
} else if (what == 'greenzone') {
var re = /^$|^[0-9]+\.[0-9]+,[0-9]+\.[0-9]+,[0-9]+\.[0-9]+,[0-9]+\.[0-9]+$/;
}

View File

@ -110,7 +110,7 @@ func save_tracker_settingsHandler(response http.ResponseWriter, request *http.Re
}
myemail := email[0]
match2, _ := regexp.MatchString(`^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$`, myemail)
match2, _ := regexp.MatchString(`^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([,.](([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$`, myemail)
if !(match2) {
log.Println("Url Param 'email' is not valid")
fmt.Fprintf(response, "{ \"rc\": 15, \"msg\": \"email is not valid, must be in in format max.mustermann@example.com\" }")