Commit Graph

47 Commits

Author SHA1 Message Date
Tim Almdal
57adefc5ba Revert "Create theme::get_var(), theme::set_var() methods to set the options of the active site theme. Change all refrences to theme options to use these methods. Update the version number of Gallery to 20 and move any them related options to the be stored under the active theme."
This reverts commit 26114972c3.
2009-11-19 11:44:01 -08:00
Tim Almdal
26114972c3 Create theme::get_var(), theme::set_var() methods to set the options of the active site theme. Change all refrences to theme options to use these methods. Update the version number of Gallery to 20 and move any them related options to the be stored under the active theme. 2009-11-18 15:36:13 -08:00
Bharat Mediratta
1067e68292 Redesign the way that we consider page types to create buckets of page
types, and a subtype for specifics.  Currently the top level bucket

   collection, item, other

Here are the core subtypes so far:

   collection: album, search, tag
   item: movie, photo
   other: login, reset, comment-fragment, comment

It's legal to create new page_subtypes whenever you want.  Use the
appropriate page_type to get the coarse grain behavior that you want.
2009-11-17 14:04:45 -08:00
Bharat Mediratta
081ce9f6ca Normalize pagination so that pager.html.php can handle pagination for
both albums and movies.  Kohana's paginator is not quite sufficient
for this, so create our own pagination logic in Theme_View with only
the stuff we need.

Clearly document the variables available in pager.html so that themers
know how to use it.

Fixes ticket #626.
2009-11-14 14:25:39 -08:00
Tim Almdal
59b5a05496 Rename the login helper to auth. Create a login and logout helper function to allow for programmically login in and out. 2009-10-30 09:32:18 -07:00
Tim Almdal
24bd8e4c28 Remove a redundant comment, change the name of the identity change event to 'identity_before_change' and change the name of 'login::get_login_form()' to 'login::get_form()' 2009-10-24 11:32:09 -07: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
4cb9ec1d6d Use the request::referrer to determine if we are editting the photo or album
from the context menu or from its photo or album page.
Fixes ticket #745.  Thanks to jankoprowski for the referrer approach.
2009-10-22 13:11:02 -07:00
Tim Almdal
51a69d7218 Merge branch 'master' into talmdal_dev 2009-10-22 07:40:50 -07:00
Tim Almdal
95f3eb3aad When an album or photo is updated always return the photo/album location as
part of the response.  This insures that if the internet address changes, then
the page will reload properly.
2009-10-22 07:37:14 -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
be6765336e Finish integrating the move of the user edit/update functions into the user module. The premise is that the plugable user module will provide the update screens if the user backend supports updates. 2009-10-16 08:53:30 -07:00
Tim Almdal
6f315ad89c Part of the previous commit, forgot to save... again 2009-10-08 06:35:38 -07:00
Tim Almdal
faee4391a3 Remove a commented line I forgot to take out 2009-09-23 07:12:17 -07:00
Tim Almdal
bec620487a Wrap the login form with a view in order to include a forgot password link. Fixes ticket #620 2009-09-22 09:48:24 -07:00
Bharat Mediratta
a6581ede0b Fix Item_Model::get_position() so that our sort is stable when the comparison
row has a null value in the sort field.  Fix for #627

Note: this changes get_position() to take an Item_Model instead of an id!
2009-09-21 11:35:27 -07:00
Bharat Mediratta
7fddd2aced Use abs_url() inside url::redirect() calls so that we don't just wind
up tacking onto the base url.
2009-09-10 21:31:50 -07:00
Bharat Mediratta
453fb76443 Actually use the slug when creating new albums (instead of just converting the
filename over).
2009-09-08 20:00:04 -07:00
Bharat Mediratta
2aad580f53 Move specialized (pretty) url generation back into Item_Model so that
we're not relying on overriding url::site() to do tricks around item
urls.  This means that you won't get item urls by doing
url::site("albums/37"), for example, but it also means that we won't
get pretty urls where we don't expect them (like in the action of a
<form> element).

Incidentally, this will help us move over to using the slug format
because if you've got a bad character in a url, the edit forms will
now work on it since they'll be id based.
2009-09-08 13:44:52 -07:00
Bharat Mediratta
78a42d9b83 1. Actually set the slug to the new value in the controllers.
2. Fix up an issue where we were crashing if there were no conflicting rows
3. Amend Item_Model so that if you change the slug, it flushes the cache
   for all children
