Commit Graph

400 Commits

Author SHA1 Message Date
Bharat Mediratta
70abfb2a20 Upgrade checking code is now here, along with a bump of the Gallery
module to v46.  There's a new block in the admin dashboard which
controls whether automatic checking happens, and lets you check
immediately.  If a newer version is detected, a site status message
appears for admins providing upgrade instructions.

Automatic checking is not yet implemented (even though the UI claims
that it exists).  This is all for #1605.
2011-01-16 22:16:09 -08:00
Bharat Mediratta
09d34696a1 Update comments to annotate what data is where during the process.
Follow-on for #1518.
2011-01-11 17:54:33 -08:00
Bharat Mediratta
e3df9c1611 Merge branch 'Ticket#1518' of git://github.com/Joe7/gallery3 2011-01-11 17:53:16 -08:00
Bharat Mediratta
ee53744aa7 Two improvements to Joe's fix for #1504:
1) Trap all exceptions, eg dns or connectivity issues and
   report back in the form (but put the stack trace in the logs)
2) Rename "noconn" to "no_connection"
2011-01-11 16:59:57 -08:00
Bharat Mediratta
f80b5959f1 Merge branch 'Ticket#1504' of git://github.com/Joe7/gallery3 2011-01-11 15:38:03 -08:00
Bharat Mediratta
252aba9eae Merge branch 'fix-viewable2_master' of git://github.com/BigMadWolf/gallery3 2011-01-11 15:17:05 -08:00
Joe7
049f2af1c9 Returning 2 flags from l10n_client::validate_api_key(), 1 to reflect if connection was built up properly (just a boolean, not distuingishing between reasons in case of a failure), the other to reflect API validating success status.
Using this presenting a slightly more meaningfull error msg to user in case the connection would fail.
Fixes Ticket #1504
2011-01-12 00:05:11 +01:00
Joe7
7f6d87166d Removed check as input value is compared against dataset of validated values, and request is only processed further in case of a match. => this is unnecessary 2011-01-11 23:16:05 +01:00
Bharat Mediratta
d557b2a63e Allow File_Proxy_Controller to run in private gallery mode since it
does all the right permission checks.  This prevents a hotlink to a
private photo in a private gallery from kicking the user out to a
login page.  Fixes #1594.
2011-01-10 14:50:30 -08:00
Jérémy Subtil
24c0b69847 Fixed item controllers so that any item position is computed correctly, when some other items belonging to the same parent album are not viewable.
Changed depracated calls to item_Model::get_position() to item::get_position().
2011-01-09 12:14:46 +01:00
Bharat Mediratta
d17ba036ee Don't enable the REST module by default (fixes #1585).
Bump the info module per changes for #662.
2011-01-07 20:44:45 -08:00
Joe7
9364f0d931 Allow '..' segment in photo/album paths through file_proxy (as is not forbidden in other places like add album/item) and explitely look for /../ instead
Note: directory path can't end in '.' forcibly so this shall be fine
Fixes Ticket #1518
2011-01-07 19:42:57 +01:00
Bharat Mediratta
4a88210825 Follow on to cfaa62370e to fix indentation.
Fixes #1569.
2011-01-03 11:41:25 -08:00
Joe7
cfaa62370e Reimplemented Kohana 2.3's View::set_global() with array support.
Allows for cleaner code and fewer function calls.
2011-01-03 11:38:13 -08:00
Joe7
336632fea0 Keep view counters of all item types accurate
Added common increment_view_count() func in item model for reuse
2011-01-03 11:01:02 -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
b5ba61fc53 Create a way for controllers to exempty themselves from maintenance
mode and private gallery mode by setting the following constants in
the controller to true.

  ALLOW_MAINTENANCE_MODE
  ALLOW_PRIVATE_GALLERY

Fixes #1411 and the subsequent refactoring fixes #1551 as well.
2010-12-23 23:34:04 -08:00
Bharat Mediratta
c5ede5881b Updated to use the new item::find_by_path() API. 2010-12-21 19:36:23 -08:00
Bharat Mediratta
cd48b89f31 Consolidate all the random code into a random helper that offers:
random::hash()
  random::string()
  random::percent()
  random::int()

