Commit Graph

430 Commits (7988f875a9fa8c19548559b28c20c29482e0a86f)

Author SHA1 Message Date
Steven Wittens 51cf18e531 - #9292: Make Drupal (somewhat) PHP5 compatible. xtemplate is still horribly broken. 2004-08-22 17:03:42 +00:00
Dries Buytaert 94e30bf776 - Patch by JonBob: for consistency and readability, add brief descriptions of each source file inside the @file comment block at the head of the file. This helps with Doxygen indexing, and also allows neophytes to see what a file does immediately on opening the source, regardless of the organization of the hooks. 2004-08-21 06:42:38 +00:00
Steven Wittens 9cb5f7cdf8 Avatar/picture fixes:
- Changing theme('image') so the automatic image size fetching can be toggled independently from attributes. Specifying attributes and autosizing are 2 different things.
- Suppressing PHP errors from getimagesize() using @. drupal_set_message() is used to report these errors already and in a much prettier way.
- #9958: Fixing broken displaying of avatars.
- Don't show the default avatar in 'edit my account' if the user has no avatar of his/her own.
- Added ability to delete avatars (without having to replace them).
2004-08-20 04:35:33 +00:00
Steven Wittens 2436854a82 user.module - Fixing incorrect t() replacement string. 2004-08-20 00:41:56 +00:00
Dries Buytaert fa25c7a0ca - Code improvements by Stefan: use capital letters for header titles (and added some missing t() functions). 2004-08-19 15:41:57 +00:00
Dries Buytaert 83a739bd89 - Code improvements by Stefan: made all status messages consistent (and easier to translate). 2004-08-18 19:57:27 +00:00
Dries Buytaert 78b052a6af - The upload (filehandler) module has landed! 2004-08-17 21:35:26 +00:00
Dries Buytaert 2f33b939c5 - Patch #9983 by Stefan: usability improvement: made sure all status messages start with a capital letter. 2004-08-16 18:02:48 +00:00
Dries Buytaert ba70b534b8 - Removed the offline users feature. 2004-08-15 14:23:28 +00:00
Dries Buytaert 334f24b448 - Patch by James: made the blogapi work with DA.
* Refactored the "brains" of user_login() to user_authenticate($user, $pass) so that blogapi (and others) can authenticate users (including those using DistAuth) without all the html and drupal_goto calls
   * Updates blogapi_validate_user to use user_authenticate.
2004-08-14 07:00:27 +00:00
Dries Buytaert 84c8ba504f - Patch #9975 by TDobes: fixes two consistency problems with watchdog entries:
* Adds missing quotes around the username in "session closed" watchdog messages from user.module (session opened has quotes, but session closed does not).
   * Changed "view detals" after watchdog entries to "details".
