Parcourir la source

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 il y a 9 ans
Parent
commit
10eac29a3b
1 fichiers modifiés avec 1 ajouts et 16 suppressions
  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()) {