Commit 7b12922555a95a6633a651fa41ae677e8b172860

Authored by Geoffrey PREUD'HOMME
2 parents 61d4f326 ed964ddd

Merge branch 'master' of github.com:ClubInfoPolytechLille/ci-site

Showing 1 changed file with 1 additions and 8 deletions   Show diff stats
app/services/PolyUserServ.js
@@ -8,13 +8,6 @@ var cache = new NodeCache(); @@ -8,13 +8,6 @@ var cache = new NodeCache();
8 8
9 var PolyUserServ = {}; 9 var PolyUserServ = {};
10 10
11 -function isEmpty(obj) {  
12 - for (var i in obj) {  
13 - return false;  
14 - }  
15 - return true;  
16 -}  
17 -  
18 PolyUserServ.readPasswd = function (login, cb) { 11 PolyUserServ.readPasswd = function (login, cb) {
19 passwdF = 'config/passwd'; 12 passwdF = 'config/passwd';
20 fs.exists(passwdF, function (exists) { 13 fs.exists(passwdF, function (exists) {
@@ -132,7 +125,7 @@ PolyUserServ.get = function (login, cb) { @@ -132,7 +125,7 @@ PolyUserServ.get = function (login, cb) {
132 if (err) { 125 if (err) {
133 cb(err); 126 cb(err);
134 } else { 127 } else {
135 - if (isEmpty(data)) { 128 + if (data[login] === undefined) {
136 PolyUserServ.add(login, cb); 129 PolyUserServ.add(login, cb);
137 } else { 130 } else {
138 cb(null, data[login]); 131 cb(null, data[login]);