So that we don't have lots of different ways to get random values all
over the code.  Follow-on to #1527.
2010-12-15 14:57:00 -08:00
Bharat Mediratta
45c63f4d11 Use mt_rand() instead of rand() since it provides better portability.
Fixes #1527.
2010-12-15 12:48:56 -08:00
Bharat Mediratta
f84782d620 Stop caching all module variables in the vars table using the
name=_cache row.  If that overflows, it will cause us to be unable to
load variables, and we can't recover from that.

Instead, use the Cache table.  Bump the gallery module to v40.  Fixes
ticket #1405.
2010-09-29 20:47:43 -07:00
Bharat Mediratta
fad1f05203 The Kohana folks removed the cache cleanup code back in
http://dev.kohanaframework.org/projects/kohana2/repository/revisions/4605

So now our cache entries don't expire.  For now, do cache expiration
whenever we render Admin > Maintenance, since that's the type of place
that users will go when they want their cache to expire anyway.
2010-09-18 17:46:28 -07:00
Bharat Mediratta
64dfccc4ed Preserve the image extension on the temp file that we create for
rotating images.  Some versions of GD won't work if we don't do this.
Fixes ticket #1375.
2010-09-16 20:04:22 -07:00
Bharat Mediratta
5e316f78c6 Restrict viewing user profile pages to registered users only, but
provide a "show_user_profiles_to" setting to allow admins to open it
up to everybody (choices there are "registered_users", "admin_users"
or "everybody").  Fixes ticket #1378.
2010-09-16 15:17:00 -07:00
Bharat Mediratta
67f45cfa78 Add CSRF protection to the upgrader. And update the CLI output so
that it tells you which modules failed to upgrade properly.  Fixes
ticket #1359.
2010-09-11 01:46:45 -07:00
Bharat Mediratta
5892712b23 If the user is not an admin, don't 403 -- instead just redirect them
to the root album.  Fixes ticket #1356.
2010-09-10 23:01:47 -07:00
Bharat Mediratta
cbb6967405 Detect out-of-date modules and put up a message for site admins.
Fixes ticket #1353.
2010-09-08 20:59:40 -07:00
Bharat Mediratta
391a90e3ce Detect when a module fails to upgrade properly and put up an
informative message to help the user know that she needs to get a
newer copy of the module.  Fixes ticket #1189.
2010-09-08 20:36:22 -07:00
Bharat Mediratta
c51b6ab38d Fix full size dimensions after rotating an image on the photo view page.
The photo view page caches the dimensions of the full size and then
renders it in Javascript.  But after rotation, those dimensions are no
longer valid.  Create a new function on the items controller that
returns the appropriate dimensions, then add a hook on
$.gallery_replace_image and implement the hook on the photo view page
to have it make an async call to get the new dimensions.

Fixes ticket #1317
2010-09-04 15:54:07 -07:00
Bharat Mediratta
511826a33c Don't show the "(## errors)" part of the status message if there haven't been any errors. 2010-09-02 01:10:15 -07:00
Bharat Mediratta
db769b76ab Expire completed uploads and introduce a text message that says how
many photos have been uploaded successfully.  This is to pave the way
for retry code later on.
2010-08-31 00:03:46 -07:00
Bharat Mediratta
bc0d5e79cb Revert "Change the theme option page to display using tabs if the site theme has an admin page."
This reverts commit d66c496fb1.

Conflicts:

	modules/gallery/helpers/theme.php
	modules/gallery/views/admin_theme_options.html.php
	themes/admin_wind/css/screen.css
2010-08-29 23:09:52 -07:00
Bharat Mediratta
4c8445852d Bump gallery module to v36 and add a favicon_url variable, which we
expose in Admin > Appearance > Theme Options and defaults to
lib/images/favicon.ico.

