Better error reporting
authorAlan <alan@roojs.com>
Fri, 8 Sep 2023 05:11:59 +0000 (13:11 +0800)
committerAlan <alan@roojs.com>
Fri, 8 Sep 2023 05:11:59 +0000 (13:11 +0800)
DatabaseColumns.php
GroupCountries.php
GroupMembers.php
I18n.php
Lock.php
NotifyAction.php
RefreshDatabaseCache.php
RunGenerator.php
SendIntro.php
UpdateDatabase.php
UploadProgress.php

index fd674a3..703b1fa 100644 (file)
@@ -11,10 +11,10 @@ class Pman_Core_DatabaseColumns extends Pman {
         $au = $this->getAuthUser();
        
         if (!$au) {  
-            $this->jerr("Not authenticated", array('authFailure' => true));
+            $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         if (!$au->pid()   ) { // not set up yet..
-            $this->jerr("Not authenticated", array('authFailure' => true));
+            $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         
         
index e694d8d..fdd8fca 100644 (file)
@@ -15,7 +15,7 @@ class Pman_Core_GroupCountries extends Pman
         parent::getAuth(); // load company!
         $au = $this->getAuthUser();
         if (!$au) {
-            $this->jerr("Not authenticated", array('authFailure' => true));
+            $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         if ($au->company()->comptype != 'OWNER') {
             $this->jerr("Permission Denied" );
index f501042..ce061d7 100644 (file)
@@ -15,7 +15,7 @@ class Pman_Core_GroupMembers extends Pman
         parent::getAuth(); // load company!
         $au = $this->getAuthUser();
         if (!$au) {
-            $this->jerr("Not authenticated", array('authFailure' => true));
+            $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         if ($au->company()->comptype != 'OWNER') {
             $this->jerr("Permission Denied" );
index 9a1292d..bab0b2d 100644 (file)
--- a/I18n.php
+++ b/I18n.php
@@ -62,7 +62,7 @@ class Pman_Core_I18n extends Pman
         //return true;
         $au = $this->getAuthUser();
         //if (!$au) {
-        //    $this->jerr("Not authenticated", array('authFailure' => true));
+        //    $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         //}
         $this->authUser = $au;
         
index 3f1494b..661381f 100644 (file)
--- a/Lock.php
+++ b/Lock.php
@@ -40,7 +40,7 @@ class Pman_Core_Lock extends Pman
     {
          $au = $this->getAuthUser();
         if (!$au) {
-             $this->jerr("Not authenticated", array('authFailure' => true));
+             $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         $this->authUser = $au;
         // check that it's a supplier!!!! 
index e3b9af5..968eace 100644 (file)
@@ -16,7 +16,7 @@ class Pman_Core_NotifyAction extends Pman
     {
         $au = $this->getAuthUser();
         if (!$au) {
-             $this->jerr("Not authenticated", array('authFailure' => true));
+             $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         // workflow only applicable to owner company..
         if ($au->company()->comptype != 'OWNER') {
index 2994e1b..d574edd 100644 (file)
@@ -29,7 +29,7 @@ class Pman_Core_RefreshDatabaseCache extends Pman
         parent::getAuth(); // load company!
         $au = $this->getAuthUser();
         if (!$au || $au->company()->comptype != 'OWNER') {
-            $this->jerr("Not authenticated", array('authFailure' => true));
+            $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         $this->authUser = $au;
         return true;
index 3a4516a..3911255 100644 (file)
@@ -56,7 +56,7 @@ class Pman_Core_RunGenerator extends Pman
         parent::getAuth(); // load company!
         $au = $this->getAuthUser();
         if (!$au || $au->company()->comptype != 'OWNER') {
-            $this->jerr("Not authenticated", array('authFailure' => true));
+            $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         $this->authUser = $au;
         return true;
index c3187f1..6108d49 100644 (file)
@@ -28,7 +28,7 @@ class Pman_Core_SendIntro extends Pman
         
         $au = $this->getAuthUser();
         if (!$au) {
-            $this->jerr("Not authenticated", array('authFailure' => true));
+            $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         $this->authUser = $au;
         // check that it's a supplier!!!! 
index f7ac303..876e201 100644 (file)
@@ -177,7 +177,7 @@ class Pman_Core_UpdateDatabase extends Pman
         parent::getAuth(); // load company!
         $au = $this->getAuthUser();
         if (!$au || $au->company()->comptype != 'OWNER') {
-            $this->jerr("Not authenticated", array('authFailure' => true));
+            $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         $this->authUser = $au;
         return true;
index 7616fbf..a0b144d 100644 (file)
@@ -7,7 +7,7 @@ class Pman_Core_UploadProgress extends Pman
         
         $au = $this->getAuthUser();
         if (!$au) {
-             $this->jerr("Not authenticated", array('authFailure' => true));
+             $this->jerror("LOGIN-NOAUTH", "Not authenticated", array('authFailure' => true));
         }
         $this->authUser = $au;
         // check that it's a supplier!!!!