Commit Graph

393 Commits

Author SHA1 Message Date
Bharat Mediratta
5ca17fd273 Allow server-side adding of images to other albums than the root 2008-12-19 00:48:45 +00:00
Bharat Mediratta
a74537ad59 Don't wrap hidden inputs in <li/> 2008-12-18 22:29:49 +00:00
Bharat Mediratta
c67234974d Refactor site admin menu into a theme function and build the menus in
the various modules.  In the process, rename xxx_menu::site_navigation() to just
xxx_menu::site().  And add xxx_menu::admin().

The menus are the same as before, but I changed the HTML to be
consistent with the way that we do it in the regular site, and this
broke the superfish styles.  I don't know how to fix this.. help me
Chad!
2008-12-18 07:32:34 +00:00
Chad Kieffer
aed68bfa9f I'm tired of clicking. Here are a few Selenium IDE tests. 2008-12-18 07:00:47 +00:00
Bharat Mediratta
b37047ff55 Add Item_Model::viewable() which we can use to restrict any query to
just items viewable by the active user.  Ie:

  ORM::factory("item")
    ->where("name", "foo")
    ->find_all()

Would get all items with the name "foo".

  ORM::factory("item")
    ->viewable()
    ->where("name", "foo")
    ->find_all()

Restricts it to just the set of items that the user is allowed to see.
2008-12-17 22:39:33 +00:00
Bharat Mediratta
9b6ccfc7f3 Fix some lint errors 2008-12-17 19:06:39 +00:00
Bharat Mediratta
26f0b4e44d Clear out module list in load_modules() before trying any db operations 2008-12-17 19:04:20 +00:00
Bharat Mediratta
fa5a8fde4a Switch from cookie sessions to database sessions. We can't use cookie
sessions; it encodes all the value into the cookie which means
little/no security, transfer costs, and storage limits.
2008-12-17 18:32:08 +00:00
Bharat Mediratta
130e26983a Add initialization to the user module to put the user and group_ids
into the session, for easy access.  This cuts down the number of
queries when we're loading images through file_proxy.php
2008-12-17 17:40:45 +00:00
Bharat Mediratta
78cd00312e Improve performance by finding the item without walking the tree.
Instead, use the level and the name to get a short list of candidates,
and check each one of those.  In most cases, this query should give us
the right result the first time.
2008-12-17 05:53:05 +00:00
Bharat Mediratta
8630d61051 Change the album thumbnail/resize from _album.jpg to .album.pjg
because the leading underscore confuses the Kohana router.
2008-12-17 04:55:49 +00:00
Bharat Mediratta
fc7b78492b Separate thumbnails out into var/thumbs. This clears up some ambiguity in Item_Model and simplifies
file_proxy.  It also means we can stop munging file names in the var/resizes hierarchy.

In the process, rename "thumbnail" to "thumb" everywhere in honor of
Chad (well, ok because it's shorter)..
2008-12-17 04:45:35 +00:00
Bharat Mediratta
f4c6a20149 Remove error checking; if this fails let it fail noisily for now so that we can find problems faster. 2008-12-16 23:59:33 +00:00
Bharat Mediratta
af32e5708d Remove all caching from ORM_MPTT. This was premature optimization: it
wasn't benefitting us, and it will get in the way when we want to add
implicit view protection to our queries.
2008-12-16 23:36:56 +00:00
Bharat Mediratta
8c7d0a76e5 Add file_proxy. This is controller gets triggered by .htaccess
protection on var/albums and var/resizes and only displays files to
the user if they have "view" permission on the base ite.
2008-12-16 23:07:33 +00:00
Tim Almdal
04441e11cc 1) Remove the load watermark from the scaffolding... use the menu option
2) The set watermark dialog is now sizing properly.  @todo is recenter in the window
2008-12-16 17:30:18 +00:00
Bharat Mediratta
e2544da5b0 Alphabetize field names to make it easier to find 'em. 2008-12-16 08:27:06 +00:00
Bharat Mediratta
3e219aab6b Change htaccess rules to use mod_rewrite 2008-12-16 08:17:00 +00:00
Bharat Mediratta
8bd7afeb5b TEST_MODE always exists now, so check its value, don't rely on its existence to know that we're in test mode. 2008-12-16 05:13:04 +00:00
Bharat Mediratta
83363172b1 Don't use model_cache for get_version and set_version; that breaks the installer. 2008-12-16 05:04:42 +00:00
Bharat Mediratta
3273984582 Use model_cache::get() to reduce duplicate queries 2008-12-16 04:56:51 +00:00
Bharat Mediratta
65a340efd8 Fix a bug where we were using module::set_var() instead of module::get_var() resulting in
loading all photos in an album on a single page and updating the var on every page load.
2008-12-16 04:52:16 +00:00
Bharat Mediratta
e82b08db20 Make the profiler output more legible by adding some padding to the table. 2008-12-16 04:45:52 +00:00
Bharat Mediratta
d9e02a5d0c Various optimizations:
o Add model_cache::get() which caches models avoiding duplicate lookups
o Stop using ORM relationships for Item_Model::owner so that we can use caching
o For Item_Model::xxx_edit fields, don't make them editable for guests
o Other minor stuff.

