Commit Graph

48 Commits

Author SHA1 Message Date
Tim Almdal
f5dd8d487e Move all the edit/update forms for users and groups back to the user module. 2009-10-15 08:56:31 -07:00
Tim Almdal
0d5d4c81bc Move the ui for user adminsitration back to the user module. 2009-10-14 21:20:30 -07:00
Tim Almdal
2af4806011 Refactor the ui component of the user module into the gallery core module. 2009-10-13 13:19:17 -07:00
Tim Almdal
00ee91837f Convert direct lookups for the user table using ORM to using the user::lookup_by_name and user_lookup API methods.
Convert the Admin_User controller
Convert the login and password change controller
Change the item model to call user::lookup to get the owner.
On the log model, delete the relationship between the log and user table, and replace with a
call to user::lookup
(cherry picked from commit 194cc3b27a)
Create the get_user_list, lookup_by_name, lookup_by_hash and get_group_list api functions
2009-10-09 01:26:35 -07:00
Andy Staudacher
e168e0dfae CSRF / auth fixes, golden data file checkpoint 2009-09-15 21:50:48 -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
67d4ae21d5 Clean up user form events. Thanks to Ben Smith (glooper). 2009-07-29 17:43:12 -07:00
Tim Almdal
00cd2b646d fix for ticket #574. The user->url database wasn't being set when the user was updated via the admin panel. 2009-07-25 15:00:57 -07:00
Bharat Mediratta
1fbdf1a1e0 Add form processing events:
user_add_form_admin            admin adding a user
 user_edit_form_admin           admin editing a user
 user_add_form_admin_completed  successfully added a user (admin)
 user_edit_form                 user editing their own settings
 user_edit_form_completed       successfully edited a user (admin and user editing own settings)
2009-07-23 10:35:52 -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
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
Chad Kieffer
916405bc4b White space fixes 2009-05-26 01:53:18 +00:00
Bharat Mediratta
5495037a3d Gee it's May already. Update copyright to 2009. 2009-05-13 20:04:58 +00:00
Bharat Mediratta
dcdc6f1e77 Don't allow admins to delete the guest user. Fixes ticket #213 2009-05-13 04:01:38 +00:00
Bharat Mediratta
9c24b5d94d Variety of changes to the way we do user editing:
1) Allow admins to edit the admin bit of other admins
2) Don't allow admins to delete themselves (partial fix for ticket #213)
3) Inline user::update().  Don't do form processing in helper methods!
4) Inline user::_get_edit_form() so that we can treat edit forms differently.
   Trying to hard to make common functions makes for weird edge cases.
2009-05-13 03:56:50 +00:00
Bharat Mediratta
cda6e54aa4 add_group() was not getting $form before using it. 2009-04-24 00:33:27 +00:00
Andy Staudacher
d558a88015 Fix for ticket 181: don't ignore the locale option when adding users 2009-04-09 02:41:29 +00:00
Tim Almdal
9ed0dd51bf Fix for ticket #201.
1) create common update function so processing consistent between the
user edit and admin edit.
2) created common private helper function to build the user edit form
the same way.
So a user can now change their user name if the new one doesn't exist.
2009-04-03 17:33:07 +00:00
Tim Almdal
3cb2c42e49 Fix for ticket #181. Valiant take note of the change to
admin_users.php.  I had to remove the check for the locale as it
hasn't been added to the form.
2009-03-25 16:21:36 +00:00
Andy Staudacher
62f3724acb Adding UI for site language selection and user language preference. 2009-02-10 05:37:42 +00:00
Tim Almdal
98bbf53657 Use the matches validation rule in order to perform cross field
validation between the password and password2 fields
2009-02-04 16:36:59 +00:00
Tim Almdal
eb56ee821f Add a confirmation password input field that must match the primary
password field in order for the update to succeed.  If there is no
data entered in the primary password field, the confirmation field is
ignored.

