Commit Graph

44 Commits

Author SHA1 Message Date
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Bharat Mediratta
7d98d4b7b9 Revert "Fix for ticket #491: Make user and group names translatable."
This reverts commit 4091219425.
2010-02-18 16:20:59 -08:00
Andy Staudacher
4091219425 Fix for ticket #491: Make user and group names translatable.
Also fixed a UI bug: No longer showing the edit user buttons to admins in the profile view (to be consistent with the requirements in the controller).
2010-02-14 19:26:34 -08:00
Bharat Mediratta
b351ee48fe Fix a bug in valid_password() where an empty password was considered valid. 2010-02-02 21:34:20 -08:00
Bharat Mediratta
6030d4eb65 Fix a bug in valid_name where it wasn't checking for name collisions on new users. 2010-02-01 21:20:05 -08:00
Bharat Mediratta
69897b4c66 Fix the valid_admin code -- it was considering all non-admins invalid.
Fixes ticket #997 (highest prime under 1000!)
2010-01-30 16:20:44 -08:00
Tim Almdal
c4e3604315 Strongly type the argument list to the model::validate method. 2010-01-29 14:04:27 -08:00
Bharat Mediratta
4b32a71afc Convert back to using ORM::factory(..., $id) instead of calling where(). 2010-01-27 22:34:11 -08:00
Bharat Mediratta
01dfa29888 Make some exceptions for guests:
1) They don't require email
2) Guest users aren't in the everybody group.
2010-01-25 20:40:44 -08:00
Bharat Mediratta
b0ff4418d2 Stop using MY_ORM::original() 2010-01-20 22:55:22 -08:00
Bharat Mediratta
9488684220 Move model rules down into their validate() function for consistency.
Change "in_use" error to "conflict" for consistency.
2010-01-17 12:30:24 -08:00
Bharat Mediratta
6a4dda9bde Convert Admin_Users_Controller, User_Model and Group_Model to use
model based validation.
2010-01-16 21:15:12 -08:00
Bharat Mediratta
a691dcc63c Convert Admin_Users::add_user() to use model based validation. Get
the rules and business logic out of the form and user::create(), and
move it into User_Model::save().
2010-01-16 19:58:55 -08:00
Bharat Mediratta
dcf4b5e71a Don't pass MY_ORM::original() to update event handlers, since after
parent::save() it'll be reset.  Clone it first.

This is an alternate fix for #978.
2010-01-16 00:13:28 -08:00
Bharat Mediratta
0736cf203b In Kohana 2.4, ORM no longer does the find_all() call for us when we
retrieve related ORMs.  If we tack a find_all() on the end, it breaks
the User_Definition interface so create User_Model::groups() and
Groups_Model::users() as glue.
2009-12-17 21:32:53 -08:00
Bharat Mediratta
2ee38b3d8e ORM::$rules now has a special meaning. Use $form_rules for our
internal rules code.
2009-11-26 11:36:09 -08:00
Bharat Mediratta
2e420522ec Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add()
- Kohana::config_XXX -> Kohana_Config::instance()->XXX
- Implement View::set_global in MY_View
- Updated Cache_Database_Driver to latest APIs
- ORM::$loaded -> ORM::loaded()
- Updated item::viewable() to use K2.4 parenthesization
2009-11-25 13:22:24 -08:00
Bharat Mediratta
d6695e83e2 Make email a required field. We're using the Kohana default error
messages when this fails, not the Gallery translation system so this
is not a great solution.  However, it's the same as the other
model-based rules we have currently so it's no worse.

Fixes ticket #897.
2009-11-21 11:17:38 -08:00
Tim Almdal
1d3651b329 Make the user name a required field. Fixes ticket #852 2009-10-28 17:13:23 -07:00
Tim Almdal
098b57bf18 Simplify the user interface by moving the password reset functionality into the user module
Bagging the User_Definition and Group_Definition abstract classes and replacing them with interfaces with the same names.
Make sure all the unit tests work.
2009-10-19 12:53:44 -07:00
Tim Almdal
bc241e44c2 Cleanup merge of user/group helpers into Identity interface. Reduce redundant code in the user module and remove references to the Identity helper from the user module as the user module should be able to access things directly. Simplify the get_user_list api method to just accept an array of ids to return user objects for. 2009-10-16 08:55:26 -07:00
Tim Almdal
c068384504 Encapsulate the user and group model in Gallery_User and Gallery_Group classes which extend the User_Definition and Group_Definition classes defined in the Identity API 2009-10-06 11:20:51 -07:00
Bharat Mediratta
5c25973ee8 Require a valid url for users. Fixes ticket #612. 2009-08-09 00:02:17 -07:00
Bharat Mediratta
7ad0808a11 Change the API for getting to the original state of an ORM.
Old API:  $obj->original("field_name")
  New API:  $obj->original()->field_name

