Commit Graph
142 Commits
Author SHA1 Message Date
Bharat Mediratta f29aad03a6 Make some columns smaller so that multi-column keys don't exceed 1024
bytes on some systems.
2008-12-30 01:37:09 +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
Bharat Mediratta e6da2234e7 Relax the rules a bit 2008-12-29 03:51:53 +00:00
Felix Rabinovich 1d76689e4b Add title back to non-DHTML form to maintain consistency 2008-12-28 22:49:58 +00:00
Felix Rabinovich a26127ae9c Added title to user/group administration dialogs 2008-12-26 20:34:56 +00:00
Felix Rabinovich 6b1fa62173 Added content type to JSON output functions 2008-12-26 20:08:15 +00:00
Felix Rabinovich 6dcc3e5c25 User/Group administration cleanup 2008-12-26 06:14:24 +00:00
Felix Rabinovich 2917af5c0d Separate GET and POST in Group Administration 2008-12-26 05:45:09 +00:00
Felix Rabinovich 72c3a417ca Separate GET and POST in User Administration 2008-12-26 05:26:22 +00:00
Bharat Mediratta b5e1aa6a60 Login is 'info' not 'success' 2008-12-26 05:11:42 +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
Bharat Mediratta 324b612003 Oops, and also re-ajaxify the form if we replace it. 2008-12-25 21:40:05 +00:00
Bharat Mediratta ead45ffbc2 Reload the form if it's available so that we show form errors and we reset the form on success. 2008-12-25 21:39:22 +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 6e68c5ca28 added sprintf to strings for tranlation support 2008-12-25 02:59:45 +00:00
Bharat Mediratta 2c6a80fb76 Don't let the admin delete themselves, either. That would be bad. 2008-12-25 02:48:07 +00:00
Bharat Mediratta 95ec6a8f57 Only admins can delete users. 2008-12-25 02:47:17 +00:00
Bharat Mediratta 216ecf3079 Fix rules for editing users. 2008-12-25 02:42:48 +00:00
Bharat Mediratta f6ebb436e4 Rest_Controller -> REST_Controller everywhere, for consistency. 2008-12-25 02:38:53 +00:00
Felix Rabinovich 481352c382 User administration: 1. Add users; 2. Group administration; 3. General cleanup 2008-12-25 02:16:41 +00:00
Felix Rabinovich 7a82beb752 Adding user 2008-12-24 19:59:12 +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 b2c9a59d1b Tersify a log message 2008-12-24 04:10:00 +00:00
Bharat Mediratta 672eca5337 Lots of deltas rolled up into a bigger change. Sorry for the mess.
1) Deleted in-place-editing.  We'll be replacing this with a real edit
   system that groups settings together and is more coherent.

2) Tweaked the way that dialog boxes work to get the ajax stuff working
   again.  It's imperfect and does not work properly for uploading images.
   This is going to get redone also, but this is a good resting point.

3) Created edit forms for albums and photos.  Moved _update and _create out
   of Items_Controller and into the individual subclasses.

4) Created access::required which is a shorthand for:
    if (!access::can(...)) {
      access::forbidden();
    }

5) Added validation rules to Items_Model

6) Converted login to use the regular modal dialog approach in the theme.
2008-12-24 00:20:26 +00:00
Felix Rabinovich c76d730a7c Edit user - first draft 2008-12-23 21:44:35 +00:00
Chad Kieffer 69daaffb05 Fixed indents 2008-12-23 06:33:28 +00:00
Bharat Mediratta 47d068e4a8 Remove extraneous view, not necessary 2008-12-22 10:39:13 +00:00
Bharat Mediratta fe27bd1eb3 Change the way that we track modules.
Each module now has a "module.info" file that has information about
the module, including the core.  We can display the installed version,
and the version in the code.

Also take a first shot at a modules admin page.
2008-12-22 03:41:33 +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 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
Bharat Mediratta 5d2b1ae056 Don't try to validate the form unless it's a POST request. 2008-12-19 03:05:11 +00:00
Bharat Mediratta 0cf07fbeec Fix indentation. 2008-12-19 03:02:58 +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 c2598fe4d8 Dialog polishing. They now resize their height. Updated form styles in the context of dialog display (don't show legends, fieldset border, or submit button).
Let's make sure that all forms generated are complete and well formed and then use JS and CSS to control their display and behavior in different contexts.
2008-12-18 02:50:40 +00:00
Bharat Mediratta 093fb407a8 Fix a bug where setting the active user did not reset group_ids (unit tests ftw!) 2008-12-17 19:23:04 +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
Tim Almdal 363548bfc4 2008-12-16 20:40:29 +00:00