php warnings
[Pman.MTrack] / UserRepos.php
1 <?php
2
3 require_once 'Pman.php';
4
5 class Pman_MTrack_UserRepos extends Pman {
6     
7     
8     function getAuth()
9     {
10         return true;
11         
12     }
13     function get($base, $opts= array())
14     {
15         $au = DB_DataObject::Factory('Person');
16         $au->company_id = $au->sqlValue("(SELECT id from Companies where  comptype='OWNER' LIMIT 1)");
17         if (!$au->get('email', $_REQUEST['email']) ) {
18             $this->err("invalid email");
19         }
20         $pd = DB_DataObject::Factory('ProjectDirectory');
21         $pd->whereAdd("role LIKE '%DEVELOPER%'");
22         $pd->person_id = $au->id;
23         $pd->selectAdd();
24         $pd->selectAdd('distinct(project_id) AS project_id');
25         $pids  = $pd->fetchAll('project_id');
26         
27         $repo = DB_DataObject::Factory('mtrack_repos');
28         $repo->whereAddIn('project_id', $pids, 'int');
29         $repos = $repo->fetchAll('shortname');
30         $this->jok($repos);
31    
32    
33    
34     }
35     
36     
37 }