This allows us to revert the varous xxx_updated events back to passing
an original ORM as well as the the updated one.  This makes for a
cleaner event API.

  Old API:  comment_updated($comment) { $comment->original("field_name") }
  Old API:  comment_updated($old, $new) { $old->field_name }
2009-08-02 12:09:00 -07:00
Bharat Mediratta
51dca582cd More thorough fix for #421. Create User_Model::display_name() which
uses the full name if there is one, or falls back to the name if
that's all we have.
2009-07-19 16:50:35 -07:00
Bharat Mediratta
0f766b149d Second non-trivial change to the event code. We now publish model
related events from within the model handling code.  The only
exception to this currently is item_created which is challenging
because we have to save the item using ORM_MPTT::add_to_parent()
before the object itself is fully set up.  When we get that down to
one call to save() we can publish that event from within the model
also.
2009-07-16 12:31:40 -07:00
Bharat Mediratta
5b3b675b6d Non-trivial changes to the event handling code:
1) The item_updated event no longer takes the old and new items.
   Instead we overload ORM to track the original data and make
   that available via the item.  This will allow us to move event
   publishing down into the API methods which in turn will give us
   more stability since we won't require each controller to remember
   to do it.

2) ORM class now tracks the original values.  It doesn't track
   the original relationships (no need for that, yet)

3) Added new events:
     item_deleted
     group_deleted
     user_deleted
2009-07-16 11:19:34 -07:00
Bharat Mediratta
5495037a3d Gee it's May already. Update copyright to 2009. 2009-05-13 20:04:58 +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
8c1d1a9d0d Provate a way to set the hashed password directly 2009-04-15 07:18:19 +00:00
Andy Staudacher
62f3724acb Adding UI for site language selection and user language preference. 2009-02-10 05:37:42 +00:00
Bharat Mediratta
9b90b4b0cd Use the theme's avatar as the default if Gravatar doesn't have one. 2009-01-10 06:18:35 +00:00
Bharat Mediratta
a5c4e3d465 Integrate Gravatar. Boy, that was easy. 2009-01-10 05:56:11 +00:00
Bharat Mediratta
e6da2234e7 Relax the rules a bit 2008-12-29 03:51:53 +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
e62103b8d9 Move code to delete users and add/remove users from groups into the
model.
2008-12-09 08:47:30 +00:00
Bharat Mediratta
f69f3967ea move user::delete() to User_Model::delete() 2008-12-09 00:07:26 +00:00
Tim Almdal
8b6796fa5f Synchronize the model rules with the database definitions and vice-versa. 2008-11-18 00:38:36 +00:00
Bharat Mediratta
4610fc8e7f Create Forge::add_rules_from() which pulls validation rules from the model and
associates them with the form.  This replaces the various _add_validation_rules()
functions in the user and comment modules.

Move user edit form into user helper for consistency with the comment module.

Implement missing _form method in the user controller.
2008-11-16 07:51:42 +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
71dc730986 Change quotes style 2008-11-14 05:09:07 +00:00
Tim Almdal
2019e9a931 Remove user_password class and move the functionality into the user helper class 2008-11-12 15:53:39 +00:00
Tim Almdal
f5d092b484 Correct some missing properties and change the user_model to have a set function so the password is hashed as part of the model 2008-11-11 20:02:43 +00:00
Tim Almdal
3c65b68e1c The start of the user module. At this point, it shows up on the scaffolding screen and you can install and uninstall it. Which creates the tables, defines 2 groups (adminstrator, registered) and one user (admin). 2008-11-05 05:32:47 +00:00