Commit Graph

60 Commits

Author SHA1 Message Date
Bharat Mediratta
d5dbd1677f "Server Add" -> "Server add"
(Sentence capitalization)
2010-08-09 21:22:54 -07:00
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Chad Kieffer
03b4b27498 Add type attribute to rest of our script tags. 2009-10-30 00:14:57 -06:00
Tim Almdal
7ea13b3869 Normalize capitalization ticket #596 2009-10-28 12:15:52 -07:00
Tim Almdal
0a6b540092 Merge branch 'master' into talmdal_dev
Conflicts:
	modules/server_add/helpers/server_add_theme.php
2009-10-24 07:28:22 -07:00
Chad Kieffer
e3f90a889d Adjust order of items on server_add admin page. Restore autocomplete to the add form. Created a server_add.css file. 2009-10-23 22:24:06 -06: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
cf89015a29 Change the fix for ticket #775 to always add the Add menu, but not add any items if the album directory is not writable. 2009-09-19 09:34:27 -07:00
Tim Almdal
4e6f2f1b4c Don't display the add menu if the underlying operating system directory is not writable. THis should fix ticket #775 2009-09-18 23:53:48 -07:00
Andy Staudacher
ddb84c84e1 Rename mark_safe() to mark_clean() 2009-08-31 00:42:18 -07:00
Andy Staudacher
e7f5e0a9a3 Merge commit 'upstream/master'
Conflicts:

	modules/gallery/views/l10n_client.html.php
	modules/organize/views/organize_tree.html.php
	modules/server_add/helpers/server_add_event.php
2009-08-30 18:27:40 -07:00
Andy Staudacher
df38a890a6 Tabs to spaces cleanup 2009-08-30 18:07:13 -07:00
Andy Staudacher
effccfd41d Change all instances of SafeString::of_safe_html() to html::mark_safe() in views. 2009-08-30 07:00:56 -07:00
Bharat Mediratta
4bc7165dab Delete obsolete comment and tighten the code in site_menu(). 2009-08-29 16:42:33 -07:00
Andy Staudacher
b4b638be44 Undo url helper changes - url methods no longer return a SafeString.
Adding SafeString::of_safe_html() calls where urls are passed as parameters to t() and t2().
2009-08-29 16:28:30 -07:00
jhilden
746609b967 * created new generic "Add" dropdown in the site menu. this should take care of ticket #537
* removed start/stop translation menu items from the admin, since they are on the languags admin page now
2009-08-29 14:27:08 -04:00
Bharat Mediratta
4828db003f Remove 'ENGINE=InnoDB' specification from tables that we create. Use
the system's default table specification.  Fixes ticket #597.
2009-08-27 15:47:54 -07:00
Bharat Mediratta
1e90e40d3a Use events to generate menus, instead of having xxx_menu helpers.
This is the first step towards having a simple, lightweight and
unified API for module interaction.
2009-07-28 13:47:22 -07:00
Bharat Mediratta
dbeadc1407 Use the Kohana cascading filesystem to locate resources loaded by the
theme.  Because the theme comes first, this means that themes can
override any module resources, at the cost that we no longer have
namespacing for JS and CSS files.

The only file getting used outside of this model is
themes/default/screen.css which is used in the admin theme.  I fixed
that by copying screen.css into admin_default and renaming its
screen.css to admin_screen.css.  I also copied over all the images
that it was referencing.

Fixes tickets #48 and #539.

Theme API changes:
- theme_script(), theme_url() and theme_css() are no longer needed
- script(), url() and css() now refer to the first matching asset in
  the module load path, where gallery3/lib is at the end of the path
2009-07-22 14:27:57 -07:00
Bharat Mediratta
4720e45641 Don't use "else" clauses in upgrade() -- it prevents multiple version bumps at once. 2009-07-14 12:55:03 -07:00
Bharat Mediratta
22fcb4c776 Forgot to bump the version up to 3 2009-07-11 05:14:02 -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
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
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
Tim Almdal
42c82ef7f0 Temporary checkin to allow merge with trunk... don't integrate 2009-06-29 06:08:50 -07:00
Tim Almdal
5e83ebd6d0 Use $theme->script() method to render module javascript files 2009-06-28 16:50:55 -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
67c8108713 Convert the filename to a sensible title to match the way that the simple uploader works. 2009-06-12 02:13:12 -07:00
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
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
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
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
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
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
401c701369 Remove unnecessary slash from url::site() arg. 2009-03-16 07:07:40 +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