2004-08-14 06:21:53 +00:00
Dries Buytaert 5a566c55ec - Patch #9974 by njivi: report the number of offline users.
I had some trouble adding this feature but realized that the "who's online" block is a geek think, and therefore it won't hurt to add some more geekiness.  If you don't know what "offline users" means, you would not have understood "online users" in the first place.  Either way, I think most people who have the block enabled, will find this an interesting addition.
2004-08-12 22:12:21 +00:00
Dries Buytaert 0f088b79ca - Patch #9983 by Stefan: various code style improvements. 2004-08-12 18:00:11 +00:00
Steven Wittens 89510864b6 Tiny code cleanup in user.module. 2004-08-08 23:19:47 +00:00
Steven Wittens ddb31aaf6b - #3606: Missing translations for user.module watchdog 2004-08-07 19:49:46 +00:00
Dries Buytaert 9bbdb71ee4 - Patch #9330: ucfirst() gives problem when used with multibyte charset.
Replaced the use of ucfirst() with a CSS-based solution.
2004-08-06 20:15:32 +00:00
Dries Buytaert 35cad55e5b - Patch #8523 by killes: avoid profile data being deleted when requesting a new
password.
2004-08-05 20:41:57 +00:00
Dries Buytaert c6b1eaa20d - Patch #9775 by TDobes: consistency operation. Changed to "edit foo," "delete foo," and "view foo" links into simply "edit," "delete," and "view". 2004-08-05 05:40:53 +00:00
Dries Buytaert b87b2abe65 - Patch #9768 by killes: admin/user/edit/$uid is no more, removed some left-overs. 2004-08-04 21:09:29 +00:00
Dries Buytaert c71bfded3d - Patch #9657: more intelligent theme() function. Hopefully, Adrian will be
able to use this patch too.
2004-08-04 20:40:01 +00:00
Dries Buytaert 202eee42a9 - Patch #9543 by JonBob: added node-level access control! 2004-07-31 09:30:09 +00:00
Dries Buytaert bd4f4ebbc3 - Patch #9547 by Eric: fixed avatar/picture upload bug. 2004-07-28 20:18:11 +00:00
Dries Buytaert 8aa052dc66 - Patch #9177 by James: fixed distributed authentication. 2004-07-15 17:20:15 +00:00
Steven Wittens 1c4cc2623e Removed the 'user' item in the menu which appeared when editing someone else's account. 2004-07-14 23:04:46 +00:00
Dries Buytaert ac5b5616c0 - More tab-improvements by JonBob: improved support for the default tabs! 2004-07-10 15:51:48 +00:00
Dries Buytaert 7059b64965 - Made the user module's administration form mark required form fields. 2004-07-08 15:11:05 +00:00
Dries Buytaert 9a56e93c3d - Patch #9125 by Morbus: remove access users permission. Will bring it back later. 2004-07-08 06:12:39 +00:00
Dries Buytaert 3568ed57e1 - Moving the title.module from core to contrib as discussed on the mailing list. 2004-07-07 20:18:22 +00:00
Dries Buytaert 9d35fe7a7d - Patch #4166 by daBrado: don't show the profile fields when the user does
not have the 'access users' permission set.
2004-07-06 17:27:33 +00:00
Dries Buytaert fe2b3e7c00 - Patch by Steven and me: refactored the form handling of nodes. The node system is now using form_set_error() and friends like the rest of Drupal does. This makes for both a consistent user experience and consistent code. It simplifies the forms and validation code, however, it does change the node API slightly:
* The _validate hook and the _nodeapi('validate') hook of the node API (1) no longer take an 'error' parameter and (2) should no longer return an error array. To set an error, call form_set_error().

    * The _form hook of the node module no longer takes a form hook and should not worry about displaying errors. Ditto for _nodeapi('form_post') and _nodeapi('form_pre').
2004-07-04 16:50:02 +00:00
Dries Buytaert e47c623e3d - Patch #9006 by Killes: For some reason there is a array_merge that nobody seems to need. It generates an error under php5. Found by redLED. 2004-07-03 07:07:33 +00:00
Dries Buytaert d279d16ccb - Patch #8996 by James: theme_user_picture() linked to bad url. 2004-07-02 18:13:45 +00:00
Dries Buytaert fcded380a8 - Patch #8937 by James: fixed typo. 2004-06-30 20:43:07 +00:00
Dries Buytaert 4f00182423 - Fixed typo reported by Steven Mansour: form_set_name() -> form_set_error() 2004-06-30 05:44:59 +00:00
Dries Buytaert fa192ae767 - Fixed bug with user information not being shown in the profile forms. 2004-06-28 08:32:16 +00:00
Dries Buytaert 2f393aaf31 - Fixed glitch in _user_categories(). Reported by Steven Mansour. 2004-06-28 08:09:30 +00:00
Dries Buytaert 47ef2e21de - Fixed 'pass by reference'-bug in the validation code and further simplified
it.
2004-06-28 07:23:53 +00:00
Dries Buytaert 7ebcac265a - Removed left-over instance of _user_profile(). 2004-06-27 19:41:55 +00:00
Dries Buytaert 1b1c47025a I refactored quite a bit of the user.module:
$ diffstat user.patch
database/database.mysql |    4
database/database.pgsql |    2
database/updates.inc    |   10 -
modules/block.module    |   20 +-
modules/locale.module   |    9
modules/profile.module  |  108 +++++++----
modules/system.module   |    8
modules/user.module     |  456 +++++++++++++++++++-----------------------------
8 files changed, 289 insertions(+), 328 deletions(-)

More functionality, less code.  Here is a list of the changes:

- Some user API changes:
   + When $type is 'form', you have to return an associative array of groups.  In turn, each group is an array with a 'title', 'data' and 'weight'.
   + A new $type has been added, namely 'categories'.  User settings can be organized in categories.  Categories can be sorted, as can the groups within a category.  (Ordering 'categories' is somewhat broken due to a bug in the menu system.)

