Commit Graph

3624 Commits

Author SHA1 Message Date
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
1145b846ba Fix a place where I shouldn't have renamed "core" to "gallery", breaking maintenance mode. 2009-06-01 21:07:24 -07:00
Bharat Mediratta
c31434ea3c Don't bomb if there are no exif_records for the given item. 2009-06-01 18:03:07 -07:00
Bharat Mediratta
c94c11eb3e Normalize the random values used in the blocks_dashboard_xxx vars so
that install.sql is more stable.
2009-06-01 00:22:30 -07:00
Bharat Mediratta
e4f4c8b2e8 Do a little cleanup and get rid of code left-over from when this
controller rendered HTML.  Also, catch all exceptions at the root
level and restore the change in
84ce0cdefd which appears to have gotten
lost in the shuffle.
2009-06-01 00:11:09 -07:00
Tim Almdal
3c24d94766 Merge branch 'master' of git@github.com:gallery/gallery3 2009-05-31 23:28:42 -07:00
Tim Almdal
463b3454ae Move the sql packaging code from installer into the gallery module. It must be run from the command line and will throw a 404 if it is run as a web request. 2009-05-31 23:28:27 -07:00
Bharat Mediratta
79a05adb9d Clear the site status message on deactivate, not on uninstall. 2009-05-31 22:33:28 -07:00
Bharat Mediratta
9a7e642cd6 Don't let relative_path() try to update the database if the Item_Model
is not loaded, else you get weird errors.
2009-05-31 22:30:48 -07:00
Bharat Mediratta
33df7de391 Accidentally broke the AllowOverride info url in the migration from
core -> modules/gallery.  Fixed, and incidentally make the link appear
in a new tab/window.
2009-05-31 22:25:53 -07:00
Bharat Mediratta
54ae9fac88 Remove extra blank line 2009-05-31 22:12:14 -07:00
Bharat Mediratta
b6c99a062b Merge branch 'master' of git@github.com:gallery/gallery3 2009-06-01 01:07:59 -04:00
bharat
297fb737ac Convert %7E to ~ when proxying files to work around Firefox's overzealous security model. 2009-06-01 01:07:05 -04:00
Bharat Mediratta
8ebd941c81 Properly call user::login when we automatically login the admin user
immediately after install.  Fixes ticket #323.
2009-05-31 21:48:43 -07:00
Bharat Mediratta
0ec3f1b830 Update for changes to admin_users_group.html.php 2009-05-31 19:32:13 -07:00
Bharat Mediratta
9322f51e23 Localize a string 2009-05-31 19:31:55 -07:00
jhilden
277c96c2f6 user admin facelift
* added drag & drop help message for empty groups
* fixed overflow issue with more than ~10 members in one group
* CSS improvements
2009-05-31 18:25:43 -04:00
Bharat Mediratta
181c97ef4b Relax the regex we use to extract the movie size so that it works with
the new version of ffmpeg that I have on my dev box (ffmpeg
0.5-svn17737+3:0.svn20090303-1)
2009-05-31 12:53:03 -07:00
Bharat Mediratta
f9a741782d Switch to using html::specialchars() for cleaning. 2009-05-31 12:33:10 -07:00
Bharat Mediratta
897ca2806d Updated for renamed variable 2009-05-31 01:22:48 -07:00
Bharat Mediratta
e30b45be07 Merge branch 'master' of git://github.com/gallery/gallery3 2009-05-31 01:15:11 -07:00
Bharat Mediratta
9a6f18075a Rename "text" to "title" for clarity. 2009-05-31 01:14:28 -07:00
Bharat Mediratta
af0031e029 Xss scanner golden file. Up to date. 2009-05-31 01:10:52 -07:00
Bharat Mediratta
712fdb5545 Clean up view variables 2009-05-31 01:03:24 -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
Tim Almdal
0a5ca7a766 Merge branch 'master' of git@github.com:gallery/gallery3 2009-05-31 00:28:51 -07:00
Bharat Mediratta
a049de28ac Update the clean/dirty format, check all ffiles instead of just one (which was for debugging) 2009-05-31 00:13:28 -07:00
Bharat Mediratta
708f27f483 Run p::clean() on any variables that contain data entered by users. 2009-05-31 00:11:48 -07:00
Bharat Mediratta
ad81861c33 First pass at an XSS security test, along with the "p" helper which
can clean HTML output.
2009-05-31 00:11:02 -07:00
Tim Almdal
45d58c8680 Remove the test images from the gallery module and move it to the developer module in -contrib 2009-05-31 00:10:04 -07:00
Chad Kieffer
8482f51e15 Add transparency for overlay in IE 7 and 8 2009-05-30 23:01:48 -06:00
Bharat Mediratta
a5670d8d70 gate $can_edit and $can_add on whether or not we have an $item at all
(fixes a bug where search doesn't render because it has no item).
2009-05-30 17:14:17 -07:00
Chad Kieffer
ef14f0faf5 White space fixes 2009-05-30 15:25:24 -06:00
tim almdal
f0104ee43b remove scaffolding code 2009-05-29 21:53:49 -07:00
Bharat Mediratta
ce285b8feb Use the relative_path_cache to look up items which should be a faster
query than using the level + the components.
2009-05-29 21:23:08 -07:00
Bharat Mediratta
cbec883d8a Don't show "edit permissions" for non-albums. 2009-05-29 20:59:34 -07:00
Bharat Mediratta
60d1bbc2d6 Move credits message into a variable, which can be changed in Admin >
Settings > Advanced.  It's stored in the variable as an
internationalized string and localized at output time.
2009-05-29 20:24:42 -07:00
Bharat Mediratta
2925a1c797 Require "add" permission to show the add form. 2009-05-29 17:54:20 -07:00
Bharat Mediratta
381dd0574a Don't show the add photo/album options to users who don't have the
permission.  This isn't a security hole, since they can't actually add
stuff.. but they can try and fail which is a bad user experience.

Also fix it up so that we show the option menu only if there's stuff
to show, and cache some of the permissions for performance (which I'm
guessing at-- didn't benchmark it).
2009-05-29 17:53:33 -07:00
Bharat Mediratta
055e0a7dc5 Remove a completed @todo 2009-05-29 17:42:31 -07:00
Bharat Mediratta
34da188e81 Revert test code inserted in 88a3d43ba9
which showed stack traces to non-admins.
2009-05-29 17:40:23 -07:00
Bharat Mediratta
b0cb3c7402 Update Kohana to r4374 2009-05-29 12:00:49 -07:00
Bharat Mediratta
356bac0db0 Restore calls to module::load_modules() after install/activate/deactivate/uninstall events. 2009-05-28 21:18:46 -07:00
Bharat Mediratta
c4c70c537d Tweak path slightly 2009-05-28 21:18:31 -07:00
Bharat Mediratta
73f348b29e Protect get() against missing records. 2009-05-28 21:07:47 -07:00
Bharat Mediratta
d088a41747 Load the gallery module in load_modules(), but put it at the end of
the module list (to match its location in the cascading filesystem)
2009-05-28 21:00:06 -07:00
Bharat Mediratta
20a2d9f9a8 Reset the cascading file path properly before reinstalling. 2009-05-28 20:59:23 -07:00
Bharat Mediratta
3da5ee2f4c Print out exception traces for most errors 2009-05-28 18:21:39 -07:00
Bharat Mediratta
7fd6fcaf9b Force modules/gallery to be at the end of the module load path, so
that all other modules can override the core code.
2009-05-28 17:46:17 -07:00
Bharat Mediratta
1a095fffe5 Prepend all code files we copy from Gallery2 and put into var with our
code preamble for security.

Update File_Structure_Test::code_files_start_with_preamble_test to
check all the php files in var, too.
2009-05-28 02:19:53 -07:00