Selaa lähdekoodia

Fixed some more security issues.

KrisVos130 9 vuotta sitten
vanhempi
sitoutus
f1d52271c2
2 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. 3 3
      app/client/client.js
  2. 2 2
      app/server/server.js

+ 3 - 3
app/client/client.js

@@ -427,7 +427,7 @@ Template.profile.events({
         var username = user.profile.username;
         $("#name").text("Name: " + realname);
         $("#input-name").val("")
-        Meteor.call("updateRealName", username, realname);
+        Meteor.call("updateRealName", realname);
     },
     "click #cancel-edit": function(){
         $("#name").show();
@@ -454,7 +454,7 @@ Template.profile.events({
         $("#profile-name").text(newUserName)
         $("#username").text("Username: " + newUserName);
         $("#input-username").val("")
-        Meteor.call("updateUserName", username, newUserName);
+        Meteor.call("updateUserName", newUserName);
         window.location = "/u/" + newUserName;
     },
     "click #cancel-username": function(){
@@ -1705,7 +1705,7 @@ Template.settings.events({
         $("#delete-account").click(function(){
             var bool = confirm("Are you sure you want to delete your account?");
             if(bool) {
-                Meteor.call("deleteAccount", Meteor.userId());
+                Meteor.call("deleteAccount");
             }
         })
     },

+ 2 - 2
app/server/server.js

@@ -1055,13 +1055,13 @@ Meteor.methods({
             throw new Meteor.Error(403, "Invalid permissions.");
         }
     },
-    updateUserRank: function(newRank){
+    /*updateUserRank: function(newRank){
         if (Meteor.userId()) {
             Meteor.users.update(Meteor.userId(), {$set: {"profile.rank": newRank}});
         } else {
             throw new Meteor.Error(403, "Invalid permissions.");
         }
-    },
+    },*/
     deleteAccount: function() {
         if (Meteor.userId()) {
             var user = Meteor.users.findOne(Meteor.userId());