Browse 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 10 years ago
parent
commit
10eac29a3b
1 changed files with 1 additions and 16 deletions
  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()) {