Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/editcomment.php
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
commit6854cb3f4d8219cf1829e32122eb2502a916eae9 (patch)
tree350feb504587d932e02837a1442b059759927646 /scripts/editcomment.php
initial checkin
Diffstat (limited to 'scripts/editcomment.php')
-rw-r--r--scripts/editcomment.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/editcomment.php b/scripts/editcomment.php
new file mode 100644
index 0000000..a74ee30
--- /dev/null
+++ b/scripts/editcomment.php
@@ -0,0 +1,28 @@
+<?php
+
+ /************************************\
+ | Edit comment |
+ | ~~~~~~~~~~~~ |
+ | This script allows users |
+ | to edit comments attached to tasks |
+ \************************************/
+
+if (!defined('IN_FS')) {
+ die('Do not access this file directly.');
+}
+
+$sql = $db->query("SELECT c.*, u.real_name
+ FROM {comments} c
+ INNER JOIN {users} u ON c.user_id = u.user_id
+ WHERE comment_id = ? AND task_id = ?",
+ array(Get::num('id', 0), Get::num('task_id', 0)));
+
+$page->assign('comment', $comment = $db->fetchRow($sql));
+
+if (!$user->can_edit_comment($comment)) {
+ Flyspray::show_error(11);
+}
+
+$page->pushTpl('editcomment.tpl');
+
+?>