X-Git-Url: http://git.roojs.org/?p=Pman.Base;a=blobdiff_plain;f=Pman%2FRoo.php;h=e6559441cf9afdeb77a5e7409ebebade50327585;hp=7de861203dd10d7f063141b93e2b58a9600188d4;hb=HEAD;hpb=872bb568d35cf5639e586561a95b53d4a7175aa9 diff --git a/Pman/Roo.php b/Pman/Roo.php index 7de8612..ee0e571 100644 --- a/Pman/Roo.php +++ b/Pman/Roo.php @@ -42,7 +42,14 @@ require_once 'Pman.php'; class Pman_Roo extends Pman { - /** + + /* EVENTUALLY - move this stuff here.. + * use Pman_Core_RooTrait, + Pman_Core_RooGetTrait, + Pman_Core_RooPostTrait, + Pman_Core_RooJsonOutputTrait; + */ + /** * if set to an array (when extending this, then you can restrict which tables are available */ var $validTables = false; @@ -67,10 +74,10 @@ class Pman_Roo 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)); } @@ -255,7 +262,7 @@ class Pman_Roo extends Pman $this->setFilters($x,$_REQUEST); if (!$this->checkPerm($x,'S', $_REQUEST)) { - $this->jerr("PERMISSION DENIED (g)"); + $this->jerror("NOTICE-NOPERM", "PERMISSION DENIED (g)"); } //print_r($x); @@ -929,7 +936,7 @@ class Pman_Roo extends Pman if (method_exists($x, 'setFromRoo')) { $res = $x->setFromRoo($req, $this); if (is_string($res)) { - $this->jerr($res); + $this->jerror("NOTICE-INSERT", $res); } } else { $x->setFrom($req); @@ -1204,7 +1211,7 @@ class Pman_Roo extends Pman $x->whereAdd($this->key .' IN ('. implode(',', $bits) .')'); if (!$x->find()) { - $this->jerr("Nothing found to delete"); + $this->jerror("NOTICE-DELETE","Nothing found to delete"); } $errs = array(); while ($x->fetch()) { @@ -1283,7 +1290,7 @@ class Pman_Roo extends Pman if (method_exists($chk, 'toEventString')) { $desc .= ' : ' . $o[0]->toEventString(); } - $this->jerr("Delete Dependant records ($match_total found), " . + $this->jerror("NOTICE-DELETE-DEP", "Delete Dependant records ($match_total found), " . "first is ( $desc )"); } @@ -1588,7 +1595,8 @@ class Pman_Roo extends Pman } $tab = str_replace('/', '',$tab); // basic protection?? - $pm = HTML_FlexyFramework::get()->Pman; + $ff = HTML_FlexyFramework::get(); + $pm = isset($ff->Pman) ? $ff->Pman : array(); if (isset($pm['roo_alias'])) { $map = array_flip($pm['roo_alias']);