cvs: php-bugs-web / bug.php /include cvs-auth.inc functions.inc
| From: | Derick Rethans | Date: | Wed, 27 Oct 2004 07:30:51 +0000 |
| Subject: | cvs: php-bugs-web / bug.php /include cvs-auth.inc functions.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-26479@lists.php.net to get a copy of this message | ||
derick Wed Oct 27 03:30:51 2004 EDT
Modified files:
/php-bugs-web bug.php
/php-bugs-web/include cvs-auth.inc functions.inc
Log:
- Disallow posting comments in some instances, this hopefully cuts down on the
comment spam.
http://cvs.php.net/diff.php/php-bugs-web/bug.php?r1=1.68&r2=1.69&ty=u
Index: php-bugs-web/bug.php
diff -u php-bugs-web/bug.php:1.68 php-bugs-web/bug.php:1.69
--- php-bugs-web/bug.php:1.68 Thu Oct 14 02:03:40 2004
+++ php-bugs-web/bug.php Wed Oct 27 03:30:51 2004
@@ -58,11 +58,22 @@
exit();
}
+# comments allowed setting
+if (in_array($bug['status'], $no_comments_allowed)) {
+ $comments_allowed = false;
+} else {
+ $comments_allowed = true;
+}
+
# handle any updates, displaying errors if there were any
$success = !isset($in);
$errors = array();
if ($in && $edit == 3) {
+ if (!$comments_allowed) {
+ $errors[] = "You can not add comments for bugs with the statuses:" . join(',
', $no_comments_allowed);
+ }
+
if (!preg_match("/[.\\w+-]+@[.\\w-]+\\.\\w{2,}/i",$in['commentemail'])) {
$errors[] = "You must provide a valid email address.";
}
@@ -72,11 +83,6 @@
header("Location: $PHP_SELF?id=$id&edit=2");
exit();
}
-
- # Temporary, da.ru is spamming the bugs system right now
- if (false !== strpos($ncomment, 'da.ru')) {
- $errors[] = "Go away.";
- }
# check that they aren't using a php.net mail address without
# being authenticated (oh, the horror!)
@@ -263,7 +269,7 @@
}
control(0,'View/Vote');
-if ($edit != 2) {
+if ($edit != 2 && $comments_allowed) {
control(3,'Add Comment');
}
control(1,'Developer');
http://cvs.php.net/diff.php/php-bugs-web/include/cvs-auth.inc?r1=1.1&r2=1.2&ty=u
Index: php-bugs-web/include/cvs-auth.inc
diff -u php-bugs-web/include/cvs-auth.inc:1.1 php-bugs-web/include/cvs-auth.inc:1.2
--- php-bugs-web/include/cvs-auth.inc:1.1 Thu Sep 20 20:59:45 2001
+++ php-bugs-web/include/cvs-auth.inc Wed Oct 27 03:30:51 2004
@@ -1,5 +1,5 @@
<?php
-/* $Id: cvs-auth.inc,v 1.1 2001/09/21 00:59:45 jimw Exp $ */
+/* $Id: cvs-auth.inc,v 1.2 2004/10/27 07:30:51 derick Exp $ */
$ignore_password = false;
$passwd_file = "/repository/CVSROOT/passwd";
@@ -8,6 +8,9 @@
global $passwd_file, $ignore_password;
if ($ignore_password) return " "; // can't be ""
$fp=fopen($passwd_file,"r");
+ if (!$fp) {
+ return ("");
+ }
while(!feof($fp)) {
$line=fgets($fp,120);
list($luser,$passwd,$junk) = explode(":",$line);
http://cvs.php.net/diff.php/php-bugs-web/include/functions.inc?r1=1.135&r2=1.136&ty=u
Index: php-bugs-web/include/functions.inc
diff -u php-bugs-web/include/functions.inc:1.135 php-bugs-web/include/functions.inc:1.136
--- php-bugs-web/include/functions.inc:1.135 Mon Sep 27 11:24:30 2004
+++ php-bugs-web/include/functions.inc Wed Oct 27 03:30:51 2004
@@ -85,6 +85,8 @@
"Bogus" => 2,
"All" => 0
);
+
+$no_comments_allowed = array('Closed', 'Duplicate', 'Wont fix',
'Bogus', 'Stale');
function show_state_options($state, $user_mode=0, $default="")
{