summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgfuncs.inc.php
diff options
context:
space:
mode:
authorMarcel Korpel <marcel.korpel@gmail.com>2015-07-10 18:47:31 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-08-08 12:59:23 +0200
commit92e19e95f3c07745e7ba7c6e358921b7789f8abe (patch)
tree33b79d9247d96e25fdbb5cfd960808a7cf67dc5f /web/lib/pkgfuncs.inc.php
parent8375d212106918b602911f6286d2e4fd172d446e (diff)
downloadaurweb-92e19e95f3c07745e7ba7c6e358921b7789f8abe.tar.xz
Add comment edit icon and form
Show an icon next to the comment deletion icon, which leads to a comment edit form. Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib/pkgfuncs.inc.php')
-rw-r--r--web/lib/pkgfuncs.inc.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 110290b..7cb2ffc 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -43,6 +43,20 @@ function can_delete_comment_array($comment) {
}
/**
+ * Determine if the user can edit a specific package comment using an array
+ *
+ * Only the comment submitter, Trusted Users, and Developers can edit
+ * comments. This function is used for the frontend side of comment editing.
+ *
+ * @param array $comment All database information relating a specific comment
+ *
+ * @return bool True if the user can edit the comment, otherwise false
+ */
+function can_edit_comment_array($comment) {
+ return has_credential(CRED_COMMENT_EDIT, array($comment['UsersID']));
+}
+
+/**
* Check to see if the package name already exists in the database
*
* @param string $name The package name to check