|
|
@@ -23,7 +23,6 @@
|
|
|
if( this.responseText.trim() == 'yes') {
|
|
|
console.log("Response: " + this.responseText);
|
|
|
$(customFields[4]).prop("disabled",false);
|
|
|
- $(customFields[5]).prop("disabled",true);
|
|
|
$(customFields[2]).addClass('has-success');
|
|
|
$(customFields[2]).css('background-color', '#0f03');;
|
|
|
$("#hintHead").text('');
|
|
|
@@ -37,7 +36,7 @@
|
|
|
$(customFields[5]).prop("disabled",true);
|
|
|
$(customFields[2]).addClass('has-error');
|
|
|
$(customFields[2]).css('background-color', '#f003');;
|
|
|
- $("#hintHead").text('Benutzername ' + $(customFields[2]).val() + ' nicht verfügbar!');
|
|
|
+ $("#hintHead").text('Der Benutzername ' + $(customFields[2]).val() + ' ist nicht verfügbar!');
|
|
|
$("#hintLength").text('');
|
|
|
$("#hintNumeric").text('');
|
|
|
$("#hintSymbols").text('');
|
|
|
@@ -67,9 +66,98 @@
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
- xhttp.open("GET", "modules/servers/nextcloud/nextcloudUserAvailable.php?name=" + username + '&pid=' + pid, true);
|
|
|
+ xhttp.open("GET", "modules/servers/nextcloud/nextCloudUserAvailable.php?name=" + username + '&pid=' + pid, true);
|
|
|
xhttp.send();
|
|
|
};
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {literal}
|
|
|
+ function checkEMail ( email, pid) {
|
|
|
+ var mailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
|
|
|
+ var validEMail = email.match(mailRegex);
|
|
|
+ if(validEMail == null) {
|
|
|
+ console.log("Invalid EMail: "+email);
|
|
|
+ $(customFields[4]).prop("disabled",true);
|
|
|
+ $(customFields[5]).prop("disabled",true);
|
|
|
+ $(customFields[3]).addClass('has-error');
|
|
|
+ $(customFields[3]).css('background-color', '#f003');;
|
|
|
+ $("#hintHead").text('Bitte eine gültige E-Mail-Adresse angeben.');
|
|
|
+ $("#hintLength").text('');
|
|
|
+ $("#hintNumeric").text('');
|
|
|
+ $("#hintSymbols").text('');
|
|
|
+ $("#hintUpperLower").text('');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var xhttp = new XMLHttpRequest();
|
|
|
+ var success = false;
|
|
|
+ console.log("E-Mail: " + email);
|
|
|
+ xhttp.open("GET", "modules/servers/nextcloud/nextCloudEMailAvailable.php?email=" + email + '&pid=' + pid, false);
|
|
|
+ xhttp.send();
|
|
|
+
|
|
|
+ console.log("Ready State: " + xhttp.readyState);
|
|
|
+ console.log("Status: " + xhttp.status);
|
|
|
+ if (xhttp.readyState == 4 && xhttp.status == 200) {
|
|
|
+ if( xhttp.responseText.trim() == 'yes') {
|
|
|
+ $(customFields[4]).prop("disabled",false);
|
|
|
+ $(customFields[5]).prop("disabled",true);
|
|
|
+ $(customFields[3]).addClass('has-success');
|
|
|
+ $(customFields[3]).css('background-color', '#0f03');;
|
|
|
+ $("#hintHead").text('');
|
|
|
+ $("#hintLength").text('');
|
|
|
+ $("#hintNumeric").text('');
|
|
|
+ $("#hintSymbols").text('');
|
|
|
+ $("#hintUpperLower").text('');
|
|
|
+ } else if (xhttp.responseText.trim() == 'no') {
|
|
|
+ console.log("Response: " + xhttp.responseText);
|
|
|
+ $(customFields[4]).prop("disabled",true);
|
|
|
+ $(customFields[5]).prop("disabled",true);
|
|
|
+ $(customFields[3]).addClass('has-error');
|
|
|
+ $(customFields[3]).css('background-color', '#f003');;
|
|
|
+ $("#hintHead").text('E-Mail ' + $(customFields[3]).val() + ' nicht verfügbar!');
|
|
|
+ $("#hintLength").text('');
|
|
|
+ $("#hintNumeric").text('');
|
|
|
+ $("#hintSymbols").text('');
|
|
|
+ $("#hintUpperLower").text('');
|
|
|
+ } else if (xhttp.responseText.trim() == 'invalid') {
|
|
|
+ console.log("Response: " + xhttp.responseText);
|
|
|
+ $(customFields[4]).prop("disabled",true);
|
|
|
+ $(customFields[5]).prop("disabled",true);
|
|
|
+ $(customFields[3]).addClass('has-error');
|
|
|
+ $(customFields[3]).css('background-color', '#f003');;
|
|
|
+ $("#hintHead").text('Die E-Mail Adresse ist ungültig.');
|
|
|
+ $("#hintLength").text('');
|
|
|
+ $("#hintNumeric").text('');
|
|
|
+ $("#hintSymbols").text('');
|
|
|
+ $("#hintUpperLower").text('');
|
|
|
+ } else {
|
|
|
+ console.log("Response: " + xhttp.responseText);
|
|
|
+ $(customFields[4]).prop("disabled",true);
|
|
|
+ $(customFields[5]).prop("disabled",true);
|
|
|
+ $(customFields[3]).addClass('has-error');
|
|
|
+ $(customFields[3]).css('background-color', '#f003');;
|
|
|
+ $("#hintHead").text('Bei der Abfrage ist ein Fehler aufgetreten, es kann nicht fortgefahren werden. Bitte kontaktieren Sie den Support');
|
|
|
+ $("#hintLength").text('');
|
|
|
+ $("#hintNumeric").text('');
|
|
|
+ $("#hintSymbols").text('');
|
|
|
+ $("#hintUpperLower").text('');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ };
|
|
|
+ {/literal}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
jQuery(document).ready(function(){
|
|
|
customFields = $("*[id^='customfield']");
|
|
|
$("#btnCompleteProductConfig").prop("disabled",true);
|
|
|
@@ -83,6 +171,9 @@
|
|
|
$(customFields[2]).blur(function () {
|
|
|
checkUserName( $(customFields[2]).val(), {$productinfo['pid']});
|
|
|
});
|
|
|
+ $(customFields[3]).blur(function () {
|
|
|
+ checkEMail( $(customFields[3]).val(), {$productinfo['pid']});
|
|
|
+ });
|
|
|
$(customFields[4]).focus (function () {
|
|
|
$("#hintHead").text('Tipps für ein gutes Passwort');
|
|
|
$("#hintLength").text('Benutzen Sie mindestens 8 Zeichen');
|