- The 'my account > edit' page will use subtabs for each 'category'.  Read: you can break down the account settings into multiple subpages.

- Profile module improvements:
   + Added support for private fields to the profile module!
   + Improved workflow of profile administration pages.
   + Improved the form descriptions.

- Code improvements:
   + Unified user_edit() and user_admin_edit().
   + Unified and cleaned up the validation code.  Fixed some validation glitches too.
2004-06-27 19:10:52 +00:00
Dries Buytaert d4e7affba8 - Bugfix: made it possible for administrators to edit the values of custom
profile fields of users.
2004-06-24 22:12:36 +00:00
Dries Buytaert 3468310a61 - Patch #8778 by Morbus Iff: with the tabs patch, user/login, user/register, and user/password now show all three forms, as opposed to just the requested relevance. The attached patch implements a quick workaround: three new callbacks, and a cheapy modification of user_page where I use a ternary to test whether arg(2) exists (as it would in the case of user/nnn/edit). If it does, we set that to $op, and if it doesn't (in the case of user/login, etc.), we set arg(1). 2004-06-24 05:07:55 +00:00
Dries Buytaert ae6aa4e59e - Patch #8758 by Morbus Iff: allow users to modify their profile under
the new tabs system.
2004-06-23 05:11:35 +00:00
Dries Buytaert 0ee30cbca2 - Fixed broken URLs in the user module (access rules) due the the recent
tabs patch.
2004-06-22 20:21:13 +00:00
Dries Buytaert 090743bdba - Patch #8670 by asimmonds: more spelling fixes. 2004-06-21 20:05:37 +00:00
Dries Buytaert c2d7419f23 - Patch #8681 by stefan: fixed some broken URLs and help texts. 2004-06-20 19:49:14 +00:00
Dries Buytaert efed4cfc70 - Patch #8679 by asimmonds: fixed spelling mistakes. 2004-06-20 08:27:03 +00:00
Dries Buytaert 54b77d6435 Tabs patch!
CHANGES
-------

 + Introduced tabs. First, we extended the menu system to support tabs. Next, a tab was added for every link that was (1) an administrative action other than the implicit 'view' (2) relevant to that particular page only. This is illustrated by the fact that all tabs are verbs and that clicking a page's tab leads you to a subpage of that page.

 + Flattened the administration menu. The tabs helped simplify the navigation menu as I could separate 'actions' from 'navigation'. In addition, I removed the 'administer > configuration'-menu, renamed 'blocks' to 'sidebars' which I hope is a bit more descriptive, and made a couple more changes. Earlier, we already renamed 'taxonomy' to 'categorization' and we move 'statistics' under 'logs'.

 + Grouped settings. All settings have been grouped under 'administer > settings'.

TODO
----

 + Update core themes: only Xtemplate default supports tabs and even those look ugly.  Need help.

 + Update contributed modules.  The menu() hook changed drastically.  Updating your code adhere the new menu() function should be 90% of the work.  Moreover, ensure that your modue's admin links are still valid and that URLs to node get updated to the new scheme ('node/view/x' -> 'node/x').
2004-06-18 15:04:37 +00:00
Dries Buytaert 624ffd1510 - Patch #8444 by jhriggs: creating new users was broken due to recent changes. 2004-06-14 17:32:51 +00:00
Dries Buytaert fbbf510511 - Patch #8105 by mathias: made the menu system aware of path aliases. 2004-06-01 21:58:46 +00:00
Kjartan Mannes fd4d894340 - Make sure the form has been submitted before validating and saving user. 2004-05-31 17:27:12 +00:00
Dries Buytaert 7f08110a5e - Improved form handling.
+ Introduced two new functions:
      1. form_set_error($name, $message): files an error against the form
         element with the specified  $name.
      2. form_has_errors(): returns true if errors has been filed against
         form elements.

  + Updated the form handling:
       1. The form_ functions will add 'class="error"' when a form field
          has been found to be erroneous.
       2. The error message is passed to theme_form_element() when the
          particular form field has been found to be erroneous.

  + I updated the user and profile module to take advantage of these new
    functions.

  + IMPORTANT: the _user() hook changed.  The 'validate' case should no
    longer retun an error message when something goes wrong but should
    set it with form_set_error().
