Commit Graph

60 Commits

Author SHA1 Message Date
Bharat Mediratta
6b89e7fa2a Add user::lookup_by_name() 2009-04-18 23:06:38 +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
Bharat Mediratta
8458eba279 Switch the locale::$locales data structure to be an array instead of a
stdClass because we're not allowed to asort() stdClass objects in PHP
5.2.6.
2009-03-16 09:08:12 +00:00
Bharat Mediratta
54e07d0769 Get rid of the extra robust code we had in here to make the
scaffolding work when the Gallery wasn't installed yet.  Now we force
users through the installer.
2009-03-16 08:05:07 +00:00
Bharat Mediratta
736d74d05f Clean up the login, maintenance login and required-top-level-login code.
We now have two clear and separate login approaches:
  login/ajax
  login/html

Choose the one that's appropriate.  Totally simplified the maintenance
page to be separate from the theme and dead simple, and use login/html
approach there.  Totally simplified the top level login
(login_page.html.php) to just be a login page, not the rest of the
chrome on the page and use the login/ajax approach there.

Don't use access::required in albums and then catch the exception,
instead use access::can and check the return code.

Improve the text for maintenance mode.
2009-03-16 04:33:45 +00:00
Bharat Mediratta
72c7fed975 Log the user in as admin after running the web installer, and give
them a nice "Welcome to Gallery 3" dialog.  The text in there needs a
little work but it's a start.

In the process, re-build the install.sql using the scaffolding code.
2009-03-08 21:21:09 +00:00
Andy Staudacher
237656f6c8 Differentiate between available and installed languages. Provide admin UI to install languages.
See: https://apps.sourceforge.net/trac/gallery/ticket/75 (first step for this task)
2009-02-19 08:48:14 +00:00
Bharat Mediratta
9ad072b33f Simplification pass that preserves almost all functionality (except
default_country) but removes a lot of the code.
2009-02-10 09:10:55 +00:00
Andy Staudacher
b2f20ff766 style fixes (style for method names, style for vars in locale.php) 2009-02-10 06:12:16 +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
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
Tim Almdal
a8233ed979 Undo the adding underscores to the id on forge generated forms 2009-01-25 06:28:04 +00:00
Tim Almdal
cbff78daa8 Supply a form id on all forms. This id can be used by modules other
than the originating module to provide additional functionality to the form.
2009-01-24 17:26:47 +00:00
Andy Staudacher
e4a9b19bf9 Changing t() placeholder syntax from {{replace_me}} to %replace_me. 2009-01-15 10:02:41 +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
ae73ef3d57 Updated for new Form_Submit API.
OLD:
  $form->submit("Foo")  -->  <input type="submit" value="Foo">

New:
  $form->submit("foo_button")->("Foo") --> <input type="submit" name="foo_button" value="Foo">

Mostly we don't care what the button is so we leave the name blank.
2009-01-12 07:50:04 +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
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
fa1ccbd86d Fix up all the various little forms to have submit buttons, fieldset legends, etc etc. 2009-01-06 09:22:29 +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
6dcc3e5c25 User/Group administration cleanup 2008-12-26 06:14:24 +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
730d74c87a fixes in user edit and delete 2008-12-25 06:29:12 +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
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
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
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
Bharat Mediratta
d9e02a5d0c Various optimizations:
o Add model_cache::get() which caches models avoiding duplicate lookups
o Stop using ORM relationships for Item_Model::owner so that we can use caching
o For Item_Model::xxx_edit fields, don't make them editable for guests
o Other minor stuff.

These optimizations reduce the number of queries for a 9-photos page from ~200
to ~45.  Still way too many!
2008-12-16 04:29:00 +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
8b3989b063 Add user::guest() convenience function 2008-12-12 06:54:13 +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
f69f3967ea move user::delete() to User_Model::delete() 2008-12-09 00:07:26 +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
8d4bd0c814 Update tests to reflect the fact that the admin group is gone.
Fix a bug in user::create(), found by the unit tests (hooray)!
2008-11-27 19:46:39 +00:00