Commit Graph

60 Commits

Author SHA1 Message Date
Bharat Mediratta
53284ec5b8 Add support for Gallery 2.2.2 style bootstrap syntax. 2009-06-23 18:39:00 -07:00
Bharat Mediratta
2a190660ba Gracefully handle the case when the gallery2 instances moves somewhere
else (or gets deleted).

Fixes ticket #458
2009-06-23 17:09:37 -07:00
Bharat Mediratta
bfca0c7903 Refactor the install/upgrade code to be more flexible.
Add xxx_installer::upgrade($version) method so that upgrade stanzas
are separate from install stanzas.  In the old code, to do an upgrade
meant that you had to re-evolve everything from the initial install
because we'd step through each version's changes.  But what we really
want is for the initial install to start off in the perfect initial
state, and the upgrades to do the work behind the scenes.  So now the
install() function gets things set up properly the first time, and the
upgrade() function does any work to catch you up to the latest code.
See gallery_installer.php for a good example.
2009-06-23 12:00:49 -07:00
Bharat Mediratta
8383ea9827 Keywords in G2 are free form. So we don't know what our user used as a separator. Try to
be smart about it.  If we see a comma or a semicolon, expect the keywords to be separated
by that delimeter.  Otherwise, use space as the delimiter.

Fixes ticket #446
2009-06-20 16:55:09 -07:00
Bharat Mediratta
b72d0db7be More minor facelift for the admin/g2_import page. 2009-06-19 15:56:55 -07:00
Bharat Mediratta
feab9cfc34 Give the admin/g2_import page a facelift. 2009-06-19 13:47:38 -07:00
Bharat Mediratta
b999b35d24 Swap the order of two lines to make the debug output have the right data. 2009-06-19 10:30:59 -07:00
Bharat Mediratta
cdb02c10a4 Make an attempt to catch all situations where loading an item from G2
returns an error, and log them appropriately.  This should fix a slew
of import failures from corrupt G2 installs.
2009-06-18 12:24:33 -07:00
Bharat Mediratta
b8c68ce2f9 Don't try to require GalleryCommentHelper.class if the module is not
active, since the code may not even be present.  This assumes that if
the G2 comment module *is* active that the code is present, but that's
part of the assumption that the G2 we're importing from is healthy.

Fixes ticket #409
2009-06-15 19:59:46 -07:00
Bharat Mediratta
dc3ed06cd7 Trap gallery2 errors when we try to load an invalid user id and abort loading that user. 2009-06-14 12:43:06 -07:00
Bharat Mediratta
d95fcb189f Add a warning about eAccelerator interfering with g2_import. 2009-06-13 17:15:32 -07:00
Bharat Mediratta
e076433383 Support imports from multisite G2 installs. 2009-06-12 18:08:14 -07:00
Bharat Mediratta
6749a835e7 Work around different initialization code in earlier versions of Gallery 2. 2009-06-12 12:00:09 -07:00
Bharat Mediratta
0b23433d94 Rename theme_details to theme_options. These changes got left out of
68fd196d66 leaving us in a temporarily
broken state.
2009-06-11 12:50:50 -07:00
Bharat Mediratta
ae2fb806c7 Trap exceptions from movie::create() and mark those movies as corrupt. 2009-06-11 12:48:36 -07:00
Bharat Mediratta
c7aafef852 Improve error handling support for corrupt images and report them
appropriately in g2_import.
2009-06-07 17:48:42 -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
1a095fffe5 Prepend all code files we copy from Gallery2 and put into var with our
code preamble for security.

Update File_Structure_Test::code_files_start_with_preamble_test to
check all the php files in var, too.
2009-05-28 02:19:53 -07:00
Bharat Mediratta
6fdc84f5de Get rid of entire gallery2 session id param from the urls that we use to alert
users about images that failed to import.
2009-05-28 01:45:39 -07:00
Bharat Mediratta
3870892018 Commit an egregious hack to work around the fact that both Gallery 2
and Gallery 3 have a class named Gallery.  Clone a subset of the
Gallery 2 files and munge them so that we can rename the Galery 2
version to G2_Gallery.

Also, update the disclaimer in Admin > Settings > Gallery 2 Import.
2009-05-27 22:57:38 -07:00
Bharat Mediratta
88a3d43ba9 Update all references to the core application to now point to the
gallery module.  This type of mass update is prone to some small bugs.
2009-05-27 16:17:29 -07:00
Bharat Mediratta
7aed923908 Restructure the module lifecycle.
Install: <module>_installer::install() is called, any necessary tables
are created.

Activate: <module>_installer::activate() is called.  Module
controllers are routable, helpers are accessible, etc.  The module is
in use.

Deactivate: <module>_installer::deactivate() is called.  Module code
is not accessible or routable.  Module is *not* in use, but its tables
are still around.

Uninstall: <module>_installer::uninstall() is called.  Module is
completely removed from the database.

Admin > Modules will install and activate modules, but will only
deactivate (will NOT uninstall modules).
2009-05-26 05:28:59 +00:00
Bharat Mediratta
dc3df4d6ac Don't import non-viewable image types (eg: psd). Swap in a broken
image instead so that we at least have a target for comments.

