40 Commits

Author SHA1 Message Date
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
ce209b9eaa Fix a typo leading to notification module not sending any text. Fixes #1862. 2012-05-15 16:10:49 -07:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Bharat Mediratta
b42fcb9cda Use db::expr instead of "new Database_Expression". Resolves #1560. 2010-12-28 23:10:05 -08:00
Bharat Mediratta
cc399bf4f0 Track the language of the user receiving the notification and send the
email in that user's language.  Incidentally, send one email per
recipient, else we're leaking email addresses which is bad for
community sites. Bump notification module to v2 in the process.

Fixes ticket #1287.
2010-09-06 16:20:37 -07:00
Bharat Mediratta
ff1d8aea2f We use UTF-8 everywhere. Fixes ticket #1285. 2010-08-15 01:59:54 -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
Tim Almdal
cc1d25ae0a remove debugging statement 2010-02-04 07:46:10 -08:00
Bharat Mediratta
9f03d36d6e Don't use MY_ORM::original() here since the values may not have
changed since the last save.  Instead, use the original ORM passed in.
2010-01-16 00:10:55 -08:00
Tim Almdal
639f1e741a Put quotes around the item titles in all the messages and more importantly actually display the original's title properly. Fixes ticket #966, but does now show us ticket #978 2010-01-12 11:42:31 -08:00
Bharat Mediratta
d0874a65ac Use:
->select(new Database_Expression("DISTINCT `email`"))

instead of:
  ->select("DISTINCT email")

This is not the perfect API.  http://dev.kohanaphp.com/issues/2396 is
the upstream tracking ticket for a better API.
2009-12-02 10:43:06 -08:00
Bharat Mediratta
96b00d6cfe Convert some more Database::instance() calls to db::build() form. 2009-11-26 21:14:54 -08:00
Bharat Mediratta
22823df220 Update ORM::where() calls to take 3 args. 2009-11-26 11:43:20 -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
b528fbde57 Change this files to use the API instead of referencing the group tables directly 2009-10-21 11:50:42 -07:00
Tim Almdal
78ee4193b7 Remove all non Identity API methods from Identity.php. Created an MY_Session class to provide the user state changes in the session and a login.php helper that has the login form. 2009-10-16 10:06:58 -07:00
Tim Almdal
bc241e44c2 Cleanup merge of user/group helpers into Identity interface. Reduce redundant code in the user module and remove references to the Identity helper from the user module as the user module should be able to access things directly. Simplify the get_user_list api method to just accept an array of ids to return user objects for. 2009-10-16 08:55:26 -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
1ee7d24766 Add support for the in filter to get_user_list and get_group_list. Convert the notifications to use user::get_user_list instead of accessing the table directly. 2009-10-09 01:27:26 -07:00
Bharat Mediratta
2ca20e8ab1 Check for subscribers *before* going through the process of creating
and rendering the email message.  Fixes ticket #724.
2009-09-08 21:19:00 -07:00
Bharat Mediratta
6dcfdb6432 Fix a bug in notification where were using get() instead of current()
to get the first item in an ORM result set.
2009-08-28 12:42:37 -07:00
Romain LE DISEZ
23bb6eb7e3 Rename columns that use reserved SQL words : items.left and items.right 2009-07-25 19:06:54 +02:00
Bharat Mediratta
5999ccb512 Remove extra error log line 2009-07-23 08:40:00 -07:00
Tim Almdal
427e1130b2 Modified the notification get_subscribers to ignore any users that don't
have "view" access to the item the notification is being generated for.
Fix for ticket: #538.
2009-07-22 11:11:48 -07:00
Bharat Mediratta
5b3b675b6d Non-trivial changes to the event handling code:
1) The item_updated event no longer takes the old and new items.
   Instead we overload ORM to track the original data and make
   that available via the item.  This will allow us to move event
   publishing down into the API methods which in turn will give us
   more stability since we won't require each controller to remember
   to do it.

2) ORM class now tracks the original values.  It doesn't track
   the original relationships (no need for that, yet)

3) Added new events:
     item_deleted
     group_deleted
     user_deleted
2009-07-16 11:19:34 -07:00
Bharat Mediratta
43abcd9386 Security pass over all controller code. Mostly adding CSRF checking
and verifying user permissions, but there are several above-the-bar
changes:

