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_change',
21         'core_enum'
22     );
23     
24     function getAuth() {
25         Pman::getAuth(); // load company!
26         $au = $this->getAuthUser();
27         $this->authUser =  false;
28         if ($au) {
29            $this->authUser = $au;
30         }
31         
32         return true;
33     }
34     
35     function get($tbl)
36     {
37         
38         if (!in_array($tbl,$this->validTables)) {
39             $this->jerr("Invalid url");
40         }
41         
42         $x = DB_DataObject::Factory('Events');
43         echo '<PRE>'; print_r(array($x->table(), $x->keys()));
44         exit;
45         
46         return parent::get($tbl);
47     }
48     function post($tbl)
49     {
50         DB_DataObject::debugLevel(1);
51         
52         if (!in_array($tbl,$this->validTables)) {
53             $this->jerr("Invalid url");
54         }
55         return parent::post($tbl);
56     
57     }
58     function delete()
59     {
60         // only post requests..???
61         // need perms sorting out first.
62     }
63     
64 }