Fixes ticket #294
2009-05-20 04:25:10 +00:00
Bharat Mediratta
170e9d6462 Import album highlights. Fixes ticket #221. 2009-05-19 07:31:21 +00:00
Bharat Mediratta
ad347c0456 If there's a missing source image during import, swap in our "broken
image" placeholder and keep on trucking.  Oh, and notify the admin.

Fixes ticket #287
2009-05-19 03:54:33 +00:00
Bharat Mediratta
17c58c8dce Skip over empty import modes. Fixes ticket #227 2009-05-17 00:46:53 +00:00
Bharat Mediratta
5495037a3d Gee it's May already. Update copyright to 2009. 2009-05-13 20:04:58 +00:00
Bharat Mediratta
93ca8e991d Gracefully handle duplicate groups. Fixes ticket #280 2009-05-12 22:34:59 +00:00
Bharat Mediratta
7c6276adb9 Deal with the user-entered g2 embed.php path a little more sanely so that if the user enters the path to G2 itself, we find the embed.php path from there. 2009-05-12 21:48:29 +00:00
Bharat Mediratta
b1ea27a1b9 Beautify the status text 2009-05-12 21:41:45 +00:00
Bharat Mediratta
df3a1e730e Skip the copy if the watermark module is enabled *and* there's a watermark. 2009-05-12 05:56:27 +00:00
Bharat Mediratta
fdb17d75ce Import keywords as tags.
Refactor the general flow of g2_import_task::import() to simplify it
and make it more sensible.  It had gotten a little overgrown.  It's
still a little overgrown, but I don't see an easy way to simplify it
from here.
2009-05-12 05:48:15 +00:00
Bharat Mediratta
8ae6a7a144 Import tags. 2009-05-12 04:04:26 +00:00
Bharat Mediratta
61ad68f1e6 Deal gracefully with the case that the Gallery 2 instance didn't have
any resizes (or thumbnails).

Fix a case where we were over-weighting the max dimension for square
resizes and thumbs.
2009-05-12 02:12:39 +00:00
Bharat Mediratta
a70cbed1d0 Import comments. This was a lot easier than I thought it would be 2009-05-11 20:16:54 +00:00
Bharat Mediratta
74b8937963 Framework for importing comments -- we don't actually do the import yet 2009-05-11 17:57:34 +00:00
Bharat Mediratta
62053b2c5c Add some comments 2009-05-11 16:38:58 +00:00
Bharat Mediratta
6ec24f2f00 Don't attempt to interact with comments if the Gallery2 comment module is not installed.
Resolves ticket #276
2009-05-11 16:27:52 +00:00
Bharat Mediratta
fbcb01caca Only run copy_matching_thumbnails_and_resizes() when we're doing an import, else it interferes with thumbnail/resize generation during regular imports 2009-05-10 21:46:58 +00:00
Bharat Mediratta
ce137d7bdc Change wording to avoid breaking File_Structure_Test 2009-05-10 18:52:08 +00:00
Bharat Mediratta
e6d3d42c22 Make the code that copies g2 derivatives more robust if the g2 data file doesn't exist. 2009-05-10 04:04:33 +00:00
Bharat Mediratta
0872cce1ea Fix a bug where when we copied over the g2 thumb or resize, we weren't
saving its dimensions to the item.

Also, import originationTimestamp as captured field.
2009-05-10 01:11:16 +00:00
Bharat Mediratta
a43c57bf61 Sigh.. fix it the *right* way. 2009-05-09 21:13:59 +00:00
Bharat Mediratta
8c611fdc1b Oops, add in a missing ] (thanks kb7sei!) 2009-05-09 21:11:55 +00:00
Bharat Mediratta
6b00aa70e0 Don't try to put g2_stats and g2_size into the view if g2 is not initialized. 2009-05-09 20:18:24 +00:00
Bharat Mediratta
1bfbae15f6 Usability and performance improvements
Significantly speed up the process by copying Gallery2 thumbnails and
resizes wherever possible instead of regenerating them.  This requires
us to figure out the dimensions of the original G2 derivative and make
sure that it matches in some reasonable way.

To allow users to take advantage of this, calculate the optimal thumb
and resize size to set in G3 to match what was used in G2.  While
we're at it, give the user some idea of how much data is available in
G2 to import.
2009-05-09 19:03:00 +00:00
Bharat Mediratta
db465072f5 Fix indentation. 2009-05-09 17:45:33 +00:00
Bharat Mediratta
934bc1e1f1 Add debug log strings with the G2 stack trace when there's a failure in a g2 call. 2009-05-07 00:46:35 +00:00
Bharat Mediratta
e83b980d3d Don't fail when trying to import site admin group. Resolves ticket #249 2009-05-06 04:08:45 +00:00
Bharat Mediratta
2846e0df8b Return an array from available_tasks() when unconfigured.
Fixes ticket #247.
2009-05-05 03:56:42 +00:00