These optimizations reduce the number of queries for a 9-photos page from ~200
to ~45.  Still way too many!
2008-12-16 04:29:00 +00:00
Bharat Mediratta
dc08917345 Fix a bug where we were not deleting the .htaccess file on access::reset() 2008-12-16 02:31:13 +00:00
Bharat Mediratta
61618af0db Create and delete .htaccess files based on the view permissions for
the group::everybody() user.
2008-12-16 01:04:19 +00:00
Bharat Mediratta
898d001330 Fix capitalization. 2008-12-16 00:50:51 +00:00
Bharat Mediratta
eecf7bd518 phpdoc cleanup 2008-12-16 00:31:50 +00:00
Bharat Mediratta
3d2fc86604 Permission only function on albums. 2008-12-16 00:30:05 +00:00
Bharat Mediratta
2f8b4df0f5 Protect menus and blocks against the fact that we don't have an item
on tag pages.
2008-12-15 21:23:00 +00:00
Bharat Mediratta
b6363bcb03 Update to reflect changes in Kohana ORM relationship code.
Now you must call ORM::save() after ORM::add() and ORM::remove().
2008-12-15 20:49:05 +00:00
Tim Almdal
1d3e1484a7 The admin high level menu is shown if the active user is not a guest. Other sub menus depend on the appropriate level of access 2008-12-15 19:51:49 +00:00
Tim Almdal
b2107c3734 1) Move the deletion of the vars into module::delete helper
2) remove the watermark_add_form.html.php
2008-12-15 03:49:48 +00:00
Bharat Mediratta
2812f34732 Rename default_admin to admin_default. 2008-12-15 01:55:07 +00:00
Bharat Mediratta
1127257f63 Rename default_admin to admin_default. 2008-12-15 01:50:52 +00:00
Bharat Mediratta
20f6be62c8 Add Admin_View 2008-12-15 01:49:25 +00:00
Bharat Mediratta
c02d2554cf Refactor admin dashboard.
o Copy all the assets from default to default_admin so that they're
  totally separate
o Get rid of $item_theme
o Rename list_users.html.php to users.html.php
o use __call in admin controller to allow us to load any admin page
2008-12-15 01:48:34 +00:00
Bharat Mediratta
19e75b1e2e mark unauthorized exception w/ a @todo 2008-12-15 00:37:31 +00:00
Tim Almdal
db7e60da32 Change the watermark module to use forge.
Also the watermark file is now stored in varpath.
and the location is stored in the module vars table
2008-12-14 23:53:30 +00:00
Felix Rabinovich
c46bd97407 load admin subpages AJAXy way 2008-12-14 21:50:10 +00:00
Bharat Mediratta
b7487e384d convert single quotes to double quotes for consistency. 2008-12-14 21:39:56 +00:00
Tim Almdal
4b4e9e8e45 The start of the watermark module. It doesn't save the watermark at this point. This is more of trying out the approach where Forge is not used for forms. Basic html and the Validation library. 2008-12-14 19:43:04 +00:00
Felix Rabinovich
7fa014ae61 refactored admin views and added 'List User' 2008-12-14 07:59:24 +00:00
Felix Rabinovich
8b81731846 clean the links and require authorization before showing admin pages 2008-12-14 04:39:22 +00:00
Felix Rabinovich
cb92d1a70d 1. fix up the <link> and <script> elements in the dashboard <head>.
2. made the images work properly
2008-12-14 04:16:38 +00:00
Tim Almdal
fc1e7a9333 1) fix Forge_Group to display the label (will raise a bug with Kohana)
2) Change form.html.php to use the group label instead of the name
3) Converted the add photo to explicity set the label of the field (new coding standard)
2008-12-14 03:19:31 +00:00
Felix Rabinovich
34c9aa52b8 Fixed tabs and line endings 2008-12-14 02:45:07 +00:00
Felix Rabinovich
13ad40ab5c Created admin controller and made admin obey admin theme settings 2008-12-14 02:23:37 +00:00
Bharat Mediratta
af8c74f612 Fix a bug where parent permissions were not getting inherited to newly
created albums and photos.
2008-12-13 20:06:20 +00:00
Bharat Mediratta
8ba5ea3cf8 Make sure that access::can fails if the item is not loaded 2008-12-13 19:49:33 +00:00