Thix fixes ticket #1312.
2010-08-29 16:27:32 -07:00
Bharat Mediratta
24b511b44a Move theme::get_edit_form_admin into admin_theme_options since that's
the only place where it's used and the theme helper is loaded on every
page view.
2010-08-29 16:03:09 -07:00
Bharat Mediratta
6a13a238bb Convert the "parents" variable from a result iterator to an array so
that the theme can call empty() on it.  Fixes #1318.
2010-08-29 11:45:27 -07:00
Bharat Mediratta
04add75f6f Get rid of the move dialog and move option. Instead, replace it with
a call to Organize with the appropriate album open.  I have not yet
figured out how to get the SWF code to highlight the active image, but
that's coming.  Partial fix for #1204.
2010-08-22 00:27:24 -07:00
Bharat Mediratta
ff1d8aea2f We use UTF-8 everywhere. Fixes ticket #1285. 2010-08-15 01:59:54 -07:00
Bharat Mediratta
524554c65b Send back the content length of files. This fixes streaming movies. Fixes ticket #974. 2010-08-11 21:02:57 -07:00
Bharat Mediratta
f0d8aef0ea "Content-type" --> "Content-Type". 2010-08-09 22:51:14 -07:00
Bharat Mediratta
0ff81c7ded The root album's edit form doesn't have a name field, so don't count
on it being there in update().  Fixes ticket #1281.
2010-08-09 15:18:25 -07:00
Tim Almdal
1ad1f9517f Fix for ticket #1279. In admin themes sanitize the theme name before checking that theme.info exists. 2010-08-08 17:29:22 -07:00
Bharat Mediratta
dfb095a262 Add the ability to replace the source data file in Item_Model::save().
Refactor the rotate code in Quick_Controller to replace the data file,
and then have gallery_event::item_updated_data_file() pick up after
the change is saved, rebuild the image and handle album covers.  This
is much more portable than before and it will allow any mechanism (eg:
REST) to replace the source image.
2010-08-07 22:18:28 -07:00
Bharat Mediratta
c6ca77377f Whitespace fix. 2010-08-07 18:02:39 -07:00
Bharat Mediratta
0fe44fe380 Use module::install and module::activate for the gallery module as
well; I've verified that it generates the same installer files.
2010-08-06 10:40:41 -07:00
Bharat Mediratta
3e8d683ce4 Use the login/html page for maintenance mode; we don't need the
maintenance controller/view anymore.  Fixes ticket #1267.
2010-08-01 22:09:02 -07:00
Bharat Mediratta
c33b24c9fa Make maintenance mode a variable instead of a config. Then create
links on the Admin > Maintenance page to allow you to turn it on and
off.  This should be efficient since we cache all vars and look them
up on every request anyway.

This also allows us to have the Fix task enable maintenance mode while
it's running which greatly reduces the chances that somebody will come
along and hork the database while we're tinkering with MPTT pointers.

Fixes ticket #1259.
2010-08-01 21:00:30 -07:00
Bharat Mediratta
49eb3e32b9 Make the continuation url go to admin/maintenance. 2010-08-01 20:49:14 -07:00
Bharat Mediratta
7607e1f932 Full pass over all the JSON encoding and JS dialog code. We now abide
by the following rules:

1) An initial dialog or panel load can take either HTML or JSON, but
   the mime type must accurately reflect its payload.

2) dialog form submits can handle a pure HTML response, but the mime
   type must also be correct.  This properly resolves the problem
   where the reauth code gets a JSON response first from the reauth
   code, and then an HTML response when you reauth and continue on to
   a given form -- try it out with Admin > Settings > Advanced.

3) All JSON replies must set the mime type correctly.  The json::reply
   convenience function does this for us.

4) By default, any HTML content sent back in the JSON response should be
   in the "html" field, no longer the "form" field.

The combination of these allows us to stop doing boilerplate code like
this in our controllers:

  // Print our view, JSON encoded
  json::reply(array("form" => (string) $view));

instead, controllers can just return HTML, eg:

  // Print our view
  print $view;

That's much more intuitive for developers.
2010-07-31 21:16:17 -07:00
Tim Almdal
a6280641f5 Resend the entire dialog content (including the wrapping view) instead of just the form. 2010-07-31 15:44:56 -07:00
Tim Almdal
0c535c85ed Missing the user name on the reauthenticate form. 2010-07-31 15:44:56 -07:00