Commit Graph

50 Commits

Author SHA1 Message Date
Bharat Mediratta
7e5a363ffc Only request the server_add js if the user is an admin 2009-06-04 12:21:51 -07: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
05d18da390 Guard against pages with no items. 2009-06-03 17:01:33 -07:00
Bharat Mediratta
bec2fdf7c4 Minor tweaks to the way that we turn the add photos item into a menu
to make it a little more robust.
2009-06-03 16:39:08 -07:00
jhilden
dde5fb96ee made "Add photos" its own site menu item
* open for suggestions on the submenu item labels
* @bharat: not sure about the add photos menu item id in the dropdown case
2009-06-02 19:31:11 -04:00
Bharat Mediratta
e834c4ca24 Have server_add turn the "Add Photo" menu option into a dropdown and
make "Add from Server" a 2nd option there.

This requires adding the Menu::remove() API function.
2009-06-02 15:46:05 -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
9369ccab7f Run all variables that come from user-entered data through p::clean() 2009-05-31 01:02:51 -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
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
Bharat Mediratta
b4bc0a29a5 Change comment style for brevity. 2009-05-02 19:14:31 +00:00
Bharat Mediratta
54fa2391d0 Whitespace cleanup. 2009-05-02 19:14:06 +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
49042345f6 Provide a translation of the titleon the fatal error dialog pop-up 2009-04-09 19:32:12 +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
093422bfbc Fix server add to correctly ignore a authorized path if there are no
files to be uploaded from it.
2009-04-09 17:33:17 +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
a4323c79ee Fix for ticket #207, which should then generate a whole bunch of
errors that are described in ticket #208.
2009-04-06 00:15:45 +00:00
Tim Almdal
d35a0cdb61 Fix for ticket #200. When an error occurs the current uri is no
longer admin/server_add but admin/server_add/add_path and the equality
check fails.
2009-04-03 15:40:41 +00:00
Bharat Mediratta
921f3a2eee Put csrf token into Admin_View and Theme_View by default, then use it
directly wherever possible instead of access::csrf_token().
2009-03-27 03:43:21 +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
Bharat Mediratta
0f5ccc9aa3 Switch from using SimpleUploader to using swfUpload as our flash based
uploader.  This is modeled on
http://codex.gallery2.org/Gallery3:Upload_UX but is not yet complete.

Notes:
* Changed #gProgressBar to .gProgressBar to support multiple progress
  bars on the same page
* Added a bunch of CSS to the "needs a home" section in
  themes/default/css/screen.css
2009-03-17 05:20:37 +00:00
Bharat Mediratta
ccc867f629 Get rid of $hidden; it was never defined 2009-03-16 09:11:30 +00:00
Bharat Mediratta
784adf835e clean up style attr 2009-03-16 07:16:54 +00:00
Bharat Mediratta
401c701369 Remove unnecessary slash from url::site() arg. 2009-03-16 07:07:40 +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
Bharat Mediratta
068c44e201 access::allow/deny/reset functions will now throw an exception if you
don't pass in a Group_Model as the argument.  This prevents us from
setting permissions on the wrong group by accidentally passing in a
User_Model.
2009-03-10 20:34:32 +00:00
Tim Almdal
5da29b8837 Fix for ticket #135 2009-03-09 16:03:48 +00:00
Bharat Mediratta
d93e216977 Don't clean out the authorized_paths var at install time, so that uninstall/reinstall doesn't mean starting over 2009-03-05 06:25:29 +00:00
Bharat Mediratta
05f22b47d8 Remove stray reference to server_add_dir_list.html.php 2009-03-05 02:29:02 +00:00
Bharat Mediratta
64b02026ed Cleanups.
- Show the "Server Add needs configuration" message whenever
  there are no paths.

- Un-ajaxify the admin code to remove complexity and allow us to
  update the status message as appropriate.

- Rename server_add_admin.html.php to admin_server_add.html.php
  for consistency.

- Fix up form to properly display error messages

- Get rid of server_add_dir_list.html.php now that we're
  non-ajaxified.

- Change delete <span> to an <a> for non-ajax world.
2009-03-05 02:26:39 +00:00
Bharat Mediratta
ca2ddb0170 Minor cleanups. 2009-03-05 01:40:18 +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
1fa05f1093 Clean up no authorized directoriesmessage 2009-03-05 00:50:11 +00:00
Tim Almdal
514e6658f6 Correct typo 2009-03-05 00:05:21 +00:00
Tim Almdal
2b9795ebf5 Remove addition options to the autocomplete call. No point in sending
csrf if we are not verifying it.  Remove the must match flag so
non-existent paths don't cause the input box to empty
2009-03-04 20:59:16 +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
8575e2b0d1 Continuation of the rename of jquery.autocomplete.pack.js 2009-03-04 19:50:08 +00:00
Tim Almdal
c0e65b2029 move server_add styles into the theme screen.css files 2009-03-04 16:36:41 +00:00
Tim Almdal
ef8c71417a Move the autocomplete js and css files to lib 2009-03-04 16:10:03 +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