unknown пре 5 година
родитељ
комит
d558e0dabe
1 измењених фајлова са 20 додато и 6 уклоњено
  1. 20 6
      o2web/source/x_component_Forum/TopNode.js

+ 20 - 6
o2web/source/x_component_Forum/TopNode.js

@@ -346,11 +346,25 @@ MWF.xApplication.Forum.TopNode = new Class({
         });
     },
     logout: function(){
-        MWF.Actions.get("x_organization_assemble_authentication").logout( function(){
-            layout.desktop.session.user.distinguishedName = "anonymous";
-            this.app.clearContent();
-            this.app.loadApplicationContent();
-            this.openLoginForm();
-        }.bind(this))
+
+        MWF.Actions.get("x_organization_assemble_authentication").logout(function () {
+            if (this.socket) {
+                this.socket.close();
+                this.socket = null;
+            }
+            Cookie.dispose("x-token");
+            if (layout.session && layout.session.user) layout.session.user.token = "";
+
+            // layout.desktop.session.user.distinguishedName = "anonymous";
+            // this.app.clearContent();
+            // this.app.loadApplicationContent();
+            // this.openLoginForm();
+
+            // if( callback ){
+            //     callback()
+            // }else{
+                 window.location.reload();
+            // }
+        }.bind(this));
     }
 });