Addresses Trac Ticket #4
2009-02-03 00:17:40 +00:00
Bharat Mediratta
6091350c94 Fix lint errors 2009-01-29 03:23:46 +00:00
Bharat Mediratta
6bfadc14ed Fully implement the user administration backend with drag/drop to add
users to groups.
2009-01-28 22:42:50 +00:00
Bharat Mediratta
1a62a26a36 Add drag and drop support to the admin_users interface. This is still
a work in progress but it actually works mostly.
2009-01-28 09:50:15 +00:00
Jakob Hilden
1cc5d36657 toggling of user edit panel works now.
added groups to the admin_user view, so you will eventually be able to edit users, groups and memberships on one admin page.
2009-01-22 08:37: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
4ee24a6645 Put up an error if you rename a user to an already existing name. 2009-01-06 10:05:08 +00:00
Bharat Mediratta
6ab195854d Remove rest::JSON content type; it's causing lots of problems and it doesn't directly help since text/html works just as well for our JSON communications 2008-12-29 22:41:53 +00:00
Felix Rabinovich
6dcc3e5c25 User/Group administration cleanup 2008-12-26 06:14:24 +00:00
Felix Rabinovich
72c3a417ca Separate GET and POST in User Administration 2008-12-26 05:26:22 +00:00
Felix Rabinovich
c154f9f20a Group Administration 2008-12-26 04:35:27 +00:00
Felix Rabinovich
314d55d858 User Administration. Add users. Take 3 2008-12-26 03:47:04 +00:00
Felix Rabinovich
9a71309844 User Administration. Delete users. Take 3 2008-12-26 03:22:52 +00:00
Felix Rabinovich
7f95c80e88 User Administration. Edit users. Take 3 2008-12-26 00:58:15 +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
71d0373838 Return the form on success so that we clear out any prior error forms 2008-12-25 21:41:18 +00:00
Felix Rabinovich
82ed38d78e Ajaxify 'add users' 2008-12-25 20:59:33 +00:00
Felix Rabinovich
730d74c87a fixes in user edit and delete 2008-12-25 06:29:12 +00:00
Felix Rabinovich
3a22e0a2df fixed minor log:add typo 2008-12-25 06:11:07 +00:00
Bharat Mediratta
d4a5264925 get_add_form() -> add_add_form_admin() 2008-12-25 05:57:45 +00:00
Bharat Mediratta
fdc0f83024 Big round of normalization of the way that our controllers
communicate.  Almost all controllers now use JSON to speak to the
theme when we're dealing with form processing.  This means tht we only
send the form back and forth, but we use a JSON protocol to tell the
browser success/error status as well as the location of any newly
created resources, or where the browser should redirect the user.

Lots of small changes:
1) Admin -> Edit Profile is gone.  Instead I fixed the "Modify Profile" link
   in the top right corner to be a modal dialog

2) We use json_encode everywhere.  No more Atom/XML for now.  We can bring those
   back later, though.  For now there's a lot of code duplication but that'll be
   easy to clean up.

3) REST_Controller is no longer abstract.   All methods its subclasses should create
   throw exceptions, which means that subclasses don't have to implement stubs for
   those methods.

4) New pattern: helper method get_add_form calls take an Item_Model,
   not an id since we have to load the Item_Model in the controller
   anyway to check permissions.

5) User/Groups REST resources are separate from User/Group in the site
   admin.  They do different things, we should avoid confusing overlap.
2008-12-25 05:12:46 +00:00
Felix Rabinovich
481352c382 User administration: 1. Add users; 2. Group administration; 3. General cleanup 2008-12-25 02:16:41 +00:00
Bharat Mediratta
c7193f9b2e Normalize our Admin controllers so that functions always print out
their results, as opposed to having them return their view back
upstream.  This is a little more code in every controller, but it's
much less magical and more consistent.

Look up the active_theme and active_admin_theme inside the view
itself, no need to do that in the controllers.  This makes view
initialization easier in the controllers.
2008-12-24 04:22:22 +00:00
Bharat Mediratta
47d068e4a8 Remove extraneous view, not necessary 2008-12-22 10:39:13 +00:00
Bharat Mediratta
6564007a9d Implement admin user editing. It's still very rough. Trying to
figure out how to share forms between user and admin editing.

Incremental improvement
2008-12-19 22:16:10 +00:00
Bharat Mediratta
855a5928ce Create a new pattern for Site Admin controllers:
1) They must all start with "admin_".  This pattern is not directly
   routable.

2) Their urls must be /admin/xxx.

3) The Admin_Controller will take the xxx and look for Admin_Xxx_Controller
   and will delegate to that admin controller, after doing security checks.

Moved the users and dashboard views into individual modules for now.
2008-12-19 09:47:13 +00:00