2004-05-31 09:40:56 +00:00
Dries Buytaert 750043b860 - Fixed bug introduced by previous patch. 2004-05-24 19:17:19 +00:00
Dries Buytaert 67675b498c - More code improvements by JonBob. 2004-05-24 18:37:50 +00:00
Dries Buytaert 35acfc1849 - Patch #7723 by Roderik: added strtolower()s to make PostgreSQL behave like MySQL and to be more 'forgiving' for users logging in on a PostgreSQL powered Drupal site. 2004-05-21 18:07:23 +00:00
Dries Buytaert fdb1fbfced - Simplified the 'anonymous poster settings' of the comment module and
made it possible to enforce a username/e-mail address.  Based on
  James Seng's work there are now 3 radio buttons:

   ( ) Anonymous users may not enter contact information
   ( ) Anonymous users may leave contact information
   ( ) Anonymous users must leave contact information

- Fixed a bug in the default theme_comment_view() function.

- Added permalinks for comments.  Requested by Michael and Christina.
  Maintainers of contributed themes might want to add permalinks too.

TODO:

- Fix the interaction design of the submission form: the page you are
  directed to and the validation of the contact information.

- Changing the comment viewing options appears to be broken?
2004-05-20 10:23:52 +00:00
Dries Buytaert d0090e69e6 - Patch #7614 by jhriggs: fixed some role related problems. 2004-05-19 14:55:19 +00:00
Dries Buytaert fed7e664de - Patch #6682 by jhriggs: added form_checkboxes(), much like form_radios()
and updated some modules to take advantage of it.
2004-05-15 15:42:47 +00:00
Dries Buytaert 0d7426a13d - Patch #7704 by mathias: fixed warning due to initialization problem. 2004-05-11 20:19:38 +00:00
Dries Buytaert 1ad9afb8a7 - Added support for multiple user roles. Patch by Jim Hriggs. 2004-05-10 20:34:25 +00:00
Dries Buytaert 0a74e0b320 - Patch #6552 by Gerhard: fixed problem with user callbacks that slipped in with Natrak's last commit. 2004-05-01 08:47:20 +00:00
Kjartan Mannes dfd66f998d - Fixed sitewide timezone settings not being saved.
- Making sure profile fields are saved properly.
2004-04-29 23:27:15 +00:00
Kjartan Mannes 7e017fce0f - Applied patch #6552: Put back register_form and register_validate callbacks in user.module.
- Fixed bug #7406: User delete hook incorrect params.
2004-04-29 22:39:55 +00:00
Kjartan Mannes a7a86cd289 - Changing permissions on user menus. 2004-04-22 22:53:51 +00:00
Dries Buytaert 9796455aaf - Patch #4635 by Ber: user search should translate wildcard character 2004-04-21 17:50:28 +00:00
Dries Buytaert 7231c88a32 - Added support for 403 handling. Patch by JonBob. As a side benefit,
administrators will be able to define a custom 403 page, just as they
  can define 404 pages now.

  This needs to be documented in the "Changes since / migrating to ..."
  pages.
2004-04-21 13:56:38 +00:00
Kjartan Mannes 7976678719 - Only encode strings that contain non-ASCII characters. 2004-04-21 11:31:34 +00:00
Dries Buytaert 10bdb51c37 - Patch by JonBob/Jonathan: reworked the menu system so that menus are
configurable!  Menu items can be disabled, repositioned, added and
  so on.

  Upgrading to requires you to run update.php.

  This functionality depricates some of the 'navigation modules' in the
  contributions repository.  Furthermore, modules can now 'suggest'
  menu items and site adminstrators can choose to enable them.  Modules
  in the contributions repository should try to take advantage of this.
2004-04-15 20:49:42 +00:00
Dries Buytaert 5f17ad3c2d - Profile module improvement:
* Made it possible to set certain fields as 'required'.

  To do:
   * Mark them as required visually.
   * Add required fields to the subscription page.
