Commit Graph

378 Commits

Author SHA1 Message Date
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
Tim Almdal
29f29d2261 When the admin controller redirects to the reauthenticate controller, the value of request::is_ajax() from the original request is lost. This patch stores its value in the session so the reauthenticate controller knows whether its in a dialog/panel or not. 2010-07-31 15:44:56 -07:00
Tim Almdal
09dfe1a91b Convert the admin_theme controller to use the json::reply method 2010-07-31 15:44:55 -07:00
Tim Almdal
91a2c04a24 More patches as part of #1225. Change the 'core' modules to use the json::reply
method to set the content type header and encode the response as a json object
2010-07-31 15:44:55 -07:00
Bharat Mediratta
a8bb046209 Use readfile() instead of fopen()/fpassthru()/fclose() for brevity.
I've done some tests on a 60M flv and found that there's no difference
in memory consumption with these three approaches:

  public function test() {
    Kohana::close_buffers(false);
    $file = "/home/bharat/basketball.flv";
    if ($fd = fopen($file, "rb")) {
      while (true) {
        $bits = fread($fd, 65535);
        if (strlen($bits) == 0) {
          break;
        }
        print $bits;
        set_time_limit(30);
      }
      fclose($fd);
    }
    Kohana_Log::add("error","test: " . print_r(array(memory_get_peak_usage(true),memory_get_peak_usage(false)),1));
  }

  public function test2() {
    Kohana::close_buffers(false);
    $file = "/home/bharat/basketball.flv";
    $fd = fopen($file, "rb");
    fpassthru($fd);
    fclose($fd);
    Kohana_Log::add("error","test2: " . print_r(array(memory_get_peak_usage(true),memory_get_peak_usage(false)),1));
  }

  public function test3() {
    Kohana::close_buffers(false);
    $file = "/home/bharat/basketball.flv";
    readfile($file);
    Kohana_Log::add("error","test3: " . print_r(array(memory_get_peak_usage(true),memory_get_peak_usage(false)),1));
  }
2010-07-31 11:51:18 -07:00
Bharat Mediratta
6899af367b Cleanup on the Admin > Languages page.
Hide the fieldset and legend in the theme, since they don't add any value.
Change l10n_client::_server_url() to use the short style GMC urls and make the
API a little tighter.
2010-07-20 12:45:04 -07:00
Bharat Mediratta
583950616e Improve the fix for #1176 to use request::is_ajax() instead of tacking
on a query param to urls that appear in dialogs.  This keeps things simpler.
2010-07-16 11:58:13 -07:00
Tim Almdal
993e041274 Remove the code to call the controller directly and just use redirect. Now that all the form calls actually return the form as a json object, calling the form creation controller method i no longer required. 2010-07-15 14:57:43 -07:00
Tim Almdal
155d2b809b Rename g-in-dialog to the naming standard for query parameters and give it something more representative... 'gallery_dialog_request' 2010-07-15 14:54:45 -07:00
Bharat Mediratta
fe2881a22a Rename Flash_Uploader to just Uploader. Modules that want to replace
this will just replace the controller.  This makes overriding that
much easier in the future.
2010-07-15 12:37:44 -07:00
Bharat Mediratta
297f98fcee Fix reauth authentication to use the identity helper instead of the
user helper directly.  Else it doesn't work with LDAP and other
identity systems.
2010-07-13 12:52:59 -07:00
Tim Almdal
329abfe539 Merge branch 'master' into talmdal_dev 2010-07-11 09:09:52 -07:00
Bharat Mediratta
0389dceb47 Rotate all matching album covers when we rotate an item. Fixes ticket #1200. 2010-07-10 21:29:34 -07:00
Bharat Mediratta
b20f9123dc Wrap album deletes in a batch so that we can handle lots of cascading
deletes in bulk.  This lets us avoid the problem where we continually
choose and delete album covers which makes deletes really slow.  It
probably also avoids huge amounts of notification emails (untested).

Fixes ticket #1190.
2010-07-10 18:25:23 -07:00
Bharat Mediratta
7ca201b118 Pass along the from_id in item::get_delete_form() and then check to
see if we're deleting the album we're inside in quick::delete.  If we
delete the album we're currently viewing, redirect to the parent.

This fixes ticket #1185.
2010-07-10 12:00:06 -07:00
Romain LE DISEZ
39962eaddc Accept extension .m4v as video/mp4 2010-07-10 08:09:04 -07:00
Tim Almdal
213807a807 remove debugging statement 2010-07-09 14:59:23 -07:00
Tim Almdal
72f801df7d Only add the 'Successfully re-authenticated' message to the status if the admin page is not displayed in a dialog. 2010-07-08 08:23:08 -07:00
Tim Almdal
9538b3888d Fix for ticket #1176. Have the gallery.dialog code add a g-in-dialog parameter to the url to let the controller know its in a dialog. The reauthenticate controller will format the password prompt as a page or a form content. If authentication is successful, then the original controller is called instead of being redirected to. 2010-07-07 08:58:38 -07:00
Tim Almdal
dbf3199e46 Fix for ticket #1181. Use $.getJSON to retrieve the json contents of the dialog. Convert all the controllers
that create the data to go into a dialog to return the html as part of a json object.
2010-07-06 14:12:01 -07:00
Bharat Mediratta
df3af7d521 Merge branch 'master' of github.com:gallery/gallery3 2010-07-05 19:17:30 -07:00
Tim Almdal
226d1f7146 Revert "If the admin request originates as a dialog link, don't display the entire page when reauthenticating the administrator. Just put the form in the dialog."
This reverts commit 8493a3d36f.
2010-07-05 08:58:36 -07:00
Bharat Mediratta
0977c31009 Merge branch 'master' of github.com:gallery/gallery3 2010-07-05 08:47:40 -07:00