2009-09-07 21:09:52 -07:00
Bharat Mediratta
f28353f4e1 Add the 'Internet Address' field to all items, along with proper
validation for the fields.
2009-09-07 21:01:51 -07:00
Bharat Mediratta
d007f31686 Undo rest of the indentation issue accidentally created in 8312eb and
partially fixed in 2c30dc
2009-09-02 21:29:22 -07:00
Tim Almdal
2c30dc2d5b fix a leading space that was causing the file_structure_test to fail 2009-09-02 14:28:00 -07:00
Bharat Mediratta
c887170555 Stay on the same page when editing albums/movies/photos. Fixes ticket 2009-08-31 21:10:22 -07:00
Andy Staudacher
8312eb116e XSS review fixes (mostly adding missing html::mark_clean()) calls. 2009-08-31 02:12:01 -07:00
Andy Staudacher
a2e2a2178b Using SafeString in album controller / view 2009-08-29 10:40:34 -07:00
Tim Almdal
f5c4d23e57 Convert the album add dialog to use the new Form_Script library
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-07-28 21:39:05 +08:00
Tim Almdal
a7f4d7aced Revert commit 078c77a62b and change the
tag_event:item_edit_form to use the new Form_Script library to inject
script into a form.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-07-28 21:00:25 +08:00
Tim Almdal
078c77a62b Add tag autocomplete to the album and photo edit pop up dialogs.
This required putting a wrapper view around the forms and passing
this view as the parameter to the item_edit_form event.  The view
contains a $script variable that the modules can add script to be
included in the form html when rendered as part of the ajax response.
2009-07-24 14:18:15 -07:00
Bharat Mediratta
60d6058880 Make some API changes simplify the tag editing code. We now have a
good pattern for allowing modules to add their own hooks to item forms!

1) Album, photo and movie forms now all use edit_item as the group and
   we publish item_edit_form and item_edit_form_completed events which
   makes it much easier in the module to handle all events.  They can
   still differentiate based on $item->type if they want to.

2) Added tag::clear_all() and tag::compact() functions which takes the
   place of hiwilson's tag::update() function and is now used in
   tag_event::item_delete().  This provides a simple API that allows
   us to have a lot less event handling code.  It's less efficient
   than what hiwilson was doing before in that it will delete and
   re-add tags, but if that ever turns out to be a performance issue
   we can do something about it then.
2009-07-20 08:51:12 -07:00
hiwilson
709d6c5faf (1)Add tag edit field in album/photo edit form. (2)provide edit functionality. (3)support multi-word tagging. 2009-07-20 08:02:07 -07:00
Bharat Mediratta
0f766b149d Second non-trivial change to the event code. We now publish model
related events from within the model handling code.  The only
exception to this currently is item_created which is challenging
because we have to save the item using ORM_MPTT::add_to_parent()
before the object itself is fully set up.  When we get that down to
one call to save() we can publish that event from within the model
also.
2009-07-16 12:31:40 -07:00
Bharat Mediratta
5b3b675b6d Non-trivial changes to the event handling code:
1) The item_updated event no longer takes the old and new items.
   Instead we overload ORM to track the original data and make
   that available via the item.  This will allow us to move event
   publishing down into the API methods which in turn will give us
   more stability since we won't require each controller to remember
   to do it.

2) ORM class now tracks the original values.  It doesn't track
   the original relationships (no need for that, yet)

3) Added new events:
     item_deleted
     group_deleted
     user_deleted
2009-07-16 11:19:34 -07:00
Bharat Mediratta
c4fce2cc68 Remove a completed @todo. 2009-07-15 20:32:53 -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
Bharat Mediratta
d5ee5741f2 Don't allow renaming of the root album. 2009-06-23 14:08:07 -07:00
Tim Almdal
1dccc0286f Change the page.html file so that if the type of page is login, the sidebar contents are are not shown 2009-06-16 22:09:02 -07:00
Bharat Mediratta
79582ee5bf Fix up the titles in the default theme. They've been broken for a
while.  This fixes ticket #342.

The bug is that we were using $item instead of $theme->item().  But we
were also not special casing tags properly, and they are effectively
first class citizens (at least for now) so treat them properly.  Also,
set page_title by default in the theme so that we don't have to do an
empty() check on it (makes the theme easier to read) and move the
title out of Tags_Controller so that the theme has more control over
it.
2009-06-15 18:15:41 -07:00
Bharat Mediratta
798444f40b Replace login_page.html.php with the form, wrapped in our default page
type.
2009-06-09 19:45:15 -07:00
Tim Almdal
b276eaa68b Add some window dressing to login_page.html in order to make it more in line
with the overall look of the Gallery3 theme

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-06-10 08:39:47 +08:00
Tim Almdal
a4a38ba760 Created not_authorized.html.php which is a prettier login screen if the root
album is not publicly browsable.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-06-10 08:39:45 +08:00
Tim Almdal
3c3a65b5a7 Rather than just displaying the "unformatted" login screen when the root album
is not viewable by a guest, display the root album as if it was empty. When
the page finishes loading force the login dialog to be displayed.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-06-09 22:22:57 +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
df51ea7fa4 Fix broken html::script() and url::file() references to the newly
moved gallery module.
2009-05-28 00:06:38 -07:00
Bharat Mediratta
88a3d43ba9 Update all references to the core application to now point to the
gallery module.  This type of mass update is prone to some small bugs.
2009-05-27 16:17:29 -07:00
Bharat Mediratta
28b41056e3 Restructure things so that the application is now just another module.
Kohana makes this type of transition fairly straightforward in that
all controllers/helpers/etc are still located in the cascading
filesystem without any extra effort, except that I've temporarily
added a hack to force modules/gallery into the module path.

Rename what's left of "core" to be "application" so that it conforms
more closely to the Kohana standard (basically, just
application/config/config.php which is the minimal thing that you need
in the application directory)

There's still considerable work left to be done here.
2009-05-27 15:07:27 -07:00