Пример #1
0
function printForm($data = array())
{
    // The first field that's empty
    $focus = '';
    foreach (array('name', 'email', 'subject', 'text') as $key) {
        if (!isset($data[$key])) {
            $data[$key] = '';
            $focus == '' ? $focus = $key : '';
        }
    }
    $bb = new BorderBox('Send email');
    $form = new HTML_Form(htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES) . '?handle=' . htmlspecialchars($_GET['handle'], ENT_QUOTES), 'post', 'contact');
    $form->addText('name', 'Your name:', $data['name'], 30);
    $form->addText('email', 'EMail address:', $data['email'], 30);
    $form->addText('subject', 'Subject:', $data['subject'], 30);
    $form->addTextarea('text', 'Text:', $data['text'], 35, 10);
    $form->addSubmit('submit', 'Submit');
    $form->display();
    $bb->end();
    echo "<script language=\"JavaScript\">\n";
    echo "<!--\n";
    echo "document.forms.contact." . $focus . ".focus();\n";
    echo "-->\n";
    echo "</script>";
}
Пример #2
0
     }
     $pear_rest->savePackageMaintainerREST($package);
     $url = $self;
     if (!empty($_GET['pid'])) {
         $url .= "?pid=" . urlencode(strip_tags($_GET['pid']));
     }
     echo '<br /><b>Done</b><br />';
     echo '<a href="' . $url . '">Back</a>';
 } else {
     if (!isAllowed($id)) {
         PEAR::raiseError("Only the lead maintainer of the package or PEAR\n                          administrators can edit the maintainers.");
         response_footer();
         exit;
     }
     $package = htmlentities($dbh->getOne('SELECT name FROM packages WHERE id=?', array($id)), ENT_QUOTES);
     $bb = new BorderBox("Manage maintainers for {$package}", "100%");
     echo '<script src="/javascript/package-maintainers.js" type="text/javascript"></script>';
     echo '<form onSubmit="beforeSubmit()" name="form" method="get" action="' . $self . '">';
     echo '<input type="hidden" name="update" value="yes" />';
     echo '<input type="hidden" name="pid" value="' . $id . '" />';
     echo '<table border="0" cellpadding="0" cellspacing="4" border="0" width="100%">';
     echo '<tr>';
     echo '  <th>All users:</th>';
     echo '  <th></th>';
     echo '  <th>Package maintainers:</th>';
     echo '</tr>';
     echo '<tr>';
     echo '  <td>';
     echo '  <select onChange="activateAdd();" name="accounts" size="10">';
     $users = user::listAll();
     foreach ($users as $user) {
Пример #3
0
 response_header("Request Account");
 $cs_link = make_link('http://git.php.net/?p=php-src.git;a=blob_plain;f=CODING_STANDARDS;hb=HEAD', 'PHP Coding Standards');
 $lic_link_pecl = make_link('http://www.php.net/license/3_01.txt', 'PHP License 3.01');
 $lic_link_doc = make_link('http://www.php.net/manual/en/cc.license.php', 'Creative Commons Attribution License');
 $doc_howto_pecl = make_link('http://wiki.php.net/doc/howto/pecldocs', 'PECL Docs Howto');
 print "<h1>Publishing in PECL</h1>\n\n<p>\n A few reasons why you might apply for a PECL account:\n</p>\n<ul>\n <li>You have written a PHP extension and would like it listed within the PECL directory</li>\n <li>You would like to use php.net for version control and hosting</li>\n <li>You would like to help maintain a current PECL extension</li>\n</ul>\n<p>\n\n<p>\n You do <b>not</b> need an account if you want to download, install and/or use PECL packages.\n</p>\n\n<p>\n Before filling out this form, you must write the public <i>pecl-dev@lists.php.net</i> mailing list and:\n</p>\n<ul>\n <li>Introduce yourself</li>\n <li>Introduce your new extension or the extension you would like to help maintain</li>\n <li>Link to the code, if applicable</li>\n</ul>\n\n<p>\n Also, here is a list of suggestions:\n</p>\n<ul>\n <li>\n  We strongly encourage contributors to choose the {$lic_link_pecl} for their extensions,\n  in order to avoid possible troubles for end-users of the extension. Other solid\n  options are BSD and Apache type licenses.\n </li>\n <li>\n  We strongly encourage you to use the {$cs_link} for your code, as it will help\n  the QA team (and others) help maintain the extension.\n </li>\n <li>\n  We strongly encourage you to commit documentation for the extension, as it will\n  make the extension more visible (in the official PHP manual) and also teach\n  users how to use it. See the {$doc_howto_pecl} for more information.\n  Submitted documentation will always be under the {$lic_link_doc}.\n </li>\n <li>\n  Note: wrappers for GPL (all versions) or LGPLv3 libraries will not be accepted.\n  Wrappers for libraries licensed under LGPLv2 are however allowed while being discouraged.\n </li>\n <li>\n  Note: Wrappers for libraries with license fees or closed sources libraries without licenses fees\n  are allowed.\n </li>\n\n</ul>\n\n<p>\n And after submitting the form:\n</p>\n<ul>\n <li>\n  If approved, you will also need to <a href='http://php.net/git-php.php'>apply for a php.net account</a>\n  in order to commit the code to the php.net SVN repository. Select 'PECL Group' within that form when applying.\n </li>\n</ul>\n\n<p>\n <strong>Please confirm the reason for this PECL account request:</strong>\n</p>\n\n<script language=\"JavaScript\" type=\"text/javascript\" defer=\"defer\">\n<!--\n\tfunction reasonClick(option)\n\t{\n\t\tif (option == 'pkg') {\n\t\t\tenableForm(true);\n\n\t\t\t// Lose border\n\t\t\tif (document.getElementById) {\n\t\t\t\tdocument.getElementById('reason_table').style.border = '2px dashed green';\n\t\t\t}\n\t\t} else {\n\t\t\t// Gain border\n\t\t\tif (document.getElementById) {\n\t\t\t\tdocument.getElementById('reason_table').style.border = '2px dashed red';\n\t\t\t}\n\n\t\t\talert('Reminder: please only request a PECL account if you will maintain a PECL extension, and have followed the guidelines above.');\n\t\t\tenableForm(false);\n\t\t}\n\t}\n\n\tfunction enableForm(disabled)\n\t{\n\t\tfor (var i=0; i<document.forms['request_form'].elements.length; i++) {\n\t\t\tdocument.forms['request_form'].elements[i].disabled = !disabled;\n\t\t\t//document.forms['request_form'].elements[i].style.backgroundColor = '#c0c0c0';\n\t\t}\n\t}\n\n\tenableForm(false);\n//-->\n</script>\n\n<table border=\"0\" style=\"border: 2px #ff0000 dashed; padding: 0px\" id=\"reason_table\">\n\t<tr>\n\t\t<td valign=\"top\"><input type=\"radio\" name=\"reason\" value=\"pkg\" id=\"reason_pkg\" onclick=\"reasonClick('pkg')\" /></td>\n\t\t<td>\n\t\t\t<label for=\"reason_pkg\">\n\t\t\t\tI have already discussed the topic of maintaining and/or adding a PECL extension on the\n\t\t\t\tpecl-dev@lists.php.net mailing list, and we determined it's time for me to have a PECL account.\n\t\t\t</label>\n\t\t</td>\n\t</tr>\n\n\t<tr>\n\t\t<td valign=\"top\"><input type=\"radio\" name=\"reason\" value=\"other\" id=\"reason_other\" onclick=\"reasonClick('other')\" /></td>\n\t\t<td>\n\t\t\t<label for=\"reason_other\">I desire this PECL account for another reason.</label>\n\t\t</td>\n\t</tr>\n</table>\n";
 if (isset($errorMsg)) {
     print "<table>\n";
     print " <tr>\n";
     print "  <td>&nbsp;</td>\n";
     print "  <td><b>{$errorMsg}</b></td>\n";
     print " </tr>\n";
     print "</table>\n";
 }
 print "<form action=\"" . htmlspecialchars($_SERVER['PHP_SELF']) . "\" method=\"post\" name=\"request_form\">\n";
 $bb = new BorderBox("Request a PECL account", "90%", "", 2, true);
 $bb->horizHeadRow("Username:"******"handle", $handle, 12));
 $bb->horizHeadRow("First Name:", HTML_Form::returnText("firstname", $firstname));
 $bb->horizHeadRow("Last Name:", HTML_Form::returnText("lastname", $lastname));
 $bb->horizHeadRow("Password:"******"password", null, 10) . "   Again: " . HTML_Form::returnPassword("password2", null, 10));
 $bb->horizHeadRow("Need a php.net account?", HTML_Form::returnCheckbox("needsvn", $needsvn));
 $bb->horizHeadRow("Email address:", HTML_Form::returnText("email", $email));
 $bb->horizHeadRow("Show email address?", HTML_Form::returnCheckbox("showemail", $showemail));
 $bb->horizHeadRow("Homepage", HTML_Form::returnText("homepage", $homepage));
 $bb->horizHeadRow("Purpose of your PECL account<br />(No account is needed for using PECL or PECL packages):", HTML_Form::returnTextarea("purpose", stripslashes($purpose)));
 $bb->horizHeadRow("Sponsoring users<br />(Current php.net users who suggested you request an account and reviewed your extension/patch):", HTML_Form::returnTextarea("sponsor", stripslashes($sponsor)));
 $bb->horizHeadRow("More relevant information<br />about you (optional):", HTML_Form::returnTextarea("moreinfo", stripslashes($moreinfo)));
 $bb->horizHeadRow("Requested from IP address:", $_SERVER['REMOTE_ADDR']);
 $bb->horizHeadRow("<input type=\"submit\" name=\"submit\" value=\"Submit\" />");
 $bb->end();
 print "</form>";
