cvs: php-bugs-web / bug.php /include trusted-devs.inc
| From: | Jani Taskinen | Date: | Thu, 13 Feb 2003 18:29:25 +0000 |
| Subject: | cvs: php-bugs-web / bug.php /include trusted-devs.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-15700@lists.php.net to get a copy of this message | ||
sniper Thu Feb 13 13:29:25 2003 EDT
Added files:
/php-bugs-web/include trusted-devs.inc
Modified files:
/php-bugs-web bug.php
Log:
only allow trusted developers to delete comments..
Index: php-bugs-web/bug.php
diff -u php-bugs-web/bug.php:1.50 php-bugs-web/bug.php:1.51
--- php-bugs-web/bug.php:1.50 Thu Feb 13 12:41:58 2003
+++ php-bugs-web/bug.php Thu Feb 13 13:29:25 2003
@@ -8,6 +8,7 @@
require_once 'prepend.inc';
require_once 'cvs-auth.inc';
+require_once 'trusted-devs.inc';
$mail_bugs_to = 'php-bugs@lists.php.net';
@@ -49,7 +50,7 @@
# Delete comment
if ($edit == 1 && isset($delete_comment)) {
$addon = '';
- if (verify_password($user,stripslashes($pw))) {
+ if (in_array($user, $trusted_developers) && verify_password($user,stripslashes($pw))) {
delete_comment($id, $delete_comment);
$addon = '&thanks=1';
}
@@ -467,11 +468,11 @@
function output_note($com_id, $ts, $email, $comment)
{
- global $edit, $id;
+ global $edit, $id, $trusted_developers, $user;
echo "<div class=\"comment\">";
echo "<b>[",format_date($ts),"] ", htmlspecialchars($email),
"</b>\n";
- echo ($edit == 1 && $com_id !== 0) ? "<a
href=\"$PHP_SELF?id=$id&edit=1&delete_comment=$com_id\">[delete]</a>\n"
: '';
+ echo ($edit == 1 && $com_id !== 0 && in_array($user, $trusted_developers)) ?
"<a
href=\"$PHP_SELF?id=$id&edit=1&delete_comment=$com_id\">[delete]</a>\n"
: '';
echo "<pre class=\"note\">";
$note =
addlinks(preg_replace("/(\r?\n){3,}/","\n\n",wordwrap($comment,72,"\n",1)));
echo preg_replace('/(bug\ *#([0-9]+))/i', "<a
href=\"$PHP_SELF?id=\\2\">\\1</a>", $note);
Index: php-bugs-web/include/trusted-devs.inc
+++ php-bugs-web/include/trusted-devs.inc
<?php
# These developers can delete comments
$trusted_developers = array(
'sniper',
'derick',
'ilia',
);