Explorar el Código

Fixed issue where isBanned checked if user was banned, if if so, it wouldn't check if the user was banned and say the user wasn't banned.

KrisVos130 hace 9 años
padre
commit
10eac29a3b
Se han modificado 1 ficheros con 1 adiciones y 16 borrados
  1. 1 16
      app/server/server.js

+ 1 - 16
app/server/server.js

@@ -456,22 +456,7 @@ Meteor.methods({
         }
     },
     isBanned: function() {
-        if (Meteor.userId() && !isBanned()) {
-            var user = Meteor.user();
-            if (user.punishments && user.punishments.ban) {
-                var ban = user.punishments.ban;
-                if (new Date(ban.bannedUntil).getTime() <= new Date().getTime()) {
-                    Meteor.users.update({"profile.usernameL": user.profile.usernameL}, {$unset: {"punishments.ban": ""}});
-                    return false;
-                } else {
-                    return true;
-                }
-            } else {
-                return false;
-            }
-        } else {
-            return false;
-        }
+        return isBanned();
     },
     updateSettings: function(showRating) {
         if (Meteor.userId() && !isBanned()) {