Added file upload overwrite confirm prompt for server files.

Ylian Saint-Hilaire committed Oct 30, 2019 at 10:25 UTC ca97d2f9c011d71d26686958e4d1eef7f1281ff6
4 files changed +132 -20
views/default-min.handlebars
+33 -5
@@ -5163,6 +5163,7 @@
5163 function p13renamefileEx(b, t) { t.newname = Q('p13renameinput').value; files.sendText(t); p13folderup(999); }
5164 function p13fileNameCheck(e) { var x = isFilenameValid(Q('p13renameinput').value); QE('idx_dlgOkButton', x); if ((x == true) && (e != null) && (e.keyCode == 13)) { dialogclose(1); } }
5165 function p13uploadFile() { setDialogMode(2, "Upload File", 3, p13uploadFileEx, '<input type=file name=files id=p13uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p13uploadinput\')" />'); updateUploadDialogOk('p13uploadinput'); }
5166 + function updateUploadDialogOk(x) { QE('idx_dlgOkButton', Q('p13uploadinput').files.length > 0); }
5167 function p13uploadFileEx() { p13doUploadFiles(Q('p13uploadinput').files); }
5168 function p13viewfile() {
5169 var checkboxes = document.getElementsByName('fd');
@@ -6840,9 +6841,35 @@
6841 function p5renamefileEx(b, t) { t.newname = Q('p5renameinput').value; meshserver.send(t); }
6842 function p5fileNameCheck(e) { var x = isFilenameValid(Q('p5renameinput').value); QE('idx_dlgOkButton', x); if ((x == true) && (e && e.keyCode == 13)) { dialogclose(1); } }
6843 var isFilenameValid = (function(){ var x1=/^[^\\/:\*\?"<>\|]+$/, x2=/^\./, x3=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; return function isFilenameValid(fname){ return x1.test(fname)&&!x2.test(fname)&&!x3.test(fname)&&(fname[0] != '.'); } })();
6843 - function p5uploadFile() { setDialogMode(2, "Upload File", 3, p5uploadFileEx, '<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value=\"' + encodeURIComponent(filetreelinkpath) + '\" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p5uploadinput\')" /><input type=hidden name=authCookie value=' + authCookie + ' /><input type=submit id=p5loginSubmit style=display:none /></form>'); updateUploadDialogOk('p5uploadinput'); }
6844 + function p5uploadFile() { setDialogMode(2, "Upload File", 3, p5uploadFileEx, '<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value=\"' + encodeURIComponent(filetreelinkpath) + '\" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="p5updateUploadDialogOk(\'p5uploadinput\')" /><input type=hidden name=authCookie value=' + authCookie + ' /><input type=submit id=p5loginSubmit style=display:none /><span id=p5confirmOverwriteSpan style=display:none><br /><label><input type=checkbox id=p5confirmOverwrite onchange="p5updateUploadDialogOk(\'p5uploadinput\')" />' + "Confirm overwrite?" + '</label></span></form>'); p5updateUploadDialogOk('p5uploadinput'); }
6845 function p5uploadFileEx() { Q('p5loginSubmit').click(); }
6845 - function updateUploadDialogOk(x) { QE('idx_dlgOkButton', Q(x).value != ''); }
6846 + function p5updateUploadDialogOk() {
6847 + // Check if these are files we can upload, remove all folders.
6848 + var xallfiles = Q('p5uploadinput').files, files = [];
6849 + for (var i in xallfiles) { if ((xallfiles[i].size != null) && (xallfiles[i].size != 0)) { files.push(xallfiles[i]); } }
6850 +
6851 + // Check if these files are duplicates of existing files.
6852 + var filetreex = filetree, allfiles = [], overWriteCount = 0;
6853 + for (var i in filetreelocation) {
6854 + if ((filetreex.f != null) && (filetreex.f[filetreelocation[i]] != null)) { filetreex = filetreex.f[filetreelocation[i]]; }
6855 + }
6856 + QE('idx_dlgOkButton', xallfiles.length > 0);
6857 + if (xallfiles.length > 0) {
6858 + if (filetreex.f != null) {
6859 + for (var i in filetreex.f) { allfiles.push(i); }
6860 + for (var i = 0; i < xallfiles.length; i++) {
6861 + if (allfiles.indexOf(xallfiles[i].name) >= 0) { overWriteCount++; } // TODO: If the server is Windows, we need to lowercase both names.
6862 + }
6863 + }
6864 + QV('p5confirmOverwriteSpan', overWriteCount > 0);
6865 + if (overWriteCount > 0) {
6866 + QE('idx_dlgOkButton', Q('p5confirmOverwrite').checked);
6867 + } else {
6868 + Q('p5confirmOverwrite').checked = false;
6869 + QE('idx_dlgOkButton', true);
6870 + }
6871 + }
6872 + }
6873 /*
6874 function p5viewfile() {
6875 var checkboxes = document.getElementsByName('fc');
@@ -7312,8 +7339,9 @@
7339 }
7340
7341 function showCreateNewAccountDialogValidate(x) {
7315 - var ve = validateEmail(Q('p4email').value);
7342 + var ve = true;
7343 if (serverinfo.emailcheck) {
7344 + ve = validateEmail(Q('p4email').value);
7345 QE('p4verifiedEmail', ve);
7346 QE('p4invitationEmail', ve && Q('p4resetNextLogin').checked && Q('p4verifiedEmail').checked);
7347 if (ve == false) { Q('p4verifiedEmail').checked = false; }
@@ -7580,8 +7608,8 @@
7608 function p30showUserChangePassDialog(multiFactor) {
7609 if (xxdialogMode) return;
7610 var x = '';
7583 - x += addHtmlValue("Password", '<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
7584 - x += addHtmlValue("Password", '<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
7611 + x += addHtmlValue("Password", '<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
7612 + x += addHtmlValue("Password", '<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
7613 if (features & 0x00010000) { x += addHtmlValue("Password hint", '<input id=p4hint type=text style=width:230px maxlength=256></input>'); }
7614
7615 if (passRequirements) {
views/default.handlebars
+33 -5
@@ -6145,6 +6145,7 @@
6145 function p13renamefileEx(b, t) { t.newname = Q('p13renameinput').value; files.sendText(t); p13folderup(999); }
6146 function p13fileNameCheck(e) { var x = isFilenameValid(Q('p13renameinput').value); QE('idx_dlgOkButton', x); if ((x == true) && (e != null) && (e.keyCode == 13)) { dialogclose(1); } }
6147 function p13uploadFile() { setDialogMode(2, "Upload File", 3, p13uploadFileEx, '<input type=file name=files id=p13uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p13uploadinput\')" />'); updateUploadDialogOk('p13uploadinput'); }
6148 + function updateUploadDialogOk(x) { QE('idx_dlgOkButton', Q('p13uploadinput').files.length > 0); }
6149 function p13uploadFileEx() { p13doUploadFiles(Q('p13uploadinput').files); }
6150 function p13viewfile() {
6151 var checkboxes = document.getElementsByName('fd');
@@ -7822,9 +7823,35 @@
7823 function p5renamefileEx(b, t) { t.newname = Q('p5renameinput').value; meshserver.send(t); }
7824 function p5fileNameCheck(e) { var x = isFilenameValid(Q('p5renameinput').value); QE('idx_dlgOkButton', x); if ((x == true) && (e && e.keyCode == 13)) { dialogclose(1); } }
7825 var isFilenameValid = (function(){ var x1=/^[^\\/:\*\?"<>\|]+$/, x2=/^\./, x3=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; return function isFilenameValid(fname){ return x1.test(fname)&&!x2.test(fname)&&!x3.test(fname)&&(fname[0] != '.'); } })();
7825 - function p5uploadFile() { setDialogMode(2, "Upload File", 3, p5uploadFileEx, '<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value=\"' + encodeURIComponent(filetreelinkpath) + '\" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p5uploadinput\')" /><input type=hidden name=authCookie value=' + authCookie + ' /><input type=submit id=p5loginSubmit style=display:none /></form>'); updateUploadDialogOk('p5uploadinput'); }
7826 + function p5uploadFile() { setDialogMode(2, "Upload File", 3, p5uploadFileEx, '<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value=\"' + encodeURIComponent(filetreelinkpath) + '\" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="p5updateUploadDialogOk(\'p5uploadinput\')" /><input type=hidden name=authCookie value=' + authCookie + ' /><input type=submit id=p5loginSubmit style=display:none /><span id=p5confirmOverwriteSpan style=display:none><br /><label><input type=checkbox id=p5confirmOverwrite onchange="p5updateUploadDialogOk(\'p5uploadinput\')" />' + "Confirm overwrite?" + '</label></span></form>'); p5updateUploadDialogOk('p5uploadinput'); }
7827 function p5uploadFileEx() { Q('p5loginSubmit').click(); }
7827 - function updateUploadDialogOk(x) { QE('idx_dlgOkButton', Q(x).value != ''); }
7828 + function p5updateUploadDialogOk() {
7829 + // Check if these are files we can upload, remove all folders.
7830 + var xallfiles = Q('p5uploadinput').files, files = [];
7831 + for (var i in xallfiles) { if ((xallfiles[i].size != null) && (xallfiles[i].size != 0)) { files.push(xallfiles[i]); } }
7832 +
7833 + // Check if these files are duplicates of existing files.
7834 + var filetreex = filetree, allfiles = [], overWriteCount = 0;
7835 + for (var i in filetreelocation) {
7836 + if ((filetreex.f != null) && (filetreex.f[filetreelocation[i]] != null)) { filetreex = filetreex.f[filetreelocation[i]]; }
7837 + }
7838 + QE('idx_dlgOkButton', xallfiles.length > 0);
7839 + if (xallfiles.length > 0) {
7840 + if (filetreex.f != null) {
7841 + for (var i in filetreex.f) { allfiles.push(i); }
7842 + for (var i = 0; i < xallfiles.length; i++) {
7843 + if (allfiles.indexOf(xallfiles[i].name) >= 0) { overWriteCount++; } // TODO: If the server is Windows, we need to lowercase both names.
7844 + }
7845 + }
7846 + QV('p5confirmOverwriteSpan', overWriteCount > 0);
7847 + if (overWriteCount > 0) {
7848 + QE('idx_dlgOkButton', Q('p5confirmOverwrite').checked);
7849 + } else {
7850 + Q('p5confirmOverwrite').checked = false;
7851 + QE('idx_dlgOkButton', true);
7852 + }
7853 + }
7854 + }
7855 /*
7856 function p5viewfile() {
7857 var checkboxes = document.getElementsByName('fc');
@@ -8294,8 +8321,9 @@
8321 }
8322
8323 function showCreateNewAccountDialogValidate(x) {
8297 - var ve = validateEmail(Q('p4email').value);
8324 + var ve = true;
8325 if (serverinfo.emailcheck) {
8326 + ve = validateEmail(Q('p4email').value);
8327 QE('p4verifiedEmail', ve);
8328 QE('p4invitationEmail', ve && Q('p4resetNextLogin').checked && Q('p4verifiedEmail').checked);
8329 if (ve == false) { Q('p4verifiedEmail').checked = false; }
@@ -8562,8 +8590,8 @@
8590 function p30showUserChangePassDialog(multiFactor) {
8591 if (xxdialogMode) return;
8592 var x = '';
8565 - x += addHtmlValue("Password", '<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
8566 - x += addHtmlValue("Password", '<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
8593 + x += addHtmlValue("Password", '<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
8594 + x += addHtmlValue("Password", '<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
8595 if (features & 0x00010000) { x += addHtmlValue("Password hint", '<input id=p4hint type=text style=width:230px maxlength=256></input>'); }
8596
8597 if (passRequirements) {
views/translations/default-min_fr.handlebars
+33 -5
@@ -5163,6 +5163,7 @@
5163 function p13renamefileEx(b, t) { t.newname = Q('p13renameinput').value; files.sendText(t); p13folderup(999); }
5164 function p13fileNameCheck(e) { var x = isFilenameValid(Q('p13renameinput').value); QE('idx_dlgOkButton', x); if ((x == true) && (e != null) && (e.keyCode == 13)) { dialogclose(1); } }
5165 function p13uploadFile() { setDialogMode(2, "Upload File", 3, p13uploadFileEx, '<input type=file name=files id=p13uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p13uploadinput\')" />'); updateUploadDialogOk('p13uploadinput'); }
5166 + function updateUploadDialogOk(x) { QE('idx_dlgOkButton', Q('p13uploadinput').files.length > 0); }
5167 function p13uploadFileEx() { p13doUploadFiles(Q('p13uploadinput').files); }
5168 function p13viewfile() {
5169 var checkboxes = document.getElementsByName('fd');
@@ -6840,9 +6841,35 @@
6841 function p5renamefileEx(b, t) { t.newname = Q('p5renameinput').value; meshserver.send(t); }
6842 function p5fileNameCheck(e) { var x = isFilenameValid(Q('p5renameinput').value); QE('idx_dlgOkButton', x); if ((x == true) && (e && e.keyCode == 13)) { dialogclose(1); } }
6843 var isFilenameValid = (function(){ var x1=/^[^\\/:\*\?"<>\|]+$/, x2=/^\./, x3=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; return function isFilenameValid(fname){ return x1.test(fname)&&!x2.test(fname)&&!x3.test(fname)&&(fname[0] != '.'); } })();
6843 - function p5uploadFile() { setDialogMode(2, "Upload File", 3, p5uploadFileEx, '<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value=\"' + encodeURIComponent(filetreelinkpath) + '\" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p5uploadinput\')" /><input type=hidden name=authCookie value=' + authCookie + ' /><input type=submit id=p5loginSubmit style=display:none /></form>'); updateUploadDialogOk('p5uploadinput'); }
6844 + function p5uploadFile() { setDialogMode(2, "Upload File", 3, p5uploadFileEx, '<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value=\"' + encodeURIComponent(filetreelinkpath) + '\" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="p5updateUploadDialogOk(\'p5uploadinput\')" /><input type=hidden name=authCookie value=' + authCookie + ' /><input type=submit id=p5loginSubmit style=display:none /><span id=p5confirmOverwriteSpan style=display:none><br /><label><input type=checkbox id=p5confirmOverwrite onchange="p5updateUploadDialogOk(\'p5uploadinput\')" />' + "Confirm overwrite?" + '</label></span></form>'); p5updateUploadDialogOk('p5uploadinput'); }
6845 function p5uploadFileEx() { Q('p5loginSubmit').click(); }
6845 - function updateUploadDialogOk(x) { QE('idx_dlgOkButton', Q(x).value != ''); }
6846 + function p5updateUploadDialogOk() {
6847 + // Check if these are files we can upload, remove all folders.
6848 + var xallfiles = Q('p5uploadinput').files, files = [];
6849 + for (var i in xallfiles) { if ((xallfiles[i].size != null) && (xallfiles[i].size != 0)) { files.push(xallfiles[i]); } }
6850 +
6851 + // Check if these files are duplicates of existing files.
6852 + var filetreex = filetree, allfiles = [], overWriteCount = 0;
6853 + for (var i in filetreelocation) {
6854 + if ((filetreex.f != null) && (filetreex.f[filetreelocation[i]] != null)) { filetreex = filetreex.f[filetreelocation[i]]; }
6855 + }
6856 + QE('idx_dlgOkButton', xallfiles.length > 0);
6857 + if (xallfiles.length > 0) {
6858 + if (filetreex.f != null) {
6859 + for (var i in filetreex.f) { allfiles.push(i); }
6860 + for (var i = 0; i < xallfiles.length; i++) {
6861 + if (allfiles.indexOf(xallfiles[i].name) >= 0) { overWriteCount++; } // TODO: If the server is Windows, we need to lowercase both names.
6862 + }
6863 + }
6864 + QV('p5confirmOverwriteSpan', overWriteCount > 0);
6865 + if (overWriteCount > 0) {
6866 + QE('idx_dlgOkButton', Q('p5confirmOverwrite').checked);
6867 + } else {
6868 + Q('p5confirmOverwrite').checked = false;
6869 + QE('idx_dlgOkButton', true);
6870 + }
6871 + }
6872 + }
6873 /*
6874 function p5viewfile() {
6875 var checkboxes = document.getElementsByName('fc');
@@ -7312,8 +7339,9 @@
7339 }
7340
7341 function showCreateNewAccountDialogValidate(x) {
7315 - var ve = validateEmail(Q('p4email').value);
7342 + var ve = true;
7343 if (serverinfo.emailcheck) {
7344 + ve = validateEmail(Q('p4email').value);
7345 QE('p4verifiedEmail', ve);
7346 QE('p4invitationEmail', ve && Q('p4resetNextLogin').checked && Q('p4verifiedEmail').checked);
7347 if (ve == false) { Q('p4verifiedEmail').checked = false; }
@@ -7580,8 +7608,8 @@
7608 function p30showUserChangePassDialog(multiFactor) {
7609 if (xxdialogMode) return;
7610 var x = '';
7583 - x += addHtmlValue("Mot de passe", '<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
7584 - x += addHtmlValue("Mot de passe", '<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
7611 + x += addHtmlValue("Mot de passe", '<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
7612 + x += addHtmlValue("Mot de passe", '<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
7613 if (features & 0x00010000) { x += addHtmlValue("Password hint", '<input id=p4hint type=text style=width:230px maxlength=256></input>'); }
7614
7615 if (passRequirements) {
views/translations/default_fr.handlebars
+33 -5
@@ -6143,6 +6143,7 @@
6143 function p13renamefileEx(b, t) { t.newname = Q('p13renameinput').value; files.sendText(t); p13folderup(999); }
6144 function p13fileNameCheck(e) { var x = isFilenameValid(Q('p13renameinput').value); QE('idx_dlgOkButton', x); if ((x == true) && (e != null) && (e.keyCode == 13)) { dialogclose(1); } }
6145 function p13uploadFile() { setDialogMode(2, "Upload File", 3, p13uploadFileEx, '<input type=file name=files id=p13uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p13uploadinput\')" />'); updateUploadDialogOk('p13uploadinput'); }
6146 + function updateUploadDialogOk(x) { QE('idx_dlgOkButton', Q('p13uploadinput').files.length > 0); }
6147 function p13uploadFileEx() { p13doUploadFiles(Q('p13uploadinput').files); }
6148 function p13viewfile() {
6149 var checkboxes = document.getElementsByName('fd');
@@ -7820,9 +7821,35 @@
7821 function p5renamefileEx(b, t) { t.newname = Q('p5renameinput').value; meshserver.send(t); }
7822 function p5fileNameCheck(e) { var x = isFilenameValid(Q('p5renameinput').value); QE('idx_dlgOkButton', x); if ((x == true) && (e && e.keyCode == 13)) { dialogclose(1); } }
7823 var isFilenameValid = (function(){ var x1=/^[^\\/:\*\?"<>\|]+$/, x2=/^\./, x3=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; return function isFilenameValid(fname){ return x1.test(fname)&&!x2.test(fname)&&!x3.test(fname)&&(fname[0] != '.'); } })();
7823 - function p5uploadFile() { setDialogMode(2, "Upload File", 3, p5uploadFileEx, '<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value=\"' + encodeURIComponent(filetreelinkpath) + '\" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p5uploadinput\')" /><input type=hidden name=authCookie value=' + authCookie + ' /><input type=submit id=p5loginSubmit style=display:none /></form>'); updateUploadDialogOk('p5uploadinput'); }
7824 + function p5uploadFile() { setDialogMode(2, "Upload File", 3, p5uploadFileEx, '<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value=\"' + encodeURIComponent(filetreelinkpath) + '\" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="p5updateUploadDialogOk(\'p5uploadinput\')" /><input type=hidden name=authCookie value=' + authCookie + ' /><input type=submit id=p5loginSubmit style=display:none /><span id=p5confirmOverwriteSpan style=display:none><br /><label><input type=checkbox id=p5confirmOverwrite onchange="p5updateUploadDialogOk(\'p5uploadinput\')" />' + "Confirm overwrite?" + '</label></span></form>'); p5updateUploadDialogOk('p5uploadinput'); }
7825 function p5uploadFileEx() { Q('p5loginSubmit').click(); }
7825 - function updateUploadDialogOk(x) { QE('idx_dlgOkButton', Q(x).value != ''); }
7826 + function p5updateUploadDialogOk() {
7827 + // Check if these are files we can upload, remove all folders.
7828 + var xallfiles = Q('p5uploadinput').files, files = [];
7829 + for (var i in xallfiles) { if ((xallfiles[i].size != null) && (xallfiles[i].size != 0)) { files.push(xallfiles[i]); } }
7830 +
7831 + // Check if these files are duplicates of existing files.
7832 + var filetreex = filetree, allfiles = [], overWriteCount = 0;
7833 + for (var i in filetreelocation) {
7834 + if ((filetreex.f != null) && (filetreex.f[filetreelocation[i]] != null)) { filetreex = filetreex.f[filetreelocation[i]]; }
7835 + }
7836 + QE('idx_dlgOkButton', xallfiles.length > 0);
7837 + if (xallfiles.length > 0) {
7838 + if (filetreex.f != null) {
7839 + for (var i in filetreex.f) { allfiles.push(i); }
7840 + for (var i = 0; i < xallfiles.length; i++) {
7841 + if (allfiles.indexOf(xallfiles[i].name) >= 0) { overWriteCount++; } // TODO: If the server is Windows, we need to lowercase both names.
7842 + }
7843 + }
7844 + QV('p5confirmOverwriteSpan', overWriteCount > 0);
7845 + if (overWriteCount > 0) {
7846 + QE('idx_dlgOkButton', Q('p5confirmOverwrite').checked);
7847 + } else {
7848 + Q('p5confirmOverwrite').checked = false;
7849 + QE('idx_dlgOkButton', true);
7850 + }
7851 + }
7852 + }
7853 /*
7854 function p5viewfile() {
7855 var checkboxes = document.getElementsByName('fc');
@@ -8292,8 +8319,9 @@
8319 }
8320
8321 function showCreateNewAccountDialogValidate(x) {
8295 - var ve = validateEmail(Q('p4email').value);
8322 + var ve = true;
8323 if (serverinfo.emailcheck) {
8324 + ve = validateEmail(Q('p4email').value);
8325 QE('p4verifiedEmail', ve);
8326 QE('p4invitationEmail', ve && Q('p4resetNextLogin').checked && Q('p4verifiedEmail').checked);
8327 if (ve == false) { Q('p4verifiedEmail').checked = false; }
@@ -8560,8 +8588,8 @@
8588 function p30showUserChangePassDialog(multiFactor) {
8589 if (xxdialogMode) return;
8590 var x = '';
8563 - x += addHtmlValue("Mot de passe", '<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
8564 - x += addHtmlValue("Mot de passe", '<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
8591 + x += addHtmlValue("Mot de passe", '<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
8592 + x += addHtmlValue("Mot de passe", '<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>');
8593 if (features & 0x00010000) { x += addHtmlValue("Password hint", '<input id=p4hint type=text style=width:230px maxlength=256></input>'); }
8594
8595 if (passRequirements) {