Merge branch 'master' of /home/git/private/web.mtrack
[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_change',
21         'core_enum',
22         'Person'
23     );
24     
25     function getAuth() {
26         Pman::getAuth(); // load company!
27         $au = $this->getAuthUser();
28         $this->authUser =  false;
29         if ($au) {
30            $this->authUser = $au;
31         }
32         
33         return true;
34     }
35     
36     function get($tbl)
37     {
38         
39         if (!in_array($tbl,$this->validTables)) {
40             $this->jerr("Invalid url");
41         }
42         
43        
44         
45         return parent::get($tbl);
46     }
47     function post($tbl)
48     {
49         
50         if (!in_array($tbl,$this->validTables)) {
51             $this->jerr("Invalid url");
52         }
53         return parent::post($tbl);
54     
55     }
56     function delete()
57     {
58         // only post requests..???
59         // need perms sorting out first.
60     }
61     
62 }