diff options
Diffstat (limited to 'rpm.php')
-rw-r--r-- | rpm.php | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -68,8 +68,13 @@ function report($db, $type) $repos = $rpmrepo->getAllRepoHash(); $smarty->assign('repos', $repos); + $crit = array('type'=>$type, 'ORDER'=>'name'); + if (substr($what,0,1)=='#') { + $crit['channel'] = substr($what,1); + $what = '%fedora'; + } $i=0; - foreach ($uptable->request(array('type'=>$type, 'ORDER'=>'name')) as $up) { + foreach ($uptable->request($crit) as $up) { $package = null; $rpmname = $up['name']; @@ -238,27 +243,25 @@ function report($db, $type) try { switch ($type) { case "pecl": - $filter = "WHERE name LIKE 'php-pecl-%' "; + $filter = 'php-pecl-%'; break; case "pear": - $filter = "WHERE name LIKE 'php-%' "; + $filter = 'php-%'; break; case "R": - $filter = "WHERE name LIKE 'R-%' "; + $filter = 'R-%'; break; default: - $filter = ""; + $filter = ''; } $db = new PDO ("mysql:dbname=" . MYBASE . ";host=" . MYHOST, MYUSER, MYPASS); - $sql="SELECT DISTINCT owner FROM acls $filter ORDER BY owner"; - $res=$db->query($sql); - if ( $res ) { - while ( $owner = $res->fetchObject() ) { - $owners[] = $owner; - } - $smarty->assign('owners', $owners); - } + + $acl = new TableAcls($db); + $smarty->assign('owners', $acl->getOwners($filter)); + + $acl = new TableUpstream($db); + $smarty->assign('channels', $acl->getChannels($type)); $rpmrepo = new TableRpmRepo($db); $smarty->assign('repositories_update', date("r", $rpmrepo->getMaxStamp())); |