Fix accumulation of socket.close code. Ready to finish Game.js and then the website
[vchess.git] / server / models / User.js
index cf4c529..9e1aded 100644 (file)
@@ -63,6 +63,16 @@ const UserModel =
                });
        },
 
+  getByName: function(names, cb) {
+               db.serialize(function() {
+                       const query =
+                               "SELECT id " +
+        "FROM Users " +
+                               "WHERE name IN ('" + names.join("','") + "')";
+                       db.all(query, cb);
+               });
+  },
+
        /////////
        // MODIFY