Commit Graph

41 Commits

Author SHA1 Message Date
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
Tim Almdal
3c936d661a Change the name of identity library from Identity to IdentityProvider. Create a helper class called identity to simplify call the Identity Provider. Move the contents of MY_Session.php to the new helper class and remove the MY_Session class 2009-10-22 13:11:03 -07:00
Tim Almdal
78ee4193b7 Remove all non Identity API methods from Identity.php. Created an MY_Session class to provide the user state changes in the session and a login.php helper that has the login form. 2009-10-16 10:06:58 -07:00
Tim Almdal
00eacd659f Start simplifying the interface by moving the static methods from user.php and group.php. Tried creating a identity helper, but the helper identity.php was confused with the library Identity.php. So got around this by making the methods on Identity static and calling the instance within the static methods. Also temporarily moved the user.php and group.php back into the user module. 2009-10-16 08:53:31 -07:00
Tim Almdal
c7f8d8be6f Don't try to creat an album that corresponds to the staging directory. Just add the contents of the staging directlyinto the album that server_add was invoked from. Fixes ticket #785 2009-09-17 10:57:22 -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
b9a6cd45ba Skip empty files, since we know they're broken. Fixes ticket #610. 2009-08-04 20:35:13 -07:00
Shai Ben-Naphtali
5a0424f458 Fix some consistency in text.
This fixes ticket #546

Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-07-21 13:18:59 +08:00
Andy Staudacher
33d0b82d02 Fix l10n message inconsistency, ticket 546 2009-07-19 15:45:16 -07:00
Bharat Mediratta
954ab5a505 Further simplify server_add (and bump it to version 3).
Now we don't have checkboxes, but instead we restrict you to selecting
directories and albums from only one level in the hierarchy.  This
makes it easier for us to make sure that we properly create the
hierarchy that you want and avoid confusion about what's going to wind
up where.

Modify Server_Add_File_Model to have a parent_id and item_id and then
modify them as we go so that we can build up a tree structure there
*before* we create any items.  This makes it much easier to figure out
where a new item is going to go and get rid of a bunch of probably
buggy code in the main task.
2009-07-11 05:03:36 -07:00
Bharat Mediratta
b3785e1761 Remove debug code. 2009-07-10 08:04:37 -07:00
Bharat Mediratta
5cf267cc4c Fix a bug where we were not properly locating the parent album when
adding a new album or photo.

Simplify the data structure that we pass down to
server_add_tree.html.php so that we just pass a file list and let it
do whatever it wants with it.
2009-07-10 08:01:32 -07:00
Bharat Mediratta
6fbb1e2daf Avoid blowing the task data column by only adding directories to the queue instead of directories and files. 2009-07-09 14:03:07 -07:00
Bharat Mediratta
fad6c4783e Add status output to make it clearer what's happening when you add files. 2009-07-09 10:46:27 -07:00
Bharat Mediratta
faabae5dae Rework server_add. It's smaller and leaner now, storing the list of
files out in a separate model for scalability.  Removed the "pause"
functionality.

- Server_Add_Controller extends Admin_Controller so that we don't have
  to check for admin every time.
- Task completion time now factors in the time it takes to walk the
  arbitrarily deep trees
- Moved checkbox management entirely into JS using jQuery
- Simplified the JS considerably
2009-07-07 21:20:24 -07:00
Bharat Mediratta
eb5538d135 Merge branch 'master' of git@github.com:/gallery/gallery3
Conflicts:
	modules/server_add/controllers/admin_server_add.php
2009-07-02 18:00:22 -07:00
Bharat Mediratta
1a5fe42b55 Temporary version add() that just dumps out the values for now. 2009-07-02 17:54:48 -07:00
Bharat Mediratta
e5b6193b26 Partial pass of server_add cleanup. It's broken at this stage since
I've redone the browsing code but I have not implemented the adding
code.

1) Rename index() to browse() since index is too generic.
2) Simplify the data that we pass to _dialog and _tree
3) Change _tree to return list items only, so that the outer dialog
   can be a <ul> for consistency.
4) Simplify the data structures so that we're not tracking checked vs.
   unchecked status in the PHP code, it's all done in jquery where we
   can do it with just a line or two of JS
