update checkUserExists and inconsistencies
This commit is contained in:
@@ -290,8 +290,8 @@ class WTVMail {
|
||||
return icon_image;
|
||||
}
|
||||
|
||||
checkUserExists(username) {
|
||||
// returns the user's SSID if true, false if not
|
||||
checkUserExists(username, directory = null) {
|
||||
// returns the user's username if true, false if not
|
||||
var username_match = false;
|
||||
var search_dir = this.session_store_dir;
|
||||
var return_val = false;
|
||||
@@ -299,7 +299,7 @@ class WTVMail {
|
||||
if (directory) search_dir = directory;
|
||||
this.fs.readdirSync(search_dir).forEach(file => {
|
||||
if (self.fs.lstatSync(search_dir + self.path.sep + file).isDirectory()) {
|
||||
return self.checkUsernameAvailable(username, ssid_sessions, search_dir + self.path.sep + file);
|
||||
return self.checkUserExists(username, search_dir + self.path.sep + file);
|
||||
}
|
||||
if (!file.match(/.*\.json/ig)) return;
|
||||
if (username_match) return;
|
||||
|
||||
Reference in New Issue
Block a user