Pman/Login.php
[Pman.Base] / Pman.php
index 881a51e..44759cb 100644 (file)
--- a/Pman.php
+++ b/Pman.php
@@ -397,6 +397,9 @@ class Pman extends HTML_FlexyFramework_Page
         require_once 'Services/JSON.php';
         $json = new Services_JSON();
         
+        // log all errors!!!
+        $this->addEvent("ERROR", false, $str);
+        
         if (!empty($_REQUEST['returnHTML']) || 
             (isset($_SERVER['CONTENT_TYPE']) && preg_match('#multipart/form-data#i', $_SERVER['CONTENT_TYPE']))
         ) {
@@ -405,7 +408,7 @@ class Pman extends HTML_FlexyFramework_Page
             echo  $json->encodeUnsafe(array(
                     'success'=> false, 
                     'errorMsg' => $str,
-                     'message' => $str, // compate with exeption / loadexception.
+                    'message' => $str, // compate with exeption / loadexception.
 
                     'errors' => $errors ? $errors : true, // used by forms to flag errors.
                     'authFailure' => !empty($errors['authFailure']),
@@ -413,7 +416,7 @@ class Pman extends HTML_FlexyFramework_Page
             echo "</BODY></HTML>";
             exit;
         }
-       
+        
         echo $json->encode(array(
             'success'=> false, 
             'data'=> array(), 
@@ -487,10 +490,12 @@ class Pman extends HTML_FlexyFramework_Page
     {
         
         $mods = explode(',', $this->appModules);
-        array_unshift($mods,   'Core');
-        $mods = array_unique($mods);
-        
+        if (in_array('Core',$mods)) { // core has to be the first  modules loaded as it contains Pman.js
+            array_unshift($mods,   'Core');
+        }
         
+        $mods = array_unique($mods);
+         
         $disabled =  explode(',', $this->appDisable ? $this->appDisable: '');
         
         foreach($mods as $mod) {