Sfoglia il codice sorgente

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 9 anni fa
parent
commit
10eac29a3b
1 ha cambiato i file con 1 aggiunte e 16 eliminazioni
  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()) {