Ejemplo n.º 1
0
     break;
 }
 $license = $info->getLicense();
 if (is_array($license)) {
     $license = $license['_content'];
 }
 $users = array();
 foreach ($info->getMaintainers() as $user) {
     if (!user::exists($user['handle'])) {
         $errors[] = 'Unknown user: '******'handle'];
         continue;
     }
     $users[strtolower($user['handle'])] = array('role' => $user['role'], 'active' => !isset($user['active']) || $user['active'] == 'yes');
 }
 include_once 'pear-database-maintainer.php';
 $e = maintainer::updateAll($pacid, $users, false, true);
 if (PEAR::isError($e)) {
     $errors[] = $e->getMessage();
     break;
 }
 $e = package::updateInfo($pacid, array('summary' => $info->getSummary(), 'description' => $info->getDescription(), 'license' => $license));
 if (PEAR::isError($e)) {
     $errors[] = $e->getMessage();
     break;
 }
 include_once 'pear-rest.php';
 $pear_rest = new pearweb_Channel_REST_Generator(PEAR_REST_PATH, $dbh);
 $return = $pear_rest->savePackageMaintainerREST($info->getPackage());
 if (PEAR::isError($return)) {
     if (auth_check('pear.admin')) {
         $errors[] = $return->getMessage();
Ejemplo n.º 2
0
         break;
     }
     if (!user::isAdmin($auth_user->handle) && !user::maintains($auth_user->handle, $pacid, 'lead')) {
         $errors[] = 'You don\'t have permissions to upload this release.';
         break;
     }
     $e = package::updateInfo($pacid, array('summary' => $info['summary'], 'description' => $info['description'], 'license' => $info['release_license']));
     if (PEAR::isError($e)) {
         $errors[] = $e->getMessage();
         break;
     }
     $users = array();
     foreach ($info['maintainers'] as $user) {
         $users[strtolower($user['handle'])] = array('role' => $user['role'], 'active' => 1);
     }
     $e = maintainer::updateAll($pacid, $users);
     if (PEAR::isError($e)) {
         $errors[] = $e->getMessage();
         break;
     }
     $file = release::upload($info['package'], $info['version'], $info['release_state'], $info['release_notes'], $distfile, md5_file($distfile));
 }
 if (PEAR::isError($file)) {
     $ui = $file->getUserInfo();
     $errors[] = 'Error while uploading package: ' . $file->getMessage() . ($ui ? " ({$ui})" : '');
     break;
 }
 @unlink($distfile);
 PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, 'report_warning');
 if (is_a($info, 'PEAR_PackageFile_v1') || is_a($info, 'PEAR_PackageFile_v2')) {
     release::promote_v2($info, $file);