From: Alan Date: Fri, 8 Sep 2023 05:11:59 +0000 (+0800) Subject: Better error reporting X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=53b45f75f244d22e86bfad89633ffcad1bdfb49e Better error reporting --- diff --git a/DatabaseColumns.php b/DatabaseColumns.php index fd674a30..703b1fae 100644 --- a/DatabaseColumns.php +++ b/DatabaseColumns.php @@ -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)); } diff --git a/GroupCountries.php b/GroupCountries.php index e694d8d8..fdd8fca9 100644 --- a/GroupCountries.php +++ b/GroupCountries.php @@ -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" ); diff --git a/GroupMembers.php b/GroupMembers.php index f501042e..ce061d7e 100644 --- a/GroupMembers.php +++ b/GroupMembers.php @@ -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" ); diff --git a/I18n.php b/I18n.php index 9a1292d1..bab0b2d3 100644 --- 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; diff --git a/Lock.php b/Lock.php index 3f1494b6..661381fa 100644 --- 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!!!! diff --git a/NotifyAction.php b/NotifyAction.php index e3b9af5c..968eace3 100644 --- a/NotifyAction.php +++ b/NotifyAction.php @@ -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') { diff --git a/RefreshDatabaseCache.php b/RefreshDatabaseCache.php index 2994e1bf..d574edd0 100644 --- a/RefreshDatabaseCache.php +++ b/RefreshDatabaseCache.php @@ -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; diff --git a/RunGenerator.php b/RunGenerator.php index 3a4516a6..39112559 100644 --- a/RunGenerator.php +++ b/RunGenerator.php @@ -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; diff --git a/SendIntro.php b/SendIntro.php index c3187f19..6108d490 100644 --- a/SendIntro.php +++ b/SendIntro.php @@ -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!!!! diff --git a/UpdateDatabase.php b/UpdateDatabase.php index f7ac3033..876e201a 100644 --- a/UpdateDatabase.php +++ b/UpdateDatabase.php @@ -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; diff --git a/UploadProgress.php b/UploadProgress.php index 7616fbf6..a0b144d1 100644 --- a/UploadProgress.php +++ b/UploadProgress.php @@ -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!!!!