diff options
author | Remi Collet <fedora@famillecollet.com> | 2010-11-07 12:03:06 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2010-11-07 12:03:06 +0100 |
commit | b72ffbce60aa1d90e09eb7f6153078a406626cee (patch) | |
tree | f30618ef0b8784dc1b6c5da6906f9624137015aa /rpm.php | |
parent | 32c6495e21342fb589b8d617fbe9ac0d99591232 (diff) |
add 'Channel' filter on list
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())); |