Пример #4
0
                    $dep_text .= sprintf("%s: %s %s", $dep_type_desc[$row['type']], $dep_name_html, $rel);
                } else {
                    $dep_text .= sprintf("%s: %s", $dep_type_desc[$row['type']], $dep_name_html);
                }
                $dep_text .= "<br />";
            }
            $bb->horizHeadRow($title, $dep_text);
        } else {
            $bb->horizHeadRow($title, "No dependencies registered.");
        }
    }
    if ($too_much && empty($version)) {
        $bb->fullRow("Dependencies for older releases can be found on the release overview page.");
    }
}
$bb->end();
// }}}
// {{{ Dependants
$dependants = package::getDependants($name);
if (count($dependants) > 0) {
    echo "<br /><br />";
    $bb = new BorderBox("Packages that depend on " . $name);
    foreach ($dependants as $dep) {
        $bb->plainRow(make_link("/package/" . $dep['p_name'], $dep['p_name']));
    }
    $bb->end();
}
// }}}
// {{{ page footer
response_footer();
// }}}
Пример #5
0
        $row['homepage'] = 'http://' . $row['homepage'];
    }
    $bb->horizHeadRow("Homepage:", "<a href=\"{$row['homepage']}\" target=\"_blank\">" . "{$row['homepage']}</a></td>\n");
}
//XXX: Remove entirely?
//$bb->horizHeadRow("Registered since:", $row['created']);
$bb->horizHeadRow("Additional information:", empty($row['userinfo']) ? "&nbsp;" : $row['userinfo']);
$bb->horizHeadRow("VCS Access:", implode("<br />", $access));
if ($row['wishlist'] != "") {
    $bb->horizHeadRow("Wishlist:", make_link("/wishlist.php/" . $row['handle'], "Click here to be redirected."));
}
if ($row['admin'] == 1) {
    $bb->fullRow("{$row['name']} is a PECL administrator.");
}
$query = "SELECT p.id, p.name, m.role\n          FROM packages p, maintains m\n          WHERE m.handle = '{$handle}'\n          AND p.id = m.package\n          AND p.package_type = 'pecl'\n          ORDER BY p.name";
$sth = $dbh->query($query);
$bb->end();
print "</td><td valign=\"top\">\n";
$bb = new BorderBox("Maintaining These Packages:", "100%", "", 2, true);
if ($sth->numRows() > 0) {
    $bb->headRow("Package Name", "Role");
    while (is_array($row = $sth->fetchRow())) {
        $bb->plainRow("<a href=\"/package/" . $row['name'] . "\">" . $row['name'] . "</a>", $row['role']);
    }
}
$bb->end();
print "<br />\n";
display_user_notes($handle, "100%");
print "<br /><a href=\"/account-edit.php?handle={$handle}\">" . make_image("edit.gif", "Edit") . "</a>";
print "</td></tr></table>\n";
response_footer();
Пример #6
0
function display_user_notes($user, $width = '50%')
{
    global $dbh;
    $bb = new BorderBox("Notes for user {$user}", $width);
    $notes = $dbh->getAssoc("SELECT id,nby,ntime,note FROM notes " . "WHERE uid = ? ORDER BY ntime", true, array($user));
    if (!empty($notes)) {
        print "<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\">\n";
        foreach ($notes as $nid => $data) {
            print " <tr>\n";
            print "  <td>\n";
            print "   <b>{$data['nby']} {$data['ntime']}:</b>";
            print "<br />\n";
            print "   " . htmlspecialchars($data['note']) . "\n";
            print "  </td>\n";
            print " </tr>\n";
            print " <tr><td>&nbsp;</td></tr>\n";
        }
        print "</table>\n";
    } else {
        print "No notes.";
    }
    $bb->end();
    return sizeof($notes);
}
Пример #7
0
if ($display_form) {
    $title = "New Package";
    response_header($title);
    print "<h1>{$title}</h1>\n\n<p>Use this form to register a new package.</p>\n\n\n<p>\n<b>Before proceeding</b>, make sure you pick the right name for your\npackage.  This is usually done through \"community consensus\", which\nmeans posting a suggestion to the pecl-dev mailing list and have\npeople agree with you.\n</p>\n\n\n";
    if (isset($errorMsg)) {
        print "<table>\n";
        print " <tr>\n";
        print "  <td>&nbsp;</td>\n";
        print "  <td><b>{$errorMsg}</b></td>\n";
        print " </tr>\n";
        print "</table>\n";
    }
    $categories = $dbh->getAssoc("SELECT id,name FROM categories ORDER BY name");
    $form =& new HTML_Form(htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES), "POST");
    print "<form method=\"post\" action=\"" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES) . "\">\n";
    $bb = new BorderBox("Register package", "100%", "", 2, true);
    $bb->horizHeadRow("Package Name", $form->returnText("name", get("name"), 20, 80));
    $bb->horizHeadRow("License", $form->returnText("license", get("license"), 20, 50));
    $cats = $form->returnSelect("category", $categories, get("category"), 1, "--Select Category--");
    $bb->horizHeadRow("Category", $cats);
    $bb->horizHeadRow("Summary", $form->returnText("summary", get("summary"), $width));
    $bb->horizHeadRow("Full description", $form->returnTextarea("desc", get("desc"), $width, 3));
    $bb->horizHeadRow("Additional project homepage", $form->returnText("homepage", get("homepage"), 40, 255));
    $bb->horizHeadRow("Browse Source URL", $form->returnText("cvs_link", get("cvs_link"), 40, 255) . '<br /><small>For example: http://cvs.php.net/cvs.php/pecl/PDO</small>');
    $bb->fullRow($form->returnSubmit("Submit Request", "submit"));
    $bb->end();
    if ($jumpto) {
        print "\n<script language=\"JavaScript\">\n<!--\n";
        print "document.forms[1].{$jumpto}.focus();\n";
        print "// -->\n</script>\n";
    }
