From ad09d023481f03b6dc835bf86f2999e40ab63b37 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 5 Feb 2011 11:09:56 +0100 Subject: fix co-maintainer list : only approved ones --- class/FedoraClient.php | 1 + fedcli.php | 11 +++++++++-- pkgdb-ajax.php | 17 +++++++---------- scripts/rpmphp.js | 10 +--------- zoom.php | 11 +++++++---- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/class/FedoraClient.php b/class/FedoraClient.php index 42a590b..62f8eac 100644 --- a/class/FedoraClient.php +++ b/class/FedoraClient.php @@ -98,6 +98,7 @@ abstract class FedoraClient // Follow redirect curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_MAXREDIRS, 5); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // Set standard headers curl_setopt( diff --git a/fedcli.php b/fedcli.php index 40b5b0c..a604ae8 100755 --- a/fedcli.php +++ b/fedcli.php @@ -118,13 +118,20 @@ function Package() { echo $branch.":\t".$pack['owner']; $i=0; + $tmp = array(); foreach ($pack['people'] as $user) { if (isset($user['aclOrder']['commit']['statuscode']) && $user['aclOrder']['commit']['statuscode']==3) { - echo ($i++ ? ", " : " (").$user['username']; + $tmp[] = $user['username']; } } - echo ($i ? ")\n" : "\n"); + if (count($tmp)) { + sort($tmp); + echo " (".implode($tmp, ', ').")\n"; + } else { + echo "\n"; + } } + } function Version() { diff --git a/pkgdb-ajax.php b/pkgdb-ajax.php index a2b84ae..65c5724 100644 --- a/pkgdb-ajax.php +++ b/pkgdb-ajax.php @@ -64,18 +64,15 @@ if ( !isset($name) || !$name ) { unset($fedpkg[$k]['package']['statuscode']); unset($fedpkg[$k]['package']['upstreamurl']); $people = $fedpkg[$k]['people']; - $new_people = null; + $tmp = array(); foreach ( $people as $p ) { - $new_people[] = array( - 'username' => $p['username'], - 'aclOrder' => array( - 'commit' => array( - 'statuscode' => $p['aclOrder']['commit']['statuscode'] - ) - ) - ); + if (isset($p['aclOrder']['commit']['statuscode']) + && $p['aclOrder']['commit']['statuscode']==3) { + $tmp[] = $p['username']; + } } - $fedpkg[$k]['people'] = $new_people; + sort($tmp); + $fedpkg[$k]['people'] = implode($tmp, ', '); $fedpkg[$k]['package']['description'] = nl2br($fedpkg[$k]['package']['description']); } } diff --git a/scripts/rpmphp.js b/scripts/rpmphp.js index 91f4fb9..ba3411d 100644 --- a/scripts/rpmphp.js +++ b/scripts/rpmphp.js @@ -39,15 +39,7 @@ function initZoomJS(name) if ( _owner_cell ) { _owner_cell.empty().text(_data.owner); _maintainers_cell = $('#pkgdb_' + k + '_maintainers'); - _maintainers = ''; - if ( _data.people != null ) { - $.each( - _data.people, - function(){ - _maintainers += this.username + ', '; - } - ) - } + _maintainers = _data.people; _maintainers_cell.empty().text(_maintainers.slice(0, -2)); } } diff --git a/zoom.php b/zoom.php index f20c730..8b00270 100644 --- a/zoom.php +++ b/zoom.php @@ -75,13 +75,16 @@ function getBranchPeople($params) $ret_tmp = $fedpkg[$branch]['people']; } } - if ( $people == 'people') { + if ( $people == 'people' && is_array($ret_tmp)) { + $tmp = array(); foreach ( $ret_tmp as $r ) { - if ( $ret !== null ) { - $ret .= ', '; + if (isset($r['aclOrder']['commit']['statuscode']) + && $r['aclOrder']['commit']['statuscode']==3) { + $tmp[] = $r['username']; } - $ret .= $r['username']; } + sort($tmp); + $ret = implode($tmp, ', '); } return $ret; } -- cgit