cvs: pearweb /public_html/bugs bug.php report.php /public_html/bugs/include functions.inc
| From: | Tomas V.V.Cox | Date: | Tue, 09 Sep 2003 13:01:31 +0000 |
| Subject: | cvs: pearweb /public_html/bugs bug.php report.php /public_html/bugs/include functions.inc | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-12572@lists.php.net to get a copy of this message | ||
cox Tue Sep 9 09:01:31 2003 EDT
Modified files:
/pearweb/public_html/bugs bug.php report.php
/pearweb/public_html/bugs/include functions.inc
Log:
Second round of fixes
Index: pearweb/public_html/bugs/bug.php diff -u pearweb/public_html/bugs/bug.php:1.2 pearweb/public_html/bugs/bug.php:1.3 --- pearweb/public_html/bugs/bug.php:1.2 Mon Sep 8 21:25:12 2003 +++ pearweb/public_html/bugs/bug.php Tue Sep 9 09:01:30 2003 @@ -13,6 +13,7 @@ $mail_bugs_to = 'php-bugs@lists.php.net'; +/* if (isset($save) && isset($pw)) { # non-developers don't have $user set setcookie("MAGIC_COOKIE", base64_encode("$user:$pw"), @@ -22,6 +23,11 @@ if (isset($MAGIC_COOKIE) && !isset($user) && !isset($pw)) { list($user,$pw) = explode(":", base64_decode($MAGIC_COOKIE)); } +*/ +if (isset($_COOKIE['PEAR_USER']) && isset($_COOKIE['PEAR_PW'])) { + $user = $_COOKIE['PEAR_USER']; + $pw = $_COOKIE['PEAR_PW']; +} @mysql_connect("localhost","pear","pear") or die("Unable to connect to SQL server."); @@ -168,7 +174,7 @@ } if ($in && !$errors && $success) { - //mail_bug_updates($bug,$in,$from,$ncomment,$edit); + mail_bug_updates($bug,$in,$from,$ncomment,$edit); header("Location: $PHP_SELF?id=$id&thanks=$edit"); exit; } @@ -189,7 +195,7 @@ Thank you for your help! If the status of the bug report you submitted changes, you will be notified. You may return here and check on the status or update your report at any time. That URL for your bug report is: <a -href="http://bugs.php.net/<?php echo $id?>">http://bugs.php.net/<?php echo +href="/bugs/bug.php?id=<?php echo $id?>">http://pear.php.net/bugs/bug.php?id=<?php echo $id?></a>. </div> <?php Index: pearweb/public_html/bugs/report.php diff -u pearweb/public_html/bugs/report.php:1.2 pearweb/public_html/bugs/report.php:1.3 --- pearweb/public_html/bugs/report.php:1.2 Mon Sep 8 21:25:12 2003 +++ pearweb/public_html/bugs/report.php Tue Sep 9 09:01:30 2003 @@ -91,7 +91,7 @@ $summary = htmlspecialchars($summary); } - $bug_url = "/bug.php?id=$row[id]&edit=2"; + $bug_url = "/bugs/bug.php?id=$row[id]&edit=2"; echo "<tr><td colspan=\"2\"><a href=\"$bug_url\">Bug #" . $row['id'] . ": " . $row['sdesc'] . "</a></td></tr>"; echo "<tr><td>" . $summary . "</td>"; @@ -144,16 +144,18 @@ $sdesc = stripslashes($in['sdesc']); $ascii_report = "$report$sdesc\n\n".wordwrap($fdesc); - $ascii_report.= "\n-- \nEdit bug report at http://bugs.php.net/?id=$cid&edit="; + $ascii_report.= "\n-- \nEdit bug report at http://pear.php.net/bugs/bug.php?id=$cid&edit="; //list($mailto,$mailfrom) = get_bugtype_mail($in['bug_type']); list($developers, $mailfrom) = get_bugtype_mail($in['bug_type']); + $email = stripslashes($in['email']); $protected_email = '"'.spam_protect($email)."\" <$mailfrom>"; // provide shortcut URLS for "quick bug fixes" $dev_extra = ""; + /* $maxkeysize = 0; foreach ($RESOLVE_REASONS as $v) { if (!$v['webonly']) { @@ -166,6 +168,7 @@ $dev_extra .= str_pad($v['desc'] . ":", $maxkeysize) . " http://bugs.php.net/fix.php?id=$cid&r=$k\n"; } + */ // Set extra-headers $extra_headers = "From: $protected_email\n"; @@ -178,10 +181,10 @@ // mail to package developers foreach ($developers as $mailto) { - //mailno($mailto, "#$cid [NEW]: $sdesc", $ascii_report."1\n-- \n$dev_extra", $extra_headers); + mail($mailto, "#$cid [NEW]: $sdesc", $ascii_report."1\n-- \n$dev_extra", $extra_headers); } // mail to reporter - //mailno($email, "Bug #$cid: $sdesc", $ascii_report."2\n", "From: PHP Bug Database <$mailfrom>\nX-PHP-Bug: $cid\nMessage-ID: <bug-$cid@bugs.php.net>"); + mail($email, "Bug #$cid: $sdesc", $ascii_report."2\n", "From: PHP Bug Database <$mailfrom>\nX-PHP-Bug: $cid\nMessage-ID: <bug-$cid@bugs.php.net>"); header("Location: bug.php?id=$cid&thanks=4"); exit; } @@ -192,28 +195,28 @@ if (!isset($in)) { commonHeader("Report - New"); + show_bugs_menu($package); ?> -<p>Before you report a bug, make sure to search for similar bugs using the form -at the top of the page or our <a href="search.php">advanced search page</a>.<br /> -Also, read the instructions for <a href="how-to-report.php">how to report a bug +<p>Before you report a bug, make sure to search for similar bugs using the +"Bug List" link. Also, read the instructions for <a target="top" href="http://bugs.php.net/how-to-report.php">how to report a bug that someone will want to help fix</a>.</p> <p>If you aren't sure that what you're about to report is a bug, you should ask for help using one of the means for support -<a href="http://www.php.net/support.php">listed here</a>.</p> +<a href="/support.php">listed here</a>.</p> <p><strong>Failure to follow these instructions may result in your bug simply being marked as "bogus".</strong></p> <p><strong>If you feel this bug concerns a security issue, eg a buffer overflow, weak encryption, etc, then email -<a href="mailto:security@php.net?subject=possible new bug!">security@php.net</a> who will assess the situation. </strong></p> +<a href="mailto:pear-group@php.net?subject=%5BSECURITY%5D+possible+new+bug%21">pear-group@php.net</a> who will assess the situation. </strong></p> <?php } if ($errors) display_errors($errors); ?> -<form method="post" action="<?php echo $PHP_SELF;?>"> +<form method="post" action="<?php echo "$PHP_SELF?package=$package";?>"> <input type="hidden" name="in[did_luser_search]" value="<?php echo $in['did_luser_search'] ? 1 : 0; ?>" /> <table> <tr> @@ -229,7 +232,9 @@ </tr><tr> <th align="right">Package affected:</th> <td colspan="2"> - <select name="in[bug_type]"><?php show_types($in['bug_type'],0,$package);?></select> + <input type="hidden" name="in[bug_type]" value="<?php echo $package;?>"> + <?php echo $package;?> + <!-- <select name="in[bug_type]"><?php //show_types($in['bug_type'],0,$package);?></select> --> </td> </tr><tr> <th align="right">Operating system:</th> @@ -249,7 +254,7 @@ <td><font size="-2"> You may enter any password here, which will be stored for this bug report. This password allows you to come back and modify your submitted bug report - at a later date. [<a href="/bug-pwd-finder.php">Lost a bug password?</a>] + at a later date. <!-- [<a href="/bug-pwd-finder.php">Lost a bug password?</a>] --> </font></td> </tr> </table> Index: pearweb/public_html/bugs/include/functions.inc diff -u pearweb/public_html/bugs/include/functions.inc:1.1 pearweb/public_html/bugs/include/functions.inc:1.2 --- pearweb/public_html/bugs/include/functions.inc:1.1 Mon Sep 8 14:25:28 2003 +++ pearweb/public_html/bugs/include/functions.inc Tue Sep 9 09:01:31 2003 @@ -305,7 +305,7 @@ /* user text with attention, headers and previous messages */ $user_text = "ATTENTION! Do NOT reply to this email!\n" . "To reply, use the web interface found at\n" . - "http://bugs.php.net/?id=$bug[id]&edit=2\n\n\n" . + "http://pear.php.net/bugs/bug.php?id=$bug[id]&edit=2\n\n\n" . $header_text . $wrapped_text; @@ -313,7 +313,7 @@ $dev_text = $header_text . $wrapped_text . "\n-- \nEdit this bug report at " . - "http://bugs.php.net/?id=$bug[id]&edit=1\n"; + "http://pear.php.net/bugs/bug.php?id=$bug[id]&edit=1\n"; /* send mail if status was changed or there is a comment */ if ($in[status] != $bug[status] || $ncomment != "") { @@ -580,13 +580,23 @@ return array(" AND MATCH (bugdb.email,sdesc,ldesc) AGAINST ('" . addslashes($search) . "')", $ignored); } +// PEAR Related only function show_bugs_menu($pkgname) { + echo '<table width="100%" align="center" border="0"><tr><td>'; echo make_link("/package-info.php?package=$pkgname", "Package home"); echo " | "; echo make_link("/bugs/report.php?package=$pkgname", "Report a new bug"); echo " | "; - echo make_link("/bugs/search.php?cmd=display&bug_type[]=$pkgname", "Bug list"); + echo make_link("/bugs/search.php?cmd=display&bug_type[]=$pkgname&status=Open", "Bug list"); + if (preg_match('/search.php/', $_SERVER['PHP_SELF'])) { + // This could be changes by a SELECT box and JS + echo '</td><td align="right">Status: '; + echo make_link("/bugs/search.php?cmd=display&bug_type[]=$pkgname&status=Open", 'Open'); + echo " | "; + echo make_link("/bugs/search.php?cmd=display&bug_type[]=$pkgname&status=All", 'All'); + echo '</td></tr></table>'; + } echo "<hr/>"; }
Index: pearweb/public_html/bugs/bug.php diff -u pearweb/public_html/bugs/bug.php:1.2 pearweb/public_html/bugs/bug.php:1.3 --- pearweb/public_html/bugs/bug.php:1.2 Mon Sep 8 21:25:12 2003 +++ pearweb/public_html/bugs/bug.php Tue Sep 9 09:01:30 2003 @@ -13,6 +13,7 @@ $mail_bugs_to = 'php-bugs@lists.php.net'; +/* if (isset($save) && isset($pw)) { # non-developers don't have $user set setcookie("MAGIC_COOKIE", base64_encode("$user:$pw"), @@ -22,6 +23,11 @@ if (isset($MAGIC_COOKIE) && !isset($user) && !isset($pw)) { list($user,$pw) = explode(":", base64_decode($MAGIC_COOKIE)); } +*/ +if (isset($_COOKIE['PEAR_USER']) && isset($_COOKIE['PEAR_PW'])) { + $user = $_COOKIE['PEAR_USER']; + $pw = $_COOKIE['PEAR_PW']; +} @mysql_connect("localhost","pear","pear") or die("Unable to connect to SQL server."); @@ -168,7 +174,7 @@ } if ($in && !$errors && $success) { - //mail_bug_updates($bug,$in,$from,$ncomment,$edit); + mail_bug_updates($bug,$in,$from,$ncomment,$edit); header("Location: $PHP_SELF?id=$id&thanks=$edit"); exit; } @@ -189,7 +195,7 @@ Thank you for your help! If the status of the bug report you submitted changes, you will be notified. You may return here and check on the status or update your report at any time. That URL for your bug report is: <a -href="http://bugs.php.net/<?php echo $id?>">http://bugs.php.net/<?php echo +href="/bugs/bug.php?id=<?php echo $id?>">http://pear.php.net/bugs/bug.php?id=<?php echo $id?></a>. </div> <?php Index: pearweb/public_html/bugs/report.php diff -u pearweb/public_html/bugs/report.php:1.2 pearweb/public_html/bugs/report.php:1.3 --- pearweb/public_html/bugs/report.php:1.2 Mon Sep 8 21:25:12 2003 +++ pearweb/public_html/bugs/report.php Tue Sep 9 09:01:30 2003 @@ -91,7 +91,7 @@ $summary = htmlspecialchars($summary); } - $bug_url = "/bug.php?id=$row[id]&edit=2"; + $bug_url = "/bugs/bug.php?id=$row[id]&edit=2"; echo "<tr><td colspan=\"2\"><a href=\"$bug_url\">Bug #" . $row['id'] . ": " . $row['sdesc'] . "</a></td></tr>"; echo "<tr><td>" . $summary . "</td>"; @@ -144,16 +144,18 @@ $sdesc = stripslashes($in['sdesc']); $ascii_report = "$report$sdesc\n\n".wordwrap($fdesc); - $ascii_report.= "\n-- \nEdit bug report at http://bugs.php.net/?id=$cid&edit="; + $ascii_report.= "\n-- \nEdit bug report at http://pear.php.net/bugs/bug.php?id=$cid&edit="; //list($mailto,$mailfrom) = get_bugtype_mail($in['bug_type']); list($developers, $mailfrom) = get_bugtype_mail($in['bug_type']); + $email = stripslashes($in['email']); $protected_email = '"'.spam_protect($email)."\" <$mailfrom>"; // provide shortcut URLS for "quick bug fixes" $dev_extra = ""; + /* $maxkeysize = 0; foreach ($RESOLVE_REASONS as $v) { if (!$v['webonly']) { @@ -166,6 +168,7 @@ $dev_extra .= str_pad($v['desc'] . ":", $maxkeysize) . " http://bugs.php.net/fix.php?id=$cid&r=$k\n"; } + */ // Set extra-headers $extra_headers = "From: $protected_email\n"; @@ -178,10 +181,10 @@ // mail to package developers foreach ($developers as $mailto) { - //mailno($mailto, "#$cid [NEW]: $sdesc", $ascii_report."1\n-- \n$dev_extra", $extra_headers); + mail($mailto, "#$cid [NEW]: $sdesc", $ascii_report."1\n-- \n$dev_extra", $extra_headers); } // mail to reporter - //mailno($email, "Bug #$cid: $sdesc", $ascii_report."2\n", "From: PHP Bug Database <$mailfrom>\nX-PHP-Bug: $cid\nMessage-ID: <bug-$cid@bugs.php.net>"); + mail($email, "Bug #$cid: $sdesc", $ascii_report."2\n", "From: PHP Bug Database <$mailfrom>\nX-PHP-Bug: $cid\nMessage-ID: <bug-$cid@bugs.php.net>"); header("Location: bug.php?id=$cid&thanks=4"); exit; } @@ -192,28 +195,28 @@ if (!isset($in)) { commonHeader("Report - New"); + show_bugs_menu($package); ?> -<p>Before you report a bug, make sure to search for similar bugs using the form -at the top of the page or our <a href="search.php">advanced search page</a>.<br /> -Also, read the instructions for <a href="how-to-report.php">how to report a bug +<p>Before you report a bug, make sure to search for similar bugs using the +"Bug List" link. Also, read the instructions for <a target="top" href="http://bugs.php.net/how-to-report.php">how to report a bug that someone will want to help fix</a>.</p> <p>If you aren't sure that what you're about to report is a bug, you should ask for help using one of the means for support -<a href="http://www.php.net/support.php">listed here</a>.</p> +<a href="/support.php">listed here</a>.</p> <p><strong>Failure to follow these instructions may result in your bug simply being marked as "bogus".</strong></p> <p><strong>If you feel this bug concerns a security issue, eg a buffer overflow, weak encryption, etc, then email -<a href="mailto:security@php.net?subject=possible new bug!">security@php.net</a> who will assess the situation. </strong></p> +<a href="mailto:pear-group@php.net?subject=%5BSECURITY%5D+possible+new+bug%21">pear-group@php.net</a> who will assess the situation. </strong></p> <?php } if ($errors) display_errors($errors); ?> -<form method="post" action="<?php echo $PHP_SELF;?>"> +<form method="post" action="<?php echo "$PHP_SELF?package=$package";?>"> <input type="hidden" name="in[did_luser_search]" value="<?php echo $in['did_luser_search'] ? 1 : 0; ?>" /> <table> <tr> @@ -229,7 +232,9 @@ </tr><tr> <th align="right">Package affected:</th> <td colspan="2"> - <select name="in[bug_type]"><?php show_types($in['bug_type'],0,$package);?></select> + <input type="hidden" name="in[bug_type]" value="<?php echo $package;?>"> + <?php echo $package;?> + <!-- <select name="in[bug_type]"><?php //show_types($in['bug_type'],0,$package);?></select> --> </td> </tr><tr> <th align="right">Operating system:</th> @@ -249,7 +254,7 @@ <td><font size="-2"> You may enter any password here, which will be stored for this bug report. This password allows you to come back and modify your submitted bug report - at a later date. [<a href="/bug-pwd-finder.php">Lost a bug password?</a>] + at a later date. <!-- [<a href="/bug-pwd-finder.php">Lost a bug password?</a>] --> </font></td> </tr> </table> Index: pearweb/public_html/bugs/include/functions.inc diff -u pearweb/public_html/bugs/include/functions.inc:1.1 pearweb/public_html/bugs/include/functions.inc:1.2 --- pearweb/public_html/bugs/include/functions.inc:1.1 Mon Sep 8 14:25:28 2003 +++ pearweb/public_html/bugs/include/functions.inc Tue Sep 9 09:01:31 2003 @@ -305,7 +305,7 @@ /* user text with attention, headers and previous messages */ $user_text = "ATTENTION! Do NOT reply to this email!\n" . "To reply, use the web interface found at\n" . - "http://bugs.php.net/?id=$bug[id]&edit=2\n\n\n" . + "http://pear.php.net/bugs/bug.php?id=$bug[id]&edit=2\n\n\n" . $header_text . $wrapped_text; @@ -313,7 +313,7 @@ $dev_text = $header_text . $wrapped_text . "\n-- \nEdit this bug report at " . - "http://bugs.php.net/?id=$bug[id]&edit=1\n"; + "http://pear.php.net/bugs/bug.php?id=$bug[id]&edit=1\n"; /* send mail if status was changed or there is a comment */ if ($in[status] != $bug[status] || $ncomment != "") { @@ -580,13 +580,23 @@ return array(" AND MATCH (bugdb.email,sdesc,ldesc) AGAINST ('" . addslashes($search) . "')", $ignored); } +// PEAR Related only function show_bugs_menu($pkgname) { + echo '<table width="100%" align="center" border="0"><tr><td>'; echo make_link("/package-info.php?package=$pkgname", "Package home"); echo " | "; echo make_link("/bugs/report.php?package=$pkgname", "Report a new bug"); echo " | "; - echo make_link("/bugs/search.php?cmd=display&bug_type[]=$pkgname", "Bug list"); + echo make_link("/bugs/search.php?cmd=display&bug_type[]=$pkgname&status=Open", "Bug list"); + if (preg_match('/search.php/', $_SERVER['PHP_SELF'])) { + // This could be changes by a SELECT box and JS + echo '</td><td align="right">Status: '; + echo make_link("/bugs/search.php?cmd=display&bug_type[]=$pkgname&status=Open", 'Open'); + echo " | "; + echo make_link("/bugs/search.php?cmd=display&bug_type[]=$pkgname&status=All", 'All'); + echo '</td></tr></table>'; + } echo "<hr/>"; }