Commit Graph

44 Commits

Author SHA1 Message Date
Bharat Mediratta
068c44e201 access::allow/deny/reset functions will now throw an exception if you
don't pass in a Group_Model as the argument.  This prevents us from
setting permissions on the wrong group by accidentally passing in a
User_Model.
2009-03-10 20:34:32 +00:00
Tim Almdal
c04ff8e02f Change the pattern to identify tables that need prefix substitution to
mirror the drupal pattern of using braces {}.
2009-02-28 06:37:28 +00:00
Tim Almdal
bd15853708 This implements table prefix for all the queries in core, user, exif,
tag, search, comment and notification modules (Ticket #68)
2009-02-27 21:07:18 +00:00
Tim Almdal
0b055835fd Remove commented code
Correct unbalanced brackets
2009-02-27 02:50:07 +00:00
Tim Almdal
acdc724fc8 Continue the journey of replacing raw sql with ORM or Database method
calls (Ticket #68)
2009-02-27 00:34:50 +00:00
Andy Staudacher
c2eee47465 Move site default_locale into DB (vars) and add a per user locale preference.
There's no UI to select the locale yet.
2009-02-10 02:37:16 +00:00
Tim Almdal
f0aced6b75 Complete the Recover Password functionality (Ticket #5).
This change requires a reinstall in order to pick up the new hash
field in the user table.
2009-02-04 15:45:48 +00:00
Bharat Mediratta
f3ba69c1d6 Make sure that helper functions are all static. Add new
File_Structure_Test to make sure we don't regress.

According to the PHP docs, the "public" keyword is implied on static
functions, so remove it.  Also, require private static functions to
start with an _.

http://php.net/manual/en/language.oop5.visibility.php
2009-01-14 04:12:02 +00:00
Bharat Mediratta
a7feeb576f Big set of changes to comments, with related changes to akismet and
user modules.

* Don't delete vars when we delete a module.  This makes
  reinstalling a module a lot easier.

* Add user::lookup() as the preferred way to load a user, so that
  other modules don't delve into the user module (that'd be a
  problem when we swap out user modules)

* Notify site admins if Akismet is not fully configured

* Bundle all server variables into the comment so that if/when we
  re-check the comment, we are not using the server info from the
  site admin's request.

* Update Akismet to grab request context data from the comment

* Pre-seed comment fields if we have a logged in user.  Update
  comment::create() API to clarify it for this.

* Delete comment::update(), that's a controller function.

* Add url to User_Model

* Add author_name() author_email() and author_url() to
  Comment_Model.  It'll return the appropriate values depending
  on whether the comment was left by a logged in user or a guest.

* Use resetForm() instead of clearForm() when we reload the
  comment form after ajax submit, this way we preserve the
  pre-seeded values.

* In the user profile page, ignore blank passwords.
2009-01-10 00:34:23 +00:00
Bharat Mediratta
ad719b9b6f Fully implement the view_full permission. 2008-12-31 00:18:24 +00:00
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
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
b6363bcb03 Update to reflect changes in Kohana ORM relationship code.
Now you must call ORM::save() after ORM::add() and ORM::remove().
2008-12-15 20:49:05 +00:00
Bharat Mediratta
2cf3233f54 Get rid of all pseudo users and pseudo groups, while preserving all
other functionality.  This makes our user/group and access code
fully consistent.
2008-12-12 00:59:30 +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
91c4bda1ec Prototype access control model. There's much left to do, but it's a
working implementation.
2008-12-01 08:50:00 +00:00
Bharat Mediratta
e183901dc3 Give the admin user actual admin privileges 2008-11-27 11:43:11 +00:00
Bharat Mediratta
c95c17b133 Centralize logging around installing/uninstalling modules. 2008-11-27 09:45:26 +00:00
Bharat Mediratta
427dc7a0d1 Ignore errors from dropping view columns from the items table. 2008-11-26 09:34:31 +00:00
Bharat Mediratta
9c60566197 Add support for marking users as "admin" 2008-11-26 04:54:43 +00:00
Bharat Mediratta
226df2a8f8 Add support in the scaffolding for adding users to groups, adding and
removing users and groups.
2008-11-26 04:45:43 +00:00
Bharat Mediratta
5ccb050413 group::create() and group::delete() now manage the view_## columns in
the items table.

Convert installer over to using new creation API.
2008-11-26 04:13:57 +00:00
Bharat Mediratta
340a0d7117 Add a @todo to change user "joe" in the future. 2008-11-20 06:26:42 +00:00
Tim Almdal
8b6796fa5f Synchronize the model rules with the database definitions and vice-versa. 2008-11-18 00:38:36 +00:00
Felix Rabinovich
f27929e126 create a regular user and make scaffolding assign owner to logged in user 2008-11-16 05:46:42 +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
16828a4bc7 Delete the user from the session when uninstalling the user module 2008-11-15 09:08:59 +00:00
Tim Almdal
652cc48b77 change the display name to a varchar 2008-11-14 07:42:20 +00:00
Bharat Mediratta
0fe8d44472 Create module helper and refactor all the code that creates, updates
and deletes modules into it.
2008-11-13 10:38:28 +00:00
Tim Almdal
f62719ba61 Login is now working, but you can't logout 2008-11-13 04:56:12 +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
62bb63a70d New user module with password support. This supports the same password mechanism as g1 and g2 to facilitate a migration. 2008-11-11 04:57:49 +00:00
Tim Almdal
7bcf7efc09 Remove the complexity of a interface driven user management module 2008-11-10 21:29:30 +00:00
Tim Almdal
0a8d5edbdc Early look at the User/Auth module refactoring. It will look for a driver based on the contents of the user/config/user.php file. And load that driver based on the User_Driver interface. There is a default User_Gallery_Driver class that will provide the actual interface implementation. Replacing this driver will allow a completely different user and authentication implementation to be used... hopefully will reduce issues with embedding and other user management systems. Removed from unit tests so they will still run. 2008-11-10 20:17:09 +00:00
Bharat Mediratta
1ba012db0e Chain away temporary variables 2008-11-09 23:45:47 +00:00
Bharat Mediratta
418c0aab69 Create permanent owner_id column in the item table, and use a soft
relationship to bind the two.  To do this, I overrode __get in
Item_Model so that $item->owner returns the appropriate User_Model.
2008-11-08 07:48:36 +00:00
Felix Rabinovich
28b739a210 Adding user (owner) to items; info module 2008-11-08 07:18:56 +00:00
Bharat Mediratta
36d1be4717 44 --> E_DATABASE_ERROR 2008-11-08 05:12:37 +00:00
Tim Almdal
57683d5b70 Change how the modules table doesn't exist is caught. In running unit test, sometimes i would get the message "There was an SQL error: Table 'gallery3_unittest.modules' doesn't exist - ...." and sometimes I would get the message "Table modules does not exist in your database." In both cases the error code was 44. 2008-11-08 01:19:03 +00:00
Tim Almdal
134bac46d0 add installation unit tests and corrected a problem where the groups_users pivot table was not populated. 2008-11-05 22:10:35 +00:00
Tim Almdal
74cefadb19 actually delete the same tables as we createad 2008-11-05 20:42:15 +00:00
Tim Almdal
772239206b Rename logon_name to name, name to display_name and remove the external id field 2008-11-05 06:16:47 +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