Commit Graph

22 Commits

Author SHA1 Message Date
Bharat Mediratta
48dc07dbc8 Revert "Fix for ticket #1118. Create a item::save_with_retries helper
method, which encapsulates saving an item and handling name and slug
conflicts. Call this instead of doing a save directly."

Rolled this back because it fails KISS.  We already have an API for
saving models with Item_Model::save() that's consistent with all of
our other model code.  Adding a new way to save items is confusing and
inconsistent.

This reverts commit 9504f71efc.
2010-06-15 17:17:25 -07:00
Tim Almdal
9504f71efc Fix for ticket #1118. Create a item::save_with_retries helper method, which encapsulates saving an item and handling name and slug conflicts. Call this instead of doing a save directly. 2010-06-15 14:18:23 -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
efdb73cb98 Make movie creation use model based validation. Move movie related
logic from movie::create() into Item_Model
2010-01-16 12:00:50 -08:00
Bharat Mediratta
bf085a1a17 Convert photo uploading over to the new model based validation
approach.

- Rearrange Simple_Uploader_Controller::add_photo() to validate
  the form early in the process, and switch to using model based
  validation.

- Move thumbnail generation into gallery_event::item_created() so
  that it's decoupled from the model.

- Delete photo::create() and move all of its logic into
  Item_Model::save().

- Add Item_Model::$data_file to track the data file associated
  with new movies and photos.

- Do some cleanup on the validation callbacks -- it turns out the
  2nd argument is the field name not the value.
2010-01-16 00:51:31 -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
Bharat Mediratta
82ee5f9d33 Make get_add_form private and use it non-statically. 2009-11-24 16:37:59 -08:00
Bharat Mediratta
5e9bbbe490 Convert the Simple Uploader form over to Forge, and use the event
model to let the Tags module modify it.  This brings it inline with
our other module-extensible form based interactions.
2009-11-20 19:41:45 -08:00
Tim Almdal
eb34b301a7 Add the ability to add tags for files that are uploaded using the simple loader. 2009-11-19 18:08:32 -08:00
Tim Almdal
421a975c0e Improve error handling. 2009-11-11 18:47:10 -08:00
Tim Almdal
9546e19e34 Pass two of uploadify... remove the default.css file, removed the folder option and create a status area where succesful uploads are listed. 2009-11-10 12:49:13 -08:00
Tim Almdal
d8beb6f530 First cut at replacing swfupload with uploadify. Probably need to review the css and remove extra swfupload selectors. Also changed the dialog so tags can be entered for all the files being uploaded. Probably need to add better start processing so the batch is started before the first image is loaded. Maybe add a module variable so the number of simultaneous uploads can be initiated (currently hard ocded to 10. 2009-11-09 13:54:55 -08:00
Andy Staudacher
e168e0dfae CSRF / auth fixes, golden data file checkpoint 2009-09-15 21:50:48 -07:00
Bharat Mediratta
a28dd09c4e Properly deal with invalid images. This fixes ticket #611 which shows
a BMP masquerading as a .jpg causing us to be unable to rebuild
resizes and thumbnails.  Now if that happens, we discard the file, log
it and move on.
2009-08-27 17:04:48 -07:00
Bharat Mediratta
d9f3e0bc0e Remove spurious blank line at the top of the file introduced in 09c9b1a755 2009-07-16 10:27:18 -07:00
Bharat Mediratta
4d0099e716 Fix a bug where we're referring to $photo when we just uploaded a
$movie, that causes the simpler uploader to throw an error for all
movies.
2009-07-11 06:24:10 -07:00
Tim Almdal
09c9b1a755 Added the upload::required validation in order to insure that failed uploads
are not treated as successful.
Log any exceptions to the Kohana log and return the error message
2009-07-10 11:35:28 -07:00
Bharat Mediratta
df84861833 If the argument to app() is not an album id, switch to the item parent.
Fixes ticket #489.
2009-06-29 20:23:23 -07:00
Bharat Mediratta
baea5e3a1b Add support for uploading .jpeg files (in addition to .jpg)
Fix for ticket #428
2009-06-16 20:10:25 -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
2925a1c797 Require "add" permission to show the add form. 2009-05-29 17:54:20 -07:00
Bharat Mediratta
28b41056e3 Restructure things so that the application is now just another module.
Kohana makes this type of transition fairly straightforward in that
all controllers/helpers/etc are still located in the cascading
filesystem without any extra effort, except that I've temporarily
added a hack to force modules/gallery into the module path.

Rename what's left of "core" to be "application" so that it conforms
more closely to the Kohana standard (basically, just
application/config/config.php which is the minimal thing that you need
in the application directory)

There's still considerable work left to be done here.
2009-05-27 15:07:27 -07:00