2004-03-27 14:50:56 +00:00
Dries Buytaert 0b876c4486 - Patch #6425 by TDobes: made avatars work with private download method. Added
user_file_download() function to communicate with the file system layer.
2004-03-27 09:06:52 +00:00
Dries Buytaert 2fe664016c - Patch #3987 by jhriggs: changed the location of the logout link. 2004-03-24 05:54:20 +00:00
Dries Buytaert 2043b336af - Fixed braino 2004-03-21 16:21:04 +00:00
Dries Buytaert 754f2ac26a - More profile module improvements:
+ Updated the _user() hook's "$type == 'view'" case to match the
     "$type == 'edit'" case.  That is, both have to return an associtive
     array of the format array('category' => 'fields').

   + Updated the profile pages to group fields by category.  Made possible
     thanks to the above change.

   + Moved logic out of the theme_ functions.
2004-03-21 14:28:15 +00:00
Dries Buytaert 576968c471 - Patch #6406 by TDobes: fixed typos in profile/user module. 2004-03-15 20:09:54 +00:00
Dries Buytaert 70c484c077 - Patch #6391 by jik: after deleting a user, return to the user list, not the edit user form. 2004-03-12 18:42:08 +00:00
Dries Buytaert 2101f6c454 - Rewrote the profile module:
+ Added a 'created' field to the users table and renamed the 'timestamp'
     fied to 'changed' (cfr. node table).  Update.php will try to determine
     a 'created' timestamp for existing users.

   + The profile module no longer uses serialized data but has its own set
     of tables.  Known existing profile data is migrated by these new tables.
       TODO: migrate the birthday field.

   + The profile fields can be grouped, and within each group, profile fields
     can be sorted using weights.

   + The profile pages can be themed.

   + The profiles can be browsed based on certain properties/settings.

   + Change the _user hook: (i) 'private_view' and 'public_view' are merged
     into 'view' as there are no private fields and (ii) 'edit_form' has
     been renamed to 'edit'.

   + Avatar handling has been refactored and is now part of the user module.
     The users table has a dedicted 'picture' field.

   + Simplified the way themes should use display/visualize pictures or
     avatars.

   + Made it possible for administrators to replace or delete avatars.

   + ...

  I hope this make for a good base to build on collectively.
2004-03-11 20:33:59 +00:00
Dries Buytaert c73305f6d6 - Patch #6129 by Goba: fixed dependencies on search module. 2004-02-29 17:16:27 +00:00
Dries Buytaert df2c033729 - Patch 6066 by Adrian: PostgreSQL does not return 'affected rows' when doing
a select statement.  Even though PEAR supports this functionality, it fails
  silently when using PostgreSQL.  We use the db_num_rows() function instead
  to return the amount of rows returned.  (According to Killes, the MySQL
  manual also states that it should not return affected rows on a 'select'
  statement.)
2004-02-26 17:55:14 +00:00
Dries Buytaert 4b0b2d02ee - Patch by Steven: removed redundant permission checks. These are no longer
required thanks to the new 404 handling.
2004-02-15 20:09:46 +00:00
Dries Buytaert bd78422715 - Patch 5592 by Goba: let drupal_map_assoc() rule. :-)
- Renamed CHANGELOG to CHANGELOG.txt for Windows uses.
2004-02-15 15:19:36 +00:00
Dries Buytaert f137b26979 - Patch 4902 by Goba:
+ only adds an optional parameter to url() and l(), so individual links
    can be set to be absolute
  + modifies drupal_goto() to accept the parameters of url() without the
    $absolute parameter, so cleaner invocations can be used
  + rework of some code in node_feed, making it much better to look at
    (the current code uses foreach with an immediate brake to get the first
    key of the associative array, geeeeez)
  + added xml:base to the rss tag generated by node_feed()
  + set all user mail URLs to be absolute
  + fix a small fragmented URL in user.module
2004-02-11 19:21:14 +00:00
Steven Wittens 1c5a3947d1 Bugfix: new user registration was broken.
See: http://drupal.org/node/view/5741
2004-02-09 05:38:32 +00:00
Dries Buytaert 991cb5c982 Patch 5554 by Goba (slightly modified):
- Modifies _user_mail_text() to automatically override the default
    strings when needed and apply t() on the strings. This lets Drupal translators
    include default messages in translations, and also removes a lot of repeated code.
    Modified the internal $messageid of the approval message from
    welcome_approval_body/subject to approval_body/subject, so automatic variable
    name computation can be done. This does not affect any variable table keys, since
    the change was especially done to keep the variable names...

  - Adds %login_uri and %edit_uri to move away from the concatenation approach used in
    the default messages, thus making those messages visible for the .po extractor

  - Uses direct return in help text generation when no more action need to be taken
    on the help string (the '$output .=' approach was just plain silly looking and
    misleading, since there was no preceding or appended string in $output)
