Commit Graph

25 Commits

Author SHA1 Message Date
Bharat Mediratta
d036e2fc49 Convert another Database::instance() query over to using db::build() 2009-11-26 13:18:10 -08:00
Bharat Mediratta
dd2bca0224 Modify the expiration code to work with db::build() 2009-11-26 12:54:07 -08:00
Bharat Mediratta
1fd0e14359 Convert all DB where() calls to take 3 arguments.
Convert all open_paren() calls to and_open() or or_open() as appropriate.
2009-11-26 12:09:04 -08:00
Bharat Mediratta
0121bfd585 ORM::orderby -> ORM::order_by 2009-11-25 19:26:52 -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
Andy Staudacher
b64729bfbe Fix ticket 890 (related to 879): Don't double-escape menu labels on the comment admin screen. 2009-11-15 19:46:12 -08:00
Bharat Mediratta
d12e3698e3 Call for_js() on all menu labels, since they're SafeStrings. Fixes ticket #879. 2009-11-13 09:29:00 -08: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
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
de812e1e82 Refactor to support pagination and simplify the code.
- Simplify the public controller methods
- Fix a bug where missing thumbnails would cause a divide by zero error
- actually pay attention to the page # for pagination and limit the query accordingly.
2009-05-11 20:15:24 +00:00
Tim Almdal
c04ff8e02f Change the pattern to identify tables that need prefix substitution to
mirror the drupal pattern of using braces {}.
2009-02-28 06:37:28 +00:00
Tim Almdal
bd15853708 This implements table prefix for all the queries in core, user, exif,
tag, search, comment and notification modules (Ticket #68)
2009-02-27 21:07:18 +00:00
Tim Almdal
89edd4d3ff Fix trac issue: #31 2009-02-02 15:36:43 +00:00
Bharat Mediratta
2920640c2b Fix validation when adding new comments.
Fire off the appropriate item_related_update events as appropriate.
2009-01-16 04:06:03 +00:00
Andy Staudacher
e4a9b19bf9 Changing t() placeholder syntax from {{replace_me}} to %replace_me. 2009-01-15 10:02:41 +00:00
Andy Staudacher
e53916dd06 Simplifying the way t() is called. Refactoring localization function t($message, $options=array()) into 2 separate functions:
- the new t($message, $options=array()) is for simple strings, optionally with placeholder interpolation.
- t2($singular, $plural, $count, $options=array()) is for plurals.
2009-01-15 09:30:15 +00:00
Bharat Mediratta
5bfde5ceb8 Rename 'xxx_changed' events to 'xxx_updated' 2009-01-15 02:53:13 +00:00
Bharat Mediratta
44bfc1c6a4 Auto-delete 7-day old spam/deleted comments. 2009-01-10 11:25:33 +00:00
Bharat Mediratta
74766e5b82 Create a 'recently deleted' queue 2009-01-10 11:11:24 +00:00
Bharat Mediratta
9d584a528b Update the queue counts in the menu list whenever we
approve/unapprove/spam a comment.
2009-01-10 07:55:16 +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
Bharat Mediratta
8bf388a6f6 Incremental improvement in comment moderation:
1) Akismet now detects when we change a comment's published state and submits
   info back to akismet.com as appropriate

2) We now show 4 different queues (all / approved / unapproved / spam) and let you
   move messages between the queues

3) We track and display "spam caught" stats.

4) You can delete comments entirely.
2009-01-08 02:50: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