daveappserver 0.6.20 → 0.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/appserver.js +28 -10
- package/package.json +1 -1
package/appserver.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var myVersion = "0.6.
|
|
1
|
+
var myVersion = "0.6.21", myProductName = "daveAppServer";
|
|
2
2
|
|
|
3
3
|
exports.start = startup;
|
|
4
4
|
exports.notifySocketSubscribers = notifySocketSubscribers;
|
|
@@ -1009,16 +1009,34 @@ function cleanFileStats (stats) { //4/19/21 by DW
|
|
|
1009
1009
|
function sendConfirmingEmail (email, screenname, flNewUser=false, urlRedirect, callback) {
|
|
1010
1010
|
email = utils.stringLower (email); //3/8/23 by DW
|
|
1011
1011
|
function getScreenname (callback) {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1012
|
+
function containsIllegalCharacter (name) { //3/17/23 by DW
|
|
1013
|
+
function isLegal (ch) {
|
|
1014
|
+
return (isAlpha (ch) || isNumeric (ch) || (ch == "_"));
|
|
1015
|
+
}
|
|
1016
|
+
for (var i = 0; i < name.length; i++) {
|
|
1017
|
+
let ch = name [i];
|
|
1018
|
+
if (!isLegal (ch)) {
|
|
1019
|
+
return (true);
|
|
1020
1020
|
}
|
|
1021
|
-
}
|
|
1021
|
+
}
|
|
1022
|
+
return (false);
|
|
1023
|
+
}
|
|
1024
|
+
if (flNewUser) { //the caller had to provide it
|
|
1025
|
+
if (containsIllegalCharacter (screenname)) { //3/17/23 by DW
|
|
1026
|
+
const message = "Can't create the user \"" + screenname + "\" because only alpha, numeric and underscore characters are allowed in names."
|
|
1027
|
+
callback ({message});
|
|
1028
|
+
}
|
|
1029
|
+
else {
|
|
1030
|
+
config.isUserInDatabase (screenname, function (flInDatabase) {
|
|
1031
|
+
if (flInDatabase) {
|
|
1032
|
+
const message = "Can't create the user \"" + screenname + "\" because there already is a user with that name."
|
|
1033
|
+
callback ({message});
|
|
1034
|
+
}
|
|
1035
|
+
else {
|
|
1036
|
+
callback (undefined, screenname);
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1022
1040
|
}
|
|
1023
1041
|
else { //we have to look it up
|
|
1024
1042
|
config.getScreenNameFromEmail (email, callback);
|