8c4a2e7207135ad1a8cec708c64b8f3943d044c5
[Pman.Core] / GroupCountries.php
1 <?php
2
3 /**
4  * Description of GroupCountries
5  *
6  * @author chris
7  */
8 require_once 'Pman.php';
9
10 class Pman_Core_GroupCountries extends Pman
11 {
12     //put your code here
13     
14     function getAuth() {
15         parent::getAuth(); // load company!
16         $au = $this->getAuthUser();
17         if (!$au) {
18             $this->jerr("Not authenticated", array('authFailure' => true));
19         }
20         if ($au->company()->comptype != 'OWNER') {
21             $this->jerr("Permission Denied" );
22         }
23         $this->authUser = $au;
24         return true;
25     }
26     
27     function get()
28     {
29         $this->post();
30     }
31     
32     function post()
33     {
34         if (!$this->hasPerm( 'Core.Groups','E')) { // editing groups..
35             $this->jerr("PERMISSION DENIED");
36         }
37         
38         $users = explode(',', $_REQUEST['user_ids']);
39         
40         switch($_REQUEST['action']){
41             case 'add':
42                 $this->addPersonToCountry();
43                 break;
44             case 'sup':
45                 $this->supPersonToCountry();
46                 break;
47         }
48         
49         print_r($_REQUEST);
50     }
51     
52     
53     
54 }