PHP8
[Pman.BAdmin] / Pman.js
diff --git a/Pman.js b/Pman.js
index ed78114..25daefc 100644 (file)
--- a/Pman.js
+++ b/Pman.js
@@ -30,6 +30,7 @@ Pman = new Roo.Document(
     
     buildCompleted : false, // flag to say if we are building interface..
     events : {
+        'beforeauth' : true, // fired after page ready, before authentication check
         'beforeload' : true, // fired after page ready, before module building.
         'load' : true, // fired after module building
         'authrefreshed' : true // fire on auth updated?? - should be on Login?!?!?
@@ -37,7 +38,6 @@ Pman = new Roo.Document(
 
     onBuildComplete : function ()
     {
-        
         this.building = false;   
         //this.layout.getRegion('center').showPanel(0);
         //this.layout.endUpdate(); 
@@ -45,8 +45,6 @@ Pman = new Roo.Document(
         this.finalize();
         this.fireEvent('load',this);
         
-        Roo.log('checking????');
-        
         if (Pman.Login.authUser) {
             (function() {
                 if (typeof(FS) == 'undefined') {
@@ -81,19 +79,7 @@ Pman = new Roo.Document(
             Roo.state.Manager.setProvider(new Roo.state.CookieProvider());
             Roo.bootstrap.Tooltip.init(); 
 
-             
-            // reset password!!!!
-            /*
-            if (showNewPass.length) {
-                Pman.PasswordChange.show(  { passwordReset : showNewPass },
-                    function(data) {
-                        // fail and success we do  a load...
-                        Pman.Login.onLoad();
-                    }
-                );
-                return;
-            }
-            */
+           
             Pman.Login.onLoad();
             
         },
@@ -187,7 +173,7 @@ Pman = new Roo.Document(
         
 
     }, 
-   genericDelete : function(tab,tbl) {
+    genericDelete : function(tab,tbl) {
         
         var r = [];
         
@@ -201,12 +187,13 @@ Pman = new Roo.Document(
         for(var i = 0; i < s.length; i++) {
             r.push(s[i].json.id);
         }
-    
+        
         Roo.bootstrap.MessageBox.confirm("Confirm", "Are you sure you want to delete that?",
             function(btn) {
                 if (btn != 'yes') {
                     return;
                 }
+                
                 //tab.grid.mask("Deleting");
                 new Pman.Request({
                     url: baseURL + '/Roo/'+tbl+'.php',
@@ -232,7 +219,9 @@ Pman = new Roo.Document(
                         
                     },
                     failure: function(act) {
-                        Roo.log(act);
+                        Roo.bootstrap.MessageBox.hide();
+                        
+                        //Roo.log(act);
                         var msg = '';
                         try {
                             msg = act.errorMsg;
@@ -241,6 +230,7 @@ Pman = new Roo.Document(
                         }
                         //tab.grid.unmask();
                         Roo.bootstrap.MessageBox.alert("Error",  msg);
+                        
                     }
                     
                 });
@@ -262,10 +252,13 @@ Pman = new Roo.Document(
         var permname = obj.part.join('.');
             
         Roo.log("CHECKING: "+ permname);
-            
-                // we now have permission...
-                // obj.moduleOwner '.' lname
-             
+        
+        if (typeof(appDisabled) != 'undefined' && appDisabled.indexOf(permname)> -1)  {
+            obj.disabled = true;
+        }
+        // we now have permission...
+        // obj.moduleOwner '.' lname
+     
         if (Pman.Login.hasPermExists(permname) && !Pman.Login.hasPerm(permname,'S')) {
             // it's a turned off permission...
             Roo.log(permname + " is Disabled for this user");