MTrackWeb/Roo.php
[web.mtrack] / MTrackWeb / Roo.php
1 <?php
2
3
4 require_once 'Pman/Roo.php';
5
6
7 /**
8  * This extends the standard Roo API
9  *
10  * however it has to verify that we send data protected, as it's pretty open!!!
11  *
12  * 
13  *
14  */
15
16 class MTrackWeb_Roo extends Pman_Roo
17 {
18     var $validTables = array(
19         'mtrack_ticket' /// all of these MUST have applyFilters, and check authenication..
20         'mtrack_changes',
21     );
22     
23     function getAuth() {
24         Pman::getAuth(); // load company!
25         $au = $this->getAuthUser();
26         $this->authUser =  false;
27         if ($au) {
28            $this->authUser = $au;
29         }
30         
31         return true;
32     }
33     
34     function get($tbl)
35     {
36         if (!in_array($tbl,$this->validTables)) {
37             $this->jerr("Invalid url");
38         }
39         return parent::get($tbl);
40     }
41     function post($table)
42     {
43         if (!in_array($tbl,$this->validTables)) {
44             $this->jerr("Invalid url");
45         }
46         return parent::post($tbl);
47     
48     }
49     function delete()
50     {
51         // only post requests..???
52         // need perms sorting out first.
53     }
54     
55 }