5) use glob() which pretty much entirely replaces _get_children
2009-07-02 11:23:40 -07:00
Bharat Mediratta
495c76f729 Eliminate temporary variables by passing the $item into the view and
making API calls on the item.
2009-07-02 05:11:03 -07:00
Bharat Mediratta
8f9a943f55 Fix a bunch of XSS vulnerabilities turned up by manual inspection
using the checklist in ticket #385.
2009-07-01 17:57:39 -07:00
Tim Almdal
b11ec14f24 Changed how directories are processed when the parent directory is selected and
the branch was never opened on the client.  This should fix some of the issues
with the server_add as I was able to select the staging directory and then add
over 400 images in a multi-tier structure.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-06-10 07:23:30 +08:00
Tim Almdal
e1ce3196f4 Rewrite the server_add to have the server format the selection when a branch is opened. Sub trees re only retrieved when the branch is opened. Changed the
start task processing to fill in any subtrees that are selected, but were never expanded on the client.  Added the loading icon.

Signed-off-by: Bharat Mediratta <bharat@menalto.com>
2009-06-05 03:13:14 +08: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
223669168b Change $view->action to a absolute url. 2009-05-21 04:05:37 +00:00
Bharat Mediratta
5495037a3d Gee it's May already. Update copyright to 2009. 2009-05-13 20:04:58 +00:00
Bharat Mediratta
c52a231bc0 Create a new "add" permission and require it at the controller level
when adding photos/movies/albums
2009-05-13 18:03:50 +00:00
Tim Almdal
e2d03c63fb Remove quotes and correct typo 2009-05-09 21:59:32 +00:00
Tim Almdal
48ee3d5fe8 Fix for ticket #217 2009-05-09 06:11:17 +00:00
Tim Almdal
7bd44b22e2 1) Change the processing so the server_add start task can return done = 1
if there are no eligible files selected
2) Change the javascript to handle this condition and show a pop up
2009-04-23 21:42:34 +00:00
Tim Almdal
91bc1292da Don't try to import the staging directory as an album 2009-04-09 19:39:26 +00:00
Tim Almdal
e692868e8a Create a pause method on the server_add controller and get rid of the
optional parameter/
2009-04-09 17:59:43 +00:00
Tim Almdal
523c467eed Fixes issues with Server Add:
1) Fixes Ticket #208
2) Fixes Ticket #190
3) Fixes an unticketed issue where two items could collide when
creating the thumbnail and/or resize. For example, loading a.flv and
a.jpg would have generated the same thumbnail image.  This change adds
a random value to the name to avoid conflicts.
4) Added item::__set() to clear the relative path if the name changes
2009-04-08 15:11:55 +00:00
Tim Almdal
ab787233d6 Fix for ticket #184. Sort the output children as DirectoryIterator
does not provide a sort order.  Separate the directory and files, sort
them individually and then merge them together so directories are at
the top of the list
2009-03-25 18:14:03 +00:00
Tim Almdal
414e58a427 Fix the problem I created by trying to run the task again after it was completed. 2009-03-24 18:03:32 +00:00
Tim Almdal
00ffb24eb0 Add a pause button to the server add dialog and if it is clicked then
the upload is paused.  If the dialog is closed and the task is not
complete then a warning message is displayed on the album.
2009-03-24 17:41:20 +00:00
Tim Almdal
8da729cfa1 Refine the task api but removing the optional parameters on the
task::create method call
2009-03-11 03:14:52 +00:00
Tim Almdal
5c82ce33a2 Refactor the server add module to make use of the task api (Ticket
#125).  Haven't quite figured out what to do with the errors in the
context. Maybe they should show on the mainenance screen?
2009-03-10 21:30:33 +00:00
Tim Almdal
46b752cbc7 Change how the urls are built in the java script 2009-03-05 01:22:27 +00:00
Tim Almdal
705e6d62b7 Last of changes required from Bharat's 2nd review pass 2009-03-04 20:09:53 +00:00
Tim Almdal
fbc650bddb Changed $uid to $tree_id, so not to confuse anyone between and acroynm
for unique identifier as opposed to user id. :-)
2009-03-04 16:01:18 +00:00
Tim Almdal
f7d82ec52f Rename local_import module to server_add 2009-03-04 15:46:10 +00:00