36 Commits

Author SHA1 Message Date
Brad Dutton
3ee59350a1 php 8.1 updates 2022-01-08 20:33:23 -08: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
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Kriss Andsten
10785b1e82 Extend comment module field lenghts to fit IPv6 remote host addresses and long (but legally so) hostnames. 2011-03-27 11:34:52 -07:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Bharat Mediratta
dff1a53696 All modules should be named Xxx_Core for extensibility. Fixes #1458. 2010-10-25 21:05:31 -07:00
Bharat Mediratta
1aeaa7daab Add REST support for comments. You can view, add, edit and delete
comments.
2010-06-16 18:05:15 -07:00
Bharat Mediratta
ad0e7254eb Require a well-formed email address for all comments. 2010-05-14 16:19:53 -07:00
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Bharat Mediratta
c050acf30a Fix lots of warnings that pop up when we're in E_STRICT mode. They're
mostly issues around uninitialized variables, calling non-static
functions in a static context, calling Session functions directly
instead of on its singleton, passing non-variables by reference, and
subclasses not using the same interface as the parent class.
2010-01-31 16:07:41 -08:00
Tim Almdal
c4e3604315 Strongly type the argument list to the model::validate method. 2010-01-29 14:04:27 -08:00
Bharat Mediratta
4b32a71afc Convert back to using ORM::factory(..., $id) instead of calling where(). 2010-01-27 22:34:11 -08:00
Bharat Mediratta
6dc88be6b6 Stop using MY_ORM::original(). 2010-01-20 22:50:47 -08:00
Bharat Mediratta
c863544ec3 Add validation for guest_email and guest_url. 2010-01-17 19:31:49 -08:00
Bharat Mediratta
3789b85b7d Move rules down into validate() and improve valid_author(). 2010-01-17 12:19:24 -08:00
Bharat Mediratta
1c85cf6397 Convert comment code over to model based validation. 2010-01-16 22:27:07 -08:00
Bharat Mediratta
dcf4b5e71a Don't pass MY_ORM::original() to update event handlers, since after
parent::save() it'll be reset.  Clone it first.

This is an alternate fix for #978.
2010-01-16 00:13:28 -08:00
Bharat Mediratta
2e420522ec Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add()
- Kohana::config_XXX -> Kohana_Config::instance()->XXX
- Implement View::set_global in MY_View
- Updated Cache_Database_Driver to latest APIs
- ORM::$loaded -> ORM::loaded()
- Updated item::viewable() to use K2.4 parenthesization
2009-11-25 13:22:24 -08:00
Tim Almdal
3c936d661a Change the name of identity library from Identity to IdentityProvider. Create a helper class called identity to simplify call the Identity Provider. Move the contents of MY_Session.php to the new helper class and remove the MY_Session class 2009-10-22 13:11:03 -07:00
Tim Almdal
00eacd659f Start simplifying the interface by moving the static methods from user.php and group.php. Tried creating a identity helper, but the helper identity.php was confused with the library Identity.php. So got around this by making the methods on Identity static and calling the instance within the static methods. Also temporarily moved the user.php and group.php back into the user module. 2009-10-16 08:53:31 -07:00
Tim Almdal
38b2efc44c Fix for 641... extend viewable functionality to comments. Viewable unit test is not working. 2009-08-29 11:43:10 -07:00
Bharat Mediratta
7ad0808a11 Change the API for getting to the original state of an ORM.
Old API:  $obj->original("field_name")
  New API:  $obj->original()->field_name

This allows us to revert the varous xxx_updated events back to passing
an original ORM as well as the the updated one.  This makes for a
cleaner event API.

  Old API:  comment_updated($comment) { $comment->original("field_name") }
  Old API:  comment_updated($old, $new) { $old->field_name }
2009-08-02 12:09:00 -07:00
Bharat Mediratta
2473418ea3 Show the author's username if the author has no fullname. Fixes ticket #601. 2009-07-29 17:35:56 -07:00
Bharat Mediratta
0f766b149d Second non-trivial change to the event code. We now publish model
related events from within the model handling code.  The only
exception to this currently is item_created which is challenging
because we have to save the item using ORM_MPTT::add_to_parent()
before the object itself is fully set up.  When we get that down to
one call to save() we can publish that event from within the model
also.
2009-07-16 12:31:40 -07:00
Tim Almdal
6f3ec5f039 Fix for ticket #357.
Changed the set the created date as part of the import and change
models/comment::save() to not set the creation date if it is already
set.
2009-07-01 22:18:52 -07:00
Bharat Mediratta
5495037a3d Gee it's May already. Update copyright to 2009. 2009-05-13 20:04:58 +00:00
Bharat Mediratta
44bfc1c6a4 Auto-delete 7-day old spam/deleted comments. 2009-01-10 11:25:33 +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
01dcbbcda5 Add very basic comment listing which shows the different queues
(approved, unapproved, spam).
2009-01-07 09:08:53 +00:00
Bharat Mediratta
17c8e14753 Properly check comment permissions. Don't show comments that aren't
published.  Fix _form_add to take an item id.  Oh and email address is
no longer required.
2009-01-07 08:18:15 +00:00
Tim Almdal
95f1440ef2 Changes to the comment module to support spam filtering. Basically added two columns to the comment table. The url of the author's web site(default null) and a flag to indicate that the comment is visible (default true).
The comment block has changed to only display comments that are visible.

And there is code added to call the spam_filter helper if the spam_filter module is installed.
2008-12-29 19:37:19 +00:00
Bharat Mediratta
4610fc8e7f Create Forge::add_rules_from() which pulls validation rules from the model and
associates them with the form.  This replaces the various _add_validation_rules()
functions in the user and comment modules.

Move user edit form into user helper for consistency with the comment module.

Implement missing _form method in the user controller.
2008-11-16 07:51:42 +00:00
Jozef Selesi
f9eaa8c220 Initial add comment implementation. 2008-11-15 16:52:23 +00:00
Jozef Selesi
aa437293e6 Fix line endings. 2008-11-09 23:34:03 +00:00
Jozef Selesi
434e56351e Install/uninstall support for the comment module. Missing from the previous commit. 2008-11-09 23:06:31 +00:00