2004-02-08 18:38:15 +00:00
Dries Buytaert 229ac8dec4 - Small bugfix. 2004-02-07 17:24:38 +00:00
Dries Buytaert e28bbf6739 - Batch two with profile module improvements:
+ Reworked the 'account administration' page.
   + Fixed bug in the 'edit account' page.
   + Removed some dead code from the system.module.
2004-02-07 16:59:34 +00:00
Dries Buytaert 5a8129e0fb - First batch of profile module improvements:
+ Tidied up the profile configuration page: grouped form elements.

   + Tidied up the block configuration settings: removed hard-coded
     table.

   + Changed the profile API to return the preferred group name, and
     changed the user module to group settings.  Modules implementing
     the _user hook will need to be udpated.

   + Removed register_form and register_validate for now.
2004-02-07 16:18:46 +00:00
Dries Buytaert c6deda88ef - Patch #5048 by flevour: added missing t() function. 2004-02-07 10:46:46 +00:00
Dries Buytaert fd64c56ec1 - Removed the 'remember me' feature. It has been broken for many months.
When an elegant fix is found, it will reappear.
2004-02-06 22:58:03 +00:00
Dries Buytaert 384ae54cf6 - Cleanup: modified some context-sensitive help, changed "s to 's, added
<legend> and <fieldset> tags, used drupal_set_message() to print a
  status message and removed some dead code.
2004-01-31 09:50:39 +00:00
Dries Buytaert 66190b1787 - Patch #5393 by Goba: changes the search hook return value, and requires an array
containing two elements, the first being the requested title, and the second being
  the result list. Advantages:
    * Cleaner search code in common.inc
    * Po extraction is possible and works fine
    * No hardcoded exceptions for node and comment modules, since any module can
      return results in order of relevance (or another order)
2004-01-26 19:22:22 +00:00
Dries Buytaert 8a913ffe7c - Removed the 'Page not found' message after the initial install and removed
some old user module logic to install the initial role IDs.
2004-01-24 16:54:22 +00:00
Dries Buytaert b85eb11e11 Patch 5287 by Stefan: multiline help texts should become inside a single $output. 2004-01-23 18:42:43 +00:00
Dries Buytaert f1dfe0639a - Bug 5285: fixed broken URLs in user module. Patch by Stefan. 2004-01-21 17:26:59 +00:00
Dries Buytaert eee72bfa95 - Patch 4859: new drupal_unpack() consolidates duplicate code and makes it
easy to show avatars next to nodes and comments.  Patch by Moshe.  As a
  showcase, maybe Xtemplate should have an option to enable/disable avatars?
2004-01-13 19:25:37 +00:00
Dries Buytaert a8b8c247db - Patch #5021: clean up URLs in _help texts. Patch by UnConeD. 2004-01-11 20:31:26 +00:00
Dries Buytaert 6ec582fd9c - Fixed bug #5074: standarized the user log messages. 2004-01-11 19:44:15 +00:00
Dries Buytaert 30fb23451f - Changed some boxes to fieldsets/lengeds. 2004-01-05 19:33:58 +00:00
Dries Buytaert 80f34e5ab0 - XHTML improvements: <b> -> <strong>. Patch by Stefan. 2003-12-29 17:14:27 +00:00
Dries Buytaert 90a5a6cf6e - Updated the user login block to validate as XHTML strict: the
<div class="user-login-block"> is now inside the <form> instead of the
  other way around.

- Simplified the user login block by removing some CSS that was no longer
  needed.  The block module already emits block-related classes and an id.
2003-12-29 13:51:59 +00:00
Dries Buytaert baaa21e131 - Tidied up some inconsistencies in the code: scripts/code-style.sh is your friend. 2003-12-28 10:47:33 +00:00
Dries Buytaert 097f6209e5 - First take at improving the user module's code: replaced the custom error
printing with calls to drupal_set_message().
2003-12-26 13:44:18 +00:00