1) Server add is now only available to admins.  This is a hard
   requirement because we have to limit server access (eg:
   server_add::children) to a user subset and the current permission
   model doesn't include that.  Easiest fix is to restrict to admins.
   Got rid of the server_add permission.

2) We now know check permissions at every level, which means in
   controllers AND in helpers.  This "belt and suspenders" approach will
   give us defense in depth in case we overlook it in one area.

3) We now do CSRF checking in every controller method that changes the
   code, in addition to the Forge auto-check.  Again, defense in depth
   and it makes scanning the code for security much simpler.

4) Moved Simple_Uploader_Controller::convert_filename_to_title to
   item:convert_filename_to_title

5) Fixed a bug in sending notification emails.

6) Fixed the Organize code to verify that you only have access to your
   own tasks.  In general, added permission checks to organize which had
   pretty much no validation code.

I did my best to verify every feature that I touched.
2009-06-01 22:40:22 -07:00
Bharat Mediratta
5495037a3d Gee it's May already. Update copyright to 2009. 2009-05-13 20:04:58 +00:00
Bharat Mediratta
23b0abb974 Redefine the batch API to be very very simple. You call
batch::start() before starting a series of events, and batch::stop()
when you're done.

In batch mode, the notification module will store up pending
notifications.  When the batch job is complete, it'll send a single
digested email to each user for all of her notifications.

Updated the scaffold and local_import to use this.  Haven't modified
SimpleUploader yet.
2009-03-04 08:51:49 +00:00
Bharat Mediratta
b493a534f2 A variety of cleanups:
* Allow for the "movie" type in all of our text
* Try to follow the pattern of mainly only passing ORM objects
  to the view and let it generate its own text (this becomes
  even more important when 3rd parties want to customize notification
  messages)
* Rename _send_message to be _notify_subscribers to be more acccurate
  and have it explicitly take a subject in the API
* Use Item_Model::url() in the views instead of hand crafting URLs
* Reformat HTML in views
* Use $comment->author_xxx() functions instead of replicating that code
* Fix several places where we were encoding data by doing ucfirst($item->type)
  with conditionals where we form the text properly.  We should *never*
  be showing data types to the end user!  This is not localizable!

Note that this probably breaks the existing batch processing code.  I
am going to redo that in a subsequent pass.
2009-03-04 06:25:55 +00:00
Tim Almdal
81a6dc26cb Send 1 items added notification per batch of items 2009-03-04 03:31:01 +00:00
Bharat Mediratta
9f76d15086 Clean up translations to use t() properly and differentiate between
albums and photos.  We should not say the word "item" to users if we
can avoid it.
2009-02-10 03:42:25 +00:00
Bharat Mediratta
1b231063a0 Set default charset to utf8 2009-02-05 08:00:42 +00:00
Tim Almdal
ef58ac91e8 Notifications now send emails when a comment is published. It won't
send the email if the comment status is not published.  This gives the
administrator to moderate the comments prior to being published.
2009-02-02 15:41:47 +00:00
Andy Staudacher
60d3d6e704 code audit fixes + bug fix: don't call sendmail with an empty To list (in notifications module) 2009-02-02 07:32:45 +00:00
Tim Almdal
e3b5eca50e Add sending notifications when an item is deleted. We are almost
done, just need to do comments.
2009-02-02 05:00:09 +00:00
Tim Almdal
69a7e238a4 As we stagger towards completing the notification module.
Item changes and Item additions email notifications with this change.
Still to come is item deleted, comment added and comment updated.
2009-02-02 03:09:17 +00:00
Tim Almdal
6f35829173 Simplify the setting of a notifications. Notifications are not only
set on a album. The notifications are implicitly active for all child
elements.

It now sends emails if the email address of the subscribed user has
been set.  No email, no attempt to send the notification.

Still to do, come up with better messages as the current ones are just
place holders.
2009-02-01 03:58:31 +00:00
Tim Almdal
38cf6ca403 The start of the notification module. At this point, the icon has been added to the item menu in the sidebar (both photo and album). There is a corresponding icon in themes/default/images that needs to be spruced up. You can add and remove notifications to albums and photos, but nothing happens under the covers for event handling. 2009-01-30 20:52:25 +00:00