Пример #1
0
 $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>";
 if ($jumpto) {
     print "<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\n";
     print "if (!document.forms[1].{$jumpto}.disabled) document.forms[1].{$jumpto}.focus();\n";
     print "\n// -->\n</script>\n";
Пример #2
0
 /**
  * Produce a string containing a password input inside a table row
  *
  * @param string $name      the string used in the 'name' attribute
  * @param string $title     the string used as the label
  * @param mixed  $default   a default value for the element
  * @param int    $size      an integer used in the 'size' attribute
  * @param int    $maxlength an integer used in the 'maxlength' attribute
  * @param string $attr      a string of additional attributes to be put
  *                           in the element (example: 'id="foo"')
  * @param string $thattr    a string of additional attributes to be put
  *                           in the <th> element (example: 'class="foo"')
  * @param string $tdattr    a string of additional attributes to be put
  *                           in the <td> element (example: 'class="foo"')
  * @return string
  *
  * @access public
  * @static
  * @see HTML_Form::displayPassword(), HTML_Form::displayPasswordRow(),
  *      HTML_Form::returnPassword(), HTML_Form::addPassword(),
  *      HTML_Form::displayPasswordOneRow()
  */
 function returnPasswordOneRow($name, $title, $default = null, $size = HTML_FORM_PASSWD_SIZE, $maxlength = 0, $attr = '', $thattr = HTML_FORM_TH_ATTR, $tdattr = HTML_FORM_TD_ATTR)
 {
     $str = " <tr>\n";
     $str .= '  <th ' . $thattr . '>' . $title . "</th>\n";
     $str .= '  <td ' . $tdattr . ">\n   ";
     $str .= HTML_Form::returnPassword($name, $default, $size, $maxlength, $attr);
     $str .= "  </td>\n";
     $str .= " </tr>\n";
     return $str;
 }
Пример #3
0
$row = $dbh->getRow('SELECT * FROM users WHERE handle = ?', array($handle));
$cvs_acl_arr = $dbh->getCol('SELECT path FROM cvs_acl' . ' WHERE username = ? AND access = 1', 0, array($handle));
$cvs_acl = implode("\n", $cvs_acl_arr);
if ($row === null) {
    error_handler($handle . ' is not a valid account name.', 'Invalid Account');
}
$form = new HTML_Form(htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES), 'post');
$form->addText('name', '<span class="accesskey">N</span>ame:', $row['name'], 40, null, 'accesskey="n"');
$form->addText('email', 'Email:', $row['email'], 40, null);
$form->addCheckbox('showemail', 'Show email address?', $row['showemail']);
$form->addText('homepage', 'Homepage:', $row['homepage'], 40, null);
$form->addText('wishlist', 'Wishlist URI:', $row['wishlist'], 40, null);
$form->addText('pgpkeyid', 'PGP Key ID:' . '<p class="cell_note">(Without leading 0x)</p>', $row['pgpkeyid'], 40, 20);
$form->addTextarea('userinfo', 'Additional User Information:' . '<p class="cell_note">(limited to 255 chars)</p>', $row['userinfo'], 40, 5, null);
$form->addTextarea('cvs_acl', 'SVN Access:', $cvs_acl, 40, 5, null);
$form->addSubmit('submit', 'Submit');
$form->addHidden('handle', $handle);
$form->addHidden('command', 'update');
$form->display('class="form-holder" style="margin-bottom: 2em;"' . ' cellspacing="1"', 'Edit Your Information', 'class="form-caption"');
print '<a name="password"></a>' . "\n";
print '<h2>&raquo; Manage your password</h2>' . "\n";
$form = new HTML_Form(htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES), 'post');
$form->addPlaintext('<span class="accesskey">O</span>ld Password:'******'password_old', '', 40, 0, 'accesskey="o"'));
$form->addPassword('password', 'Password', '', 10, null);
$form->addCheckbox('PEAR_PERSIST', 'Remember username and password?', '');
$form->addSubmit('submit', 'Submit');
$form->addHidden('handle', $handle);
$form->addHidden('command', 'change_password');
$form->display('class="form-holder" cellspacing="1"', 'Change Password', 'class="form-caption"');
ob_end_flush();
response_footer();