Commit graph

24 commits

Author SHA1 Message Date
Lukas Fleischer
aa555f9ae5 Explain syntax/features in the comments section
Addresses FS#64983.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-02 12:12:43 +01:00
Vladimir Panteleev
e3ca3c96e5 Add "Enable notifications" checkbox in "Add Comment" form
Currently, it is a little to easy to forget to enable notifications
for a package after leaving a comment, thus never being notified of a
reply. Even though the "Enable notifications" link is on the same
page, it is not part of the flow for posting a new comment, and so,
easy to miss.

Most web forums and comment systems include a checkbox to enable
notifications when posting for the first time in a thread. This patch
implements this in aurweb, as well.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
2019-04-28 08:58:29 -04:00
Marcel Korpel
60433a930d Remove success message from comment form
To be more flexible with messages, we shouldn't always output this
message when a comment has been sent. Moreover, currently it is not
displayed due to the POST-Redirect-GET pattern, where the comment
parameter is lost after redirection.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-17 04:20:45 +02:00
Marcel Korpel
c7025054c6 Split pkg_comment_form.php so the outer box is not always included
For use in the new RPC interface to edit comments, the form shouldn't
always print a header. Create a new template pkg_comment_box.php that
prints form and box, change template pkg_comment_form.php to only
print the form.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:24 +02:00
Marcel Korpel
92e19e95f3 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>
2015-08-08 12:59:23 +02:00
Lukas Fleischer
f461344211 Move package actions to package bases
Package actions now operate on package bases instead of packages. Move
all actions to the correct locations.

This also fixes some issues with comment notifications.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 13:54:06 +02:00
Lukas Fleischer
630f1cbae8 Avoid use of "$_SERVER['REQUEST_URI']"
Use the routing library to build proper URIs instead of relying on the
"REQUEST_URI" server variable which can be manipulated and might return
bogus URIs.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-04 19:19:32 +01:00
canyonknight
61043de89b pkg_comment_form.php: Remove reference to "call" attribute
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-10-20 18:47:00 +02:00
canyonknight
350c9a9579 pkg_comment_form.php: Remove redundant label for the comment box
Comment box already uses <h2> tag. Additional label is not needed.
Also remove label for form submit button.

Reported-by: Dave Reisner <d@falconindy.com>
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-10-11 21:19:20 +02:00
Lukas Fleischer
6102759b7c Use echo shortcut syntax
Replace all occurrences of "<?php echo" and "<?php print" by "<?=" to
reduce noise in templates.

Note that as of PHP 5.4.0, "<?=" is always available and no longer
requires "short_open_tag" to be set.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-24 12:23:04 +02:00
canyonknight
5186f83ab7 pkg_comment_form.php: Fix PHP undefined variable notice for package "ID"
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-09-18 00:59:04 +02:00
Lukas Fleischer
f3ce74c714 Merge branch 'maint'
Conflicts:
	web/html/account.php
	web/html/addvote.php
	web/html/pkgsubmit.php
	web/lib/acctfuncs.inc.php
	web/template/actions_form.php
	web/template/pkg_comment_form.php
	web/template/pkg_comments.php
	web/template/pkg_details.php
	web/template/pkg_search_results.php
	web/template/tu_details.php
2012-07-14 22:52:04 +02:00
canyonknight
d3de667901 pkg_comment_form.php: Pull out DB code
* Move DB code and e-mail code from pkg_comment_form.php to new function in
pkgfuncs.inc.php
* Centralization of DB code important in a future transition to PDO interface

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-07-06 11:26:57 +02:00
Lukas Fleischer
ba120ca304 Refactor package comment form
* Adjust style to match the overall layout.
* Use proper HTML tags and double quotes.
* Remove the "Reset" button.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: canyonknight <canyonknight@gmail.com>
2012-07-06 11:26:12 +02:00
canyonknight
2c93f0a98f Implement token system to fix CSRF vulnerabilities
Specially crafted pages can force authenticated users to unknowingly perform
actions on the AUR website despite being on an attacker's website. This
cross-site request forgery (CSRF) vulnerability applies to all POST data on
the AUR.

Implement a token system using a double submit cookie. Have a hidden form
value on every page containing POST forms. Use the newly added check_token() to
verify the token sent via POST matches the "AURSID" cookie value. Random
nature of the token limits potential for CSRF.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-06-24 10:59:23 +02:00
Lukas Fleischer
f5e1652bf9 Always set the "To:" header when sending mail
Use "undisclosed-recipients: ;" when sending mass notifications (such as
comment notifications and the like. Addresses FS#28229.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-03-08 11:43:48 +01:00
Dan McGee
e571a694d6 Add a new AUR_LOCATION setting
This should be set to something like 'http://localhost' for development
or 'https://aur.archlinux.org' in production. It ensures all links in
the site stay in the development site and there is no sudden jump from
development to production environments.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-11-02 21:21:23 +01:00
Lukas Fleischer
10b6a8fff7 Wrap mysql_real_escape_string() in a function
Wrap mysql_real_escape_string() in a wrapper function db_escape_string()
to ease porting to other databases, and as another step to pulling more
of the database code into a central location.

This is a rebased version of a patch by elij submitted about half a year
ago.

Thanks-to: elij <elij.mx@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>

Conflicts:

	web/lib/aur.inc.php
2011-10-25 09:25:30 +02:00
Lukas Fleischer
323d418f02 Wrap mysql_real_escape_string() in a function
Wrap mysql_real_escape_string() in a wrapper function db_escape_string()
to ease porting to other databases, and as another step to pulling more
of the database code into a central location.

This is a rebased version of a patch by elij submitted about half a year
ago.

Thanks-to: elij <elij.mx@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-24 17:57:54 +02:00
Lukas Fleischer
1e7b9d570d Use HTTPs for links in comment notification mails.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-19 23:58:32 +02:00
Lukas Fleischer
3aa2240b7d Fix XSS vulnerabilities in package comment templates.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 10:49:51 +02:00
Lukas Fleischer
7f9e498e48 Fix broken XHTML.
Fix a lot of invalid XHTML in the templates and actions. There might
still be some legacy code left, but this should cover most of it.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-11 19:00:50 +01:00
Lukas Fleischer
233f67b87e Do not overwrite package details when adding comments (fixes FS#22075).
Ensure that the "$row" variable isn't overwritten in
"web/template/pkg_comment_form.php" during sending mail notifications
when adding a comment.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-19 21:18:47 +01:00
Loui Chang
354c86b6c6 Move package comment form into a new template.
Feature the form on the package details page.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-25 13:17:54 -05:00