Пример #8
0
							return true;
						}
						break;
				}
				
				return false;
			}
        //-->
        </script>
		<form action="<?php 
        echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES);
        ?>
" name="mass_reject_form" method="post">
		<input type="hidden" value="" name="cmd"/>
		<?php 
        $bb = new BorderBox("Account Requests", "100%", "", 7, true);
        $requests = $dbh->getAssoc("SELECT u.handle,u.name,n.note,u.userinfo,u.created FROM users u " . "LEFT JOIN notes n ON n.uid = u.handle " . "WHERE u.registered = 0 " . "ORDER BY created ASC");
        if (is_array($requests) && sizeof($requests) > 0) {
            $bb->headRow("<font face=\"Marlett\"><a href=\"#\" onclick=\"toggleSelectAll(this)\">6</a></font>", "Name", "Handle", "Account Purpose", "Status", "Created at", "&nbsp;");
            foreach ($requests as $handle => $data) {
                list($name, $note, $userinfo, $created_at) = $data;
                // Grab userinfo/request purpose
                if (@unserialize($userinfo)) {
                    $userinfo = @unserialize($userinfo);
                    $account_purpose = $userinfo[0];
                } else {
                    $account_purpose = $userinfo;
                }
                $rejected = preg_match("/^Account rejected:/", $note);
                if ($rejected) {
                    continue;