From 3578e77ad4e9258495eed7e786b7dc3aebcf1b63 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Mon, 6 Aug 2018 02:02:57 +0200 Subject: Allow listing all comments from a user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg Signed-off-by: Lukas Fleischer --- web/html/account.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'web/html/account.php') diff --git a/web/html/account.php b/web/html/account.php index c30a89aa..9695c9b7 100644 --- a/web/html/account.php +++ b/web/html/account.php @@ -8,7 +8,7 @@ include_once('acctfuncs.inc.php'); # access Account specific functions $action = in_request("Action"); $need_userinfo = array( - "DisplayAccount", "DeleteAccount", "AccountInfo", "UpdateAccount" + "DisplayAccount", "DeleteAccount", "AccountInfo", "UpdateAccount", "ListComments" ); if (in_array($action, $need_userinfo)) { @@ -166,6 +166,24 @@ if (isset($_COOKIE["AURSID"])) { $row["Username"]); } + } elseif ($action == "ListComments") { + if (has_credential(CRED_ACCOUNT_LIST_COMMENTS)) { + # display the comment list if they're a TU/dev + + $total_comment_count = account_comments_count($row["ID"]); + list($pagination_templs, $per_page, $offset) = calculate_pagination($total_comment_count); + + $username = $row["Username"]; + $uid = $row["ID"]; + $comments = account_comments($uid, $per_page, $offset); + + $comment_section = "account"; + include('pkg_comments.php'); + + } else { + print __("You are not allowed to access this area."); + } + } else { if (has_credential(CRED_ACCOUNT_SEARCH)) { # display the search page if they're a TU/dev -- cgit v1.2.3-24-g4f1b