Commit Graph

23 Commits

Author SHA1 Message Date
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
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
Andy Staudacher
b9bd1681a3 Update all code to use helper method html::clean(), html::purify(), ... instead of SafeString directly. 2009-08-29 22:54:20 -07:00
Andy Staudacher
c01ac42c46 Refactor all calls of p::clean() to SafeString::of() and p::purify() to SafeString::purify().
Removing any p::clean() calls for arguments to t() and t2() since their args are wrapped in a SafeString anyway.
2009-08-29 12:48:40 -07:00
Bharat Mediratta
80f48b084a In the logout link, urlencode the continue url so that ampersands, etc
don't break encapsulation.  In the logout controller, don't run the
url through url::redirect because that uses url::site().  Just set the
Location header directly.

This fixes ticket #483.
2009-07-21 13:02:20 -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
Tim Almdal
f0ea6d532c Create a new method in MY_url.php "get_item_from_uri" which loads the item
based on the uri.  Then use this helper method in logout.php to insure that
the guest user has access to the "continue" uri.  If they don't redirect to
the root album and let it deal with access issues.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-06-09 21:45:43 +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
5495037a3d Gee it's May already. Update copyright to 2009. 2009-05-13 20:04:58 +00:00
Andy Staudacher
e4a9b19bf9 Changing t() placeholder syntax from {{replace_me}} to %replace_me. 2009-01-15 10:02:41 +00:00
Andy Staudacher
a631fe29f3 i18n refactoring: Rename all _() (reserved by gettext) calls to t().
- And refactor printf to our string interpolation / pluralization syntax
- Also, a slight change to the translations_incomings table, using binary(16) instead of char(32) as message key.
2009-01-08 17:13:06 +00:00
Bharat Mediratta
2c91a7e9ce Rework log and message helpers to be parallel, but separate.
1) they now have their own matching severity constants
2) they both have convenience functions success(), info(), warning() and error()
3) they both have severity_class()
2008-12-25 23:43:44 +00:00
Bharat Mediratta
849b271a8c Add info/warning/error classes to log messages. 2008-12-21 10:35:30 +00:00
Bharat Mediratta
b3c05b1579 Move logging up to the controllers so that our logging can operate at a more meta level 2008-12-21 04:18:42 +00:00
Bharat Mediratta
f0b6333344 Add a logging facility, and instrument login/logout to use it. 2008-12-21 03:50:11 +00:00
Bharat Mediratta
8b6ed6c477 Create module::event() which runs Gallery events. It works by
convention.  To respond to the "photo_created" event in the gmaps
module, you create modules/gmaps/helpers/gmaps_event.php containing
class gmaps_event which has function photo_created.

Renamed all events from gallery.foo.bar to foo_bar
Updated tag module to use new convention.
2008-11-28 19:37:01 +00:00
Tim Almdal
828f23896f Rename item events and create events for comment create, login, logout, user creation. I probably forgot some, but its a start. 2008-11-28 00:51:38 +00:00
Bharat Mediratta
6fd7194544 Destroy the session on logout, don't just delete the user. 2008-11-15 21:47:21 +00:00
Bharat Mediratta
c152e5db5a Only remove the user from the session when logging out. 2008-11-15 09:05:21 +00:00
Bharat Mediratta
ae7839ffaa Revise the user login code.
* Remove user registration link and popup from the theme; this
  shouldn't be done in a popup. Use ajaxform to simplify the way
  that we load the login popup.

* Create form.html.php, this is a template for Forge based forms.

* Move user validation rules into User_Model and let forms
  populate the rules into their forms as useful.

* Undo r18688's changes regarding the REST code.  We should never
  accept a null resource, this breaks the REST abstraction.

* Change login and user controllers to use Forge which lets us delete
  login.html.php and user.html.php since those now are generated by
  the theme-owned form template
2008-11-15 06:23:09 +00:00
Bharat Mediratta
f0695f2030 Move logout to its own controller 2008-11-14 05:21:47 +00:00
Tim Almdal
6d7130bffc Progress is being made... you can now logout 2008-11-13 05:17:58 +00:00
Tim Almdal
1da2428183 More updates for user management. The controllers don't work yet. But the login link in the header wil open up a login box like the mockup 2008-11-12 03:40:49 +00:00