Example #1
0
   +----------------------------------------------------------------------+
   | Copyright (c) 2001-2005 The PHP Group                                |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.02 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available at through the world-wide-web at                           |
   | http://www.php.net/license/2_02.txt.                                 |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Authors: Arnaud Limbourg <*****@*****.**>                       |
   +----------------------------------------------------------------------+
   $Id$
*/
/**
 * This page will show a list of packages with latest
 * release information along with bug count and any other info
 * that may be used to identify unmaintained packages
 */
auth_require('pear.qa');
response_header('Quality Assurance Initiative - Packages status');
$states = array('snapshot', 'devel', 'alpha', 'beta', 'stable');
echo "View packages status for the following state\n";
echo "<ul>\n";
foreach ($states as $state) {
    $link = make_link('/qa/packages_status_detail.php?state=' . $state, 'See packages status for state ' . $state, '', 'title="Details for state ' . $state . '"');
    echo '<li>' . $link . '</li>';
}
echo "</ul>\n";
response_footer();
Example #2
0
<?php

auth_require('pear.dev');
require_once 'notes/ManualNotes.class.php';
$manualNotes = new Manual_Notes();
$action = '';
if (isset($_REQUEST['action'])) {
    $action = strtolower($_REQUEST['action']);
}
switch ($action) {
    case 'makedocbug':
        if (isset($_GET['noteId'])) {
            $noteId = (int) $_GET['noteId'];
            $note = $manualNotes->getSingleCommentById($noteId);
            $registered = 1;
            $package = getPackageNameForId($note['page_url']);
            $package_name = is_null($package) ? 'Documentation' : $package;
            $bug_type = 'Documentation Problem';
            $email = $auth_user->email;
            $handle = $auth_user->handle;
            $sdesc = 'User note that is a documentation problem';
            $ldesc = 'Manual page: ' . $note['page_url'] . "\n" . 'Note submitter:' . "\n";
            if (!empty($note['user_handle'])) {
                $ldesc .= user_link($note['user_handle'], true);
            } else {
                include_once 'bugs/pear-bugs-utils.php';
                $ldesc .= PEAR_Bugs_Utils::spamProtect($note['user_name'], 'text');
            }
            $ldesc .= "\n\n" . str_replace('<br />', '', $dbh->escapeSimple(html_entity_decode($note['note_text'])));
            $package_version = null;
            $php_version = 'Irrelevant';
function isAllowed($package)
{
    global $auth_user;
    auth_require();
    $lead = in_array($auth_user->handle, array_keys(maintainer::get($package, true)));
    $admin = user::isAdmin($auth_user->handle);
    return $lead || $admin;
}
Example #4
0
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Author: Martin Jansen <*****@*****.**>                                   |
   +----------------------------------------------------------------------+
   $Id$
*/
redirect_to_https();
@session_start();
$csrf_token_name = 'pear_csrf_token_' . basename(__FILE__, '.php');
include_once 'HTML/QuickForm2.php';
include_once 'HTML/Table.php';
require_once 'Damblan/Karma.php';
require_once 'Damblan/Mailer.php';
auth_require('global.karma.manager');
$karma = new Damblan_Karma($dbh);
response_header("PEAR Administration :: Karma Management");
echo "<h1>Karma Management</h1>\n";
$handle = null;
if (!empty($_REQUEST['handle'])) {
    $handle = trim($_REQUEST['handle']);
    if (!preg_match(PEAR_COMMON_USER_NAME_REGEX, $handle)) {
        $handle = null;
    }
}
if ($handle === null || empty($handle)) {
    $form = new HTML_QuickForm2('karma_edit', 'post');
    $form->removeAttribute('name');
    include_once 'pear-database-user.php';
    $list = user::listAll(true);
Example #5
0
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Authors:                                                             |
   +----------------------------------------------------------------------+
   $Id$
*/
/*
 * Interface to delete a package.
 */
@session_start();
$csrf_token_name = 'pear_csrf_token_' . basename(__FILE__, '.php');
response_header('Delete Package');
echo '<h1>Delete Package</h1>';
auth_require('pear.qa', 'pear.admin', 'pear.group');
if (!isset($_GET['id'])) {
    report_error('No package ID specified.');
    response_footer();
    exit;
}
$id = (int) $_GET['id'];
include_once 'pear-database-package.php';
if (!isset($_POST['confirm'])) {
    $pkg = package::info($id);
    print_package_navigation($id, $pkg['name'], '/package-delete.php?id=' . $id);
    echo '<form action="' . 'package-delete.php?id=' . htmlspecialchars($id) . '" method="post">';
    echo '<table class="form-holder" style="margin-bottom: 2em;" cellspacing="1">';
    echo '<caption class="form-caption">Confirm</caption>';
    echo '<tr><td class="form-input">';
    echo 'Are you sure that you want to delete the package?' . "</td></tr>\n";
Example #6
0
   | This source file is subject to version 2.02 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available at through the world-wide-web at                           |
   | http://www.php.net/license/2_02.txt.                                 |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Author: Martin Jansen <*****@*****.**>                                   |
   +----------------------------------------------------------------------+
   $Id$
*/
redirect_to_https();
@session_start();
$csrf_token_name = 'pear_csrf_token_' . basename(__FILE__, '.php');
auth_require('pear.admin');
response_header('PEAR Administration :: Package Approval');
echo "<h1>Package Approval</h1>\n";
// Approve package identified by its id
if (!empty($_GET['approve']) || !empty($_GET['reject'])) {
    if (!validate_csrf_token($csrf_token_name, 'GET')) {
        report_error('Invalid token.');
        response_footer();
        exit;
    }
    if (!empty($_GET['approve'])) {
        $query = "UPDATE packages SET approved = 1 WHERE approved = 0 AND id = " . (int) $_GET['approve'];
        $id = $_GET['approve'];
        $action = "approved";
    } elseif (!empty($_GET['reject'])) {
        $query = "DELETE FROM packages WHERE approved = 0 AND id = " . (int) $_GET['reject'];
Example #7
0
<?php

if (!isset($id)) {
    header('HTTP/1.0 400 Bad Request');
    exit;
}
$canpatch = true;
require_once 'Text/CAPTCHA/Numeral.php';
$numeralCaptcha = new Text_CAPTCHA_Numeral();
$patchinfo = new Bugs_Patchtracker();
// captcha is not necessary if the user is logged in
if (isset($auth_user) && $auth_user->registered) {
    auth_require('pear.dev', 'pear.bug');
    if (isset($_SESSION['answer'])) {
        unset($_SESSION['answer']);
    }
}
if (PEAR::isError($buginfo = $patchinfo->getBugInfo($id))) {
    response_header('Error :: invalid bug selected');
    report_error('Invalid bug "' . $id . '" selected');
    response_footer();
    exit;
}
$loggedin = isset($auth_user) && $auth_user->registered;
if (!isset($_POST['addpatch'])) {
    /**
     * Normal patch form with predefined variables
     */
    $email = isset($_GET['email']) ? $_GET['email'] : '';
    $errors = array();
    $package = $buginfo['package_name'];
Example #8
0
  | license@php.net so we can mail you a copy immediately.               |
  +----------------------------------------------------------------------+
  | Authors: Ralf Becker <*****@*****.**>                               |
  |          Rasmus Lerdorf <*****@*****.**>                             |
  |          Ilia Alshanetsky <*****@*****.**>                         |
  +----------------------------------------------------------------------+
  All other licensing and usage conditions are those of the PHP Group.
*/
$VERSION = '$Id$';
////////// READ OPTIONAL CONFIGURATION FILE ////////////
if (file_exists("apc.conf.php")) {
    include "apc.conf.php";
}
////////////////////////////////////////////////////////
////////// BEGIN OF DEFAULT CONFIG AREA ///////////////////////////////////////////////////////////
auth_require(true);
/* we do not need the built in auth, admin only has access */
defaults('USE_AUTHENTIFICATION', 0);
// Use (internal) authentification - best choice if
// no other authentification is available
// If set to 0:
//  There will be no further authentification. You
//  will have to handle this by yourself!
// If set to 1:
//  You need to change ADMIN_PASSWORD to make
//  this work!
defaults('ADMIN_USERNAME', 'apc');
// Admin Username
defaults('ADMIN_PASSWORD', 'password');
// Admin Password - CHANGE THIS TO ENABLE!!!
// (beckerr) I'm using a clear text password here, because I've no good idea how to let
Example #9
0
   | This source file is subject to version 2.02 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available at through the world-wide-web at                           |
   | http://www.php.net/license/2_02.txt.                                 |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Authors:                                                             |
   +----------------------------------------------------------------------+
   $Id$
*/
/**
 * Interface to update package information.
 */
auth_require();
require_once "HTML/Form.php";
$form = new HTML_Form(htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES));
response_header("Edit package");
?>

<script language="javascript">
<!--

function confirmed_goto(url, message) {
    if (confirm(message)) {
        location = url;
    }
}
// -->
</script>
Example #10
0
 * This source file is subject to version 3.01 of the PHP license,
 * that is bundled with this package in the file LICENSE, and is
 * available through the world-wide-web at the following URI:
 * http://www.php.net/license/3_01.txt.
 * If you did not receive a copy of the PHP license and are unable to
 * obtain it through the world-wide-web, please send a note to
 * license@php.net so we can mail you a copy immediately.
 *
 * @category  pearweb
 * @package   pearweb_election
 * @author    Gregory Beaver <*****@*****.**>
 * @copyright Copyright (c) 2006 The PHP Group
 * @license   http://www.php.net/license/3_01.txt  PHP License
 * @version   $Id$
 */
auth_require('pear.election');
require 'election/pear-election.php';
$new = 'edit';
$year = date('Y');
$years = array($year + 1, $year--, $year--, $year--);
$election = new PEAR_Election();
if (isset($_GET['election'])) {
    $info = $election->getInfo($_GET['election']);
    if (!$info) {
        $error = 'Unknown election';
        $elections = $election->listElections();
        require PEARWEB_TEMPLATEDIR . '/election/listforedit.tpl.php';
        exit;
    }
    if (!$election->canEdit($_GET['election'])) {
        $error = 'Cannot edit that election';
Example #11
0
File: new.php Project: stof/pearweb
<?php

auth_require('pear.election', 'pear.admin');
$new = 'new';
$year = date('Y') + 1;
$years = array($year--, $year);
if (!isset($_POST['step'])) {
    $error = '';
    $info = array('purpose' => '', 'detail' => '', 'choices' => 2, 'year' => date('Y', strtotime('+30 days')), 'month' => date('m', strtotime('+30 days')), 'day' => date('d', strtotime('+30 days')), 'length' => 7, 'minimum' => 1, 'maximum' => 1, 'eligiblevoters' => 1);
    require PEARWEB_TEMPLATEDIR . '/election/new-step1.tpl.php';
} elseif ($_POST['step'] == 2) {
    require 'election/pear-election.php';
    $election = new PEAR_Election();
    $error = $election->validateStep1();
    $info['purpose'] = $_POST['purpose'];
    $info['detail'] = $_POST['detail'];
    $info['choices'] = (int) $_POST['choices'];
    $info['year'] = (int) $_POST['year'];
    $info['month'] = $_POST['month'];
    $info['day'] = $_POST['day'];
    $info['length'] = (int) $_POST['length'];
    $info['minimum'] = (int) $_POST['minimum'];
    $info['maximum'] = (int) $_POST['maximum'];
    $info['eligiblevoters'] = (int) $_POST['eligiblevoters'];
    if ($error) {
        require PEARWEB_TEMPLATEDIR . '/election/new-step1.tpl.php';
        exit;
    }
    for ($i = 1; $i <= $info['choices']; $i++) {
        $info['summary' . $i] = empty($_POST['summary' . $i]) ? '' : $_POST['summary' . $i];
        $info['summary_link' . $i] = empty($_POST['summary_link' . $i]) ? '' : $_POST['summary_link' . $i];
Example #12
0
 * that is bundled with this package in the file LICENSE, and is
 * available through the world-wide-web at the following URI:
 * http://www.php.net/license/3_0.txt.
 * If you did not receive a copy of the PHP license and are unable to
 * obtain it through the world-wide-web, please send a note to
 * license@php.net so we can mail you a copy immediately.
 *
 * @category  pearweb
 * @package   PEPr
 * @author    Tobias Schlitt <*****@*****.**>
 * @author    Daniel Convissor <*****@*****.**>
 * @copyright Copyright (c) 1997-2005 The PHP Group
 * @license   http://www.php.net/license/3_0.txt  PHP License
 * @version   $Id$
 */
auth_require('pear.pepr');
// Obtain the common functions and classes.
include_once 'pepr/pepr.php';
$karma =& new Damblan_Karma($dbh);
ob_start();
if ($proposal = proposal::get($dbh, @$_GET['id'])) {
    response_header('PEPr :: Editor :: ' . htmlspecialchars($proposal->pkg_name));
    echo '<h1>Proposal Editor for &quot;' . htmlspecialchars($proposal->pkg_name);
    echo '&quot; (' . $proposal->getStatus(true) . ")</h1>\n";
    if (!$proposal->mayEdit($auth_user->handle) && empty($_GET['next_stage'])) {
        report_error('You are not allowed to edit this proposal,' . ' probably due to it having reached the "' . $proposal->getStatus(true) . '" phase.' . ' If this MUST be edited, contact someone ELSE' . ' who has pear.pepr.admin karma.');
        response_footer();
        exit;
    }
    if ($proposal->compareStatus('>', 'proposal') && $karma->has($auth_user->handle, 'pear.pepr.admin') && empty($_GET['next_stage'])) {
        report_error('This proposal has reached the "' . $proposal->getStatus(true) . '" phase.' . ' Are you SURE you want to edit it?', 'warnings', 'WARNING:');
Example #13
0
   | Copyright (c) 2005 The PEAR Group                                    |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.02 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available at through the world-wide-web at                           |
   | http://www.php.net/license/2_02.txt.                                 |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Author: Martin Jansen <*****@*****.**>                                   |
   +----------------------------------------------------------------------+
   $Id$
*/
redirect_to_https();
auth_require("pear.dev");
response_header("API Documentation Queue Log");
echo "<h1>API Documentation Queue Log</h1>";
if (!empty($_GET['filename'])) {
    $filename = urldecode($_GET['filename']);
    $query = "SELECT queued, finished, log FROM apidoc_queue WHERE filename = ?";
    $info = $dbh->getRow($query, array($filename), DB_FETCHMODE_ASSOC);
    if (!is_array($info)) {
        echo "<div class=\"errors\">No such file " . strip_tags($filename) . ".</div>\n";
    } else {
        echo "<p>Log for <strong>" . $filename . "</strong>:</p>\n";
        echo "<ul>\n";
        echo "  <li>Queued: " . $info['queued'] . "</li>\n";
        echo "  <li>Finished: " . $info['finished'] . "</li>\n";
        echo "  <li>Command output:<br /><pre>" . strip_tags($info['log']) . "</pre></li>\n";
        echo "</ul>\n";