26 Commits

Author SHA1 Message Date
Johan Cwiklinski
6746792bdf Drop short_tags 2018-05-19 17:01:37 +02:00
Bharat Mediratta
9e0631ab0d Provide a "default moderate" option for comments. The default behavior
is unchanged, but you now have the option to set all new comments to
be unpublished and then moderate them through the Admin > Content >
Comments interface.

Fixes #2126.
2014-05-28 14:54:02 -04:00
Tim Almdal
f943a2deef Don't show a link to the user profile for the guest user 2010-01-28 08:14:33 -08:00
Tim Almdal
ed5b07b335 Create a user profile page that is used as a landing page when referencing a user in messages or pages.
Partial fix for ticket #889 and a fix for #931.
2010-01-23 21:38:01 -08:00
Tim Almdal
4c3b9e363a Refactor the comment module as part of ticket: #917 "Remove Rest Controller"
* Remove the methods create, update, delete, get_edit_form as there are not used
* Change the return when a comment is created to return the html for the new comment.
  This saves a second get request to down load the comment.
2009-11-25 08:12:50 -08:00
Chad Kieffer
3e6ba7acc3 Renamed most, if not all css selectors from gName to g-name. Moved a few shared images from wind to lib. Deleted unused images in the admin_wind. This will likely break a few ajax features. 2009-10-04 00:27:22 -06:00
Andy Staudacher
2bc73e2e36 Fix XSS vectors in HTML attributes (mostly t() calls) 2009-08-31 21:51:57 -07:00
Andy Staudacher
b9bd1681a3 Update all code to use helper method html::clean(), html::purify(), ... instead of SafeString directly. 2009-08-29 22:54:20 -07:00
Andy Staudacher
c01ac42c46 Refactor all calls of p::clean() to SafeString::of() and p::purify() to SafeString::purify().
Removing any p::clean() calls for arguments to t() and t2() since their args are wrapped in a SafeString anyway.
2009-08-29 12:48:40 -07:00
Bharat Mediratta
41b8f943a6 Convert instances of theme_url() to just url() to match the API change
made in dbeadc1407
2009-07-23 10:20:49 -07:00
Tim Almdal
d6648c0aff Fix for ticket #477. Use nl2br method when rendering comment::text and
item::description.  In addition add p::clean or p::purify to places that
xss cleaning had missed (i.e. rss feeds)
2009-07-04 08:17:12 -07:00
Tim Almdal
54ffea2419 Split the clean method into two clean and purify. clean is a light weight
approach using html::specialchars and purify uses HTMLPurifier to intelligently
cleanse the output fields. Use purifier for text and title fields where it is
likely that a user would enter html to format their data.
2009-07-03 21:44:10 -07:00
Bharat Mediratta
6e8a8c53e6 Rename $theme->url() to $theme->theme_url() for consistency wiht
$theme->theme_script().
2009-06-28 19:49:48 -07:00
Bharat Mediratta
26314d0ef8 Create gallery::date_time(), gallery::date() and gallery::time()
functions that format a unix timestamp into a date+time/date/time
string.

Partial fix for ticket #347.
2009-06-12 22:44:51 -07:00
Bharat Mediratta
708f27f483 Run p::clean() on any variables that contain data entered by users. 2009-05-31 00:11:48 -07:00
Chad Kieffer
82848bd3a9 HTML format cleanup 2009-01-10 19:13:00 +00:00
Bharat Mediratta
9b90b4b0cd Use the theme's avatar as the default if Gravatar doesn't have one. 2009-01-10 06:18:35 +00:00
Bharat Mediratta
a5c4e3d465 Integrate Gravatar. Boy, that was easy. 2009-01-10 05:56:11 +00:00
Bharat Mediratta
a7feeb576f Big set of changes to comments, with related changes to akismet and
user modules.

* Don't delete vars when we delete a module.  This makes
  reinstalling a module a lot easier.

* Add user::lookup() as the preferred way to load a user, so that
  other modules don't delve into the user module (that'd be a
  problem when we swap out user modules)

* Notify site admins if Akismet is not fully configured

* Bundle all server variables into the comment so that if/when we
  re-check the comment, we are not using the server info from the
  site admin's request.

* Update Akismet to grab request context data from the comment

* Pre-seed comment fields if we have a logged in user.  Update
  comment::create() API to clarify it for this.

* Delete comment::update(), that's a controller function.

* Add url to User_Model

* Add author_name() author_email() and author_url() to
  Comment_Model.  It'll return the appropriate values depending
  on whether the comment was left by a logged in user or a guest.

* Use resetForm() instead of clearForm() when we reload the
  comment form after ajax submit, this way we preserve the
  pre-seeded values.

* In the user profile page, ignore blank passwords.
2009-01-10 00:34:23 +00:00
Bharat Mediratta
a0f3c09a07 Eliminate unused avatar code (for now) 2009-01-09 04:43:34 +00:00
Andy Staudacher
a631fe29f3 i18n refactoring: Rename all _() (reserved by gettext) calls to t().
- And refactor printf to our string interpolation / pluralization syntax
- Also, a slight change to the translations_incomings table, using binary(16) instead of char(32) as message key.
2009-01-08 17:13:06 +00:00
Chad Kieffer
bdff96bd54 Added a jump to comments button with a scroll to effect. 2009-01-03 19:09:32 +00:00
Bharat Mediratta
cd1d023754 Change the preamble for views in two ways:
1) drop unnecessary semicolon
2) start with <?php for extra security in the case that the server itself doesn't
   have short_tags enabled (the app won't work, but we need to make sure that we're
   still secure)
2009-01-01 00:23:29 +00:00
Bharat Mediratta
0bb82b7621 Gut the comment module and simplify it. Stop trying to support Atom
and XML for now, we have no driver for those technologies so anything
we implement is not going to be sufficiently tested and therefore
it'll be broken.

Change all comment functions to return JSON and update the JS to deal
purely with JSON.  This is our new protocol for talking to the browser
and it should be flexible and portable.

Create comments.html.php.  This duplicates comment.html.php, but will
be more efficient for rendering comments since we won't be creating a
new View for every comment we render.
2008-12-25 00:47:40 +00:00
Bharat Mediratta
81e87dfecd Change "datetime" to "created" to give some semantics to this field. 2008-12-21 01:29:25 +00:00
Bharat Mediratta
140736a1e4 Several large changes:
1) Changed the way that we get forms.  Now, if you want to get a form
   for a REST resource you prefix /form to the resource id.  So:
    /form/photo/1    : returns a form for editing photo id 1
    /form/comments/1 : returns a form for adding a comment to photo id 1
    /form/comment/1  : returns a form for editing comment id 1

2) Changed the comment module to have two controllers:
    comment:  deals with a single comment resource
    comments: deal with collections of comments attached to an item

Related stuff:
- Moved the comments js into the theme
- Reworked Comment_Helper for clarity
- Moved form generation code down into Comment_Helper
- Cleaned up routes (eliminating new comment ones added in recent rev)
- Added form() function to all REST controllers
- Changed comment module to use a block instead of an arbitrary helper call from the theme
- Comment controller only returns HTML currently, but returns a 201 Created status
  code when a new comment is added, which the Ajax code can catch and act upon.
- Got rid of a lot of extra views in comment module
2008-11-16 07:14:12 +00:00