Pman.Login.js
[Pman.Core] / Pman.Login.js
index 3cb181b..dc39a3d 100644 (file)
@@ -153,7 +153,15 @@ Pman.Login =  new Roo.util.Observable({
         this.fillAuth(res.data);
         
         this.checkFails =0;
-        Pman.onload();
+        
+        
+        if (Pman.onload) { 
+            Pman.onload();
+        }
+        if (Pman.Login.callback) {
+            Pman.Login.callback();
+            
+        }
         return false;
     },
     
@@ -308,10 +316,13 @@ Pman.Login =  new Roo.util.Observable({
                         //Roo.get('loading').show();
                         Roo.get('loading-mask').show();
                     }
-                   
-                    Pman.onload();
-                    
+                    if (Pman.onload) { 
+                        Pman.onload();
+                    }
+                    if (Pman.Login.callback) {
+                        Pman.Login.callback();
                      
+                    }
                     
                 }
             }
@@ -343,7 +354,7 @@ Pman.Login =  new Roo.util.Observable({
                         if (ev.keyCode == 13) {
                             Pman.Login.dialog.el.mask("Logging in");
                             Pman.Login.form.doAction('submit', {
-                                    url: baseURL + '/Login.json',
+                                    url: baseURL + '/Login',
                                     method: 'POST'
                             });
                         }
@@ -433,11 +444,12 @@ Pman.Login =  new Roo.util.Observable({
     
      
     
-    show: function (modal) 
+    show: function (modal, cb
     {
         if (this.disabled) {
             return;
         }
+        this.callback = cb; // used for non-pman usage..
         modal = modal || false;
         if (Pman.Login.authUserId < 0) { // logout!?
             return;
@@ -461,6 +473,7 @@ Pman.Login =  new Roo.util.Observable({
         }
         
         //incomming._node = tnode;
+        // why we want this non-modal????
         this.form.reset();
         this.dialog.modal = !modal;
         this.dialog.show();