Commit Graph

430 Commits (7988f875a9fa8c19548559b28c20c29482e0a86f)

Author SHA1 Message Date
Dries Buytaert a6e7e9c104 - Patch #15566 by drumm: must specify a userneme or password error happens when it shouldn't. 2005-01-14 15:15:19 +00:00
Steven Wittens 8655d4368a - Fixing a couple of watchdog() calls. 2005-01-09 12:58:53 +00:00
Dries Buytaert 64b100d19a - Patch #13260 by UnConeD: watchdog module improvements.
We added a 'severity' column to watchdog():
    watchdog($type, $message, $link) --> watchdog($type, $message, $severity, $link);

    * Specify a severity in case you are reporting a warning or error.
    * The $link-parameter is now the fourth parameter instead of the third.

  TODO: document this in the upgrade guide.
2005-01-09 09:22:40 +00:00
Dries Buytaert 0f91dce414 - Patch #15247 by Drumm: simplified the logout code. 2005-01-07 18:01:13 +00:00
Dries Buytaert 7f890fd1b1 - Patch #15184 by drumm: clean up user password mailing.
+ After mailing the password, set a message and go to the login form (was print a message as the entire page).
  + Provide feedback if neither field was filled in.
  + Make it a full menu callback instead of going through user_page().
  + Fixed some indentation.
  + Changed some double quotes to single quotes.
  + Made sure all if statements have {}.
2005-01-06 20:38:19 +00:00
Dries Buytaert 9f2952aa3f - Bug #14609: improved the status messages and avoid empty roles being saved. 2004-12-22 08:51:39 +00:00
Dries Buytaert 2b17b3a966 - Patch #13907 by Neil: less ways to set the page title.
* Less logic in theme code.
   * Encourages use of the menu system.
   * Easier to find where a title or breadcrumb comes from in other people's code because there are less places to look. Look in menu and then grep for the appropriate set function. Looking for calls to theme_page() is hard because there are too many of them.
   * Very slightly more efficient.
2004-12-15 21:19:42 +00:00
Dries Buytaert 6e3eb60aab - Removed some cruft: left-over xxx_help_page() functions. 2004-12-11 14:13:24 +00:00
Dries Buytaert 5520513879 - Modified patch by Goba: don't save user roles in the serialized data field of the user table. 2004-12-08 19:41:16 +00:00
Dries Buytaert 1365740f6e - Patch #14006 by Neil:
* user/view/$n has been replaced with user/$n.
   * More blank lines in the right places.
   * Prevent unwanted case fallthrough.
2004-12-07 07:24:46 +00:00
Dries Buytaert 95610bdd6c - Patch #13647 by Goba:
1. Fixed broken watchdog calls: two watchdog calls omitted the type parameter, and thus injected logs into the type field, instead of the message field.
   2. Removed t() functions from user contributed content.
2004-11-29 17:52:35 +00:00
Dries Buytaert 29337ad8bb - Patch #13581 by Steven: Db_query() allows a variable amount of parameters so you can pass the query arguments in. There is however an alternative syntax: instead of passing the query arguments as function arguments, you can also pass a single array with the query arguments in it. For example the following two statements are equivalent:
db_query($query, $a, $b, $c);
db_query($query, array($a, $b, $c));

This usage is particularly interesting when the query is constructed dynamically, and the amount of arguments to pass varies. In that case we use the second method to avoid using call_user_func_array(). This behaviour is not documented explicitly, but it is used in several places.

However, db_query_range() and pager_query() do not support this syntax properly, which means there are several pieces of code which still revert to the ugly call_user_func_array() call.

This patch updates db_query_range() and pager_query() so they support the array-passing method. I also added documentation about this method to each of the db functions.

I also cleaned up the code for db_query (it was weird and hard to understand) and moved db_query() and db_queryd() from database.xxxxx.inc to database.inc: it was the same between both mysql and pgsql, as it doesn't do anything database specific. It just prefixes the tables and inserts the arguments. The actual db query is performed in _db_query(), which is still in database.xxxxx.inc.

Finally, I updated several places with the new syntax, and the code is a lot cleaner. For example:
- array_unshift($params, "SELECT u.* FROM {users} u WHERE $query u.status < 3");
- $params[] = 0;
- $params[] = 1;
- $result = call_user_func_array('db_query_range', $params);
+ $result = db_query_range("SELECT u.* FROM {users} u WHERE $query u.status < 3", $params, 0, 1);

and

- return call_user_func_array('db_query_range', array_merge(array($query), $args, array((int)$pager_from_array[$element], (int)$limit)));
+ return db_query_range($query, $args, (int)$pager_from_array[$element], (int)$limit);

I've tested it on mysql. I didn't alter the actual db behaviour, so pgsql should be okay too.

This patch is important because many people avoid the call_user_func_array() method and put data directly into the db query.  This is very, very bad because the database prefix will be applied to it, and strip out braces. It's also generally bad form as you have to call check_query() yourself.  With the new, documented syntax, there is no more excuse to put data directly in the query.
2004-11-29 13:13:29 +00:00
Dries Buytaert 9574766ad8 - Patch by Stefan: wrapped the help texts in <p></p> tags. Helps improve consistency. 2004-11-23 22:20:41 +00:00
Dries Buytaert e19a3cf42d - Patch #12363: fixed glitch in user_access() as pointed out by TDobes. 2004-11-23 21:52:13 +00:00
Dries Buytaert fa97839088 - Patch 13180 by chx: renamed check_query() to db_escape_string() and implemtented it properly per database backend.
Read the manual for pg_escape_string:  "Use of this function is recommended instead of addslashes()." Or read sqlite_escape_string: "addslashes() should NOT be used to quote your strings for SQLite queries; it will lead to strange results when retrieving your data."
2004-11-21 08:25:17 +00:00
Dries Buytaert 9979aceab0 - Patch #12783 by Stefan: various small consistency/usability improvements. 2004-11-15 11:16:39 +00:00
Dries Buytaert f01bd675c0 - Performance improvement: made 'sid' the primary key of the sessions table.
That should improve performance of session handling as well improve
  performance of the "Who's online"-block.  Drupal.org's sessions table
  contains appr. 40.000 sessions on a slow day and rendering the "Who's
  online"-block became a performance bottleneck.

  This change has yet to be tested on a busy site so things might go wrong.
2004-11-07 21:53:55 +00:00
Dries Buytaert a16be3495e - Patch #12658 by menesis: when an administrator adds a user, the 'authenticated user' role was not assigned to the new user. 2004-11-07 07:54:35 +00:00
Dries Buytaert b63d529a15 - Patch #12515 by Goba: fixed problem with cookies not being set properly, causing users getting logged out. 2004-11-03 22:39:55 +00:00
Steven Wittens f69437dead #12363: Bug in user_access() with uid 1 and $account parameter. 2004-11-02 12:20:59 +00:00
Dries Buytaert b3adcf05a3 - Patch #11875 by Neil Drumm: block module configuration improvements.
The primary goal of this patch is to take the 'custom' and 'path' columns of the block overview page and make them into something understandable. As of Drupal 4.5 'custom' lacked an explanation which wasn't buried in help text and path required dealing with regular expressions.

Every block now has a configuration page to control these options. This gives more space to make form controls which do not require a lengthy explanation. This page also gives modules a chance to put their block configuration options in a place that makes sense using new operations in the block hook.

The only required changes to modules implementing hook_block() is to be careful about what is returned. Do not return anything if $op is not 'list' or 'view'. Once this change is made, modules will still be compatible with Drupal 4.5. Required changes to core modules are included in this path.

An additional optional change to modules is to implement the additional $op options added. 'configure' should return a string containing the configuration form for the block with the appropriate $delta. 'configure save' will come with an additional $edit argument, which will contain the submitted form data for saving. These changes to core modules are also included in this patch.
2004-10-31 07:34:47 +00:00
Dries Buytaert 8daed9cbf3 - Patch #12232 by Steven/UnConed: search module improvements.
1) Clean up the text analyser: make it handle UTF-8 and all sorts of characters. The word splitter now does intelligent splitting into words and supports all Unicode characters. It has smart handling of acronyms, URLs, dates, ...

2) It now indexes the filtered output, which means it can take advantage of HTML tags. Meaningful tags (headers, strong, em, ...) are analysed and used to boost certain words scores. This has the side-effect of allowing the indexing of PHP nodes.

3) Link analyser for node links. The HTML analyser also checks for links. If they point to a node on the current site (handles path aliases) then the link's words are counted as part of the target node. This helps bring out commonly linked FAQs and answers to the top of the results.

4) Index comments along with the node. This means that the search can make a difference between a single node/comment about 'X' and a whole thread about 'X'. It also makes the search results much shorter and more relevant (before this patch, comments were even shown first).

5) We now keep track of total counts as well as a per item count for a word. This allows us to divide the word score by the total before adding up the scores for different words, and automatically makes noisewords have less influence than rare words. This dramatically improves the relevancy of multiword searches. This also makes the disadvantage of now using OR searching instead of AND searching less problematic.

6) Includes support for text preprocessors through a hook. This is required to index Chinese and Japanese, because these languages do not use spaces between words. An external utility can be used to split these into words through a simple wrapper module. Other uses could be spell checking (although it would have no UI).

7) Indexing is now regulated: only a certain amount of items will be indexed per cron run. This prevents PHP from running out of memory or timing out. This also makes the reindexing required for this patch automatic. I also added an index coverage estimate to the search admin screen.

8) Code cleanup! Moved all the search stuff from common.inc into search.module, rewired some hooks and simplified the functions used. The search form and results now also use valid XHTML and form_ functions. The search admin was moved from search/configure to admin/search for consistency.

9) Improved search output: we also show much more info per item: date, author, node type, amount of comments and a cool dynamic excerpt à la Google. The search form is now much more simpler and the help is only displayed as tips when no search results are found.

10) By moving all search logic to SQL, I was able to add a pager to the search results. This improves usability and performance dramatically.
2004-10-31 03:03:27 +00:00
Dries Buytaert 10f329c057 - Patch #11728 by Uwe Hermann: fixed some typos in the code comments, Doxygen documentation and screen output.
Uwe: I dropped the 'iff' chunks as 'iff' stands for 'if and only if'.
2004-10-19 18:02:31 +00:00
Dries Buytaert 07cdcb439b - Patch by James: made the blogapi module work again. 2004-10-18 18:29:15 +00:00
Dries Buytaert 869a91b72e - Patch #11505 by Steven: 'my account' information is not saved.
+ Drupal 4.4 stored profile data in the serialized user->data column. Drupal 4.5 stores profile data in tables (but user->data is still available and used for other stuff, like locale or themes).  The update from 4.4 to 4.5 didn't remove the old data from the user->data column properly, because there is no mechanism in user_save to do so (it did try to unset the fields, but this has no effect).

  + On registration, hook_user('insert') is invoked after saving the data column. This means that any module-specific data is put into the data field. We cannot move hook_user('insert') higher up, because before that point, we do not have a complete $user object yet.
2004-10-16 16:59:59 +00:00
Dries Buytaert 5a2e0d0377 - Patch #11642 by Steven: when editing a user as an admin, you can choose the user's roles through form checkboxes. If the form validation fails and the form is redisplayed, the roles are lost. This is because the format for $user->roles is different from what form_checkboxes uses. 2004-10-16 16:48:04 +00:00
Steven Wittens a185443ed3 #11503: consistency improvements by Stefan 2004-10-12 16:16:22 +00:00
Steven Wittens 2c4a82bda2 #11503: (more) missing t() 2004-10-12 16:10:54 +00:00
Dries Buytaert 9a8cd6a2e7 - Patch #11312 by killes: fixed problems with menu caching. 2004-10-06 11:51:48 +00:00
Dries Buytaert 60f945bcc7 - Patch #11138 by Al: fixed GUI problem with deleting users. 2004-09-28 18:31:11 +00:00
Steven Wittens eecbda5635 - Fixing user_load() to use sprintf db_query syntax. Uglier, but safer. 2004-09-24 20:04:54 +00:00
Steven Wittens f298481316 - user.module: allow non-ascii usernames. 2004-09-24 02:38:29 +00:00
Dries Buytaert f8080719f2 - Patch #10983 by TDobes: failed logon attempts produce nonsensical watchdog message. 2004-09-21 17:46:22 +00:00
Dries Buytaert 16d3f9bc60 - Patch #10845 by James: fixed the user/help page. 2004-09-20 19:27:51 +00:00
Dries Buytaert bc58116129 - Usability improvement: on the registration page, mark the username and e-mail
address as required fields.  This makes for more consistent behavior, as the
  profile module might add required fields that are marked as such.
2004-09-19 13:43:29 +00:00
Dries Buytaert 5281a22070 - Usability improvement: made the status messages use <em>foo</em> rather than "foo". 2004-09-19 13:39:46 +00:00
Dries Buytaert 6dbd0bcfb4 - Patch #6500 by Mathias with help from Steven: made it possible to add fields to the registration form. This feature used to exist. 2004-09-19 13:28:11 +00:00
Dries Buytaert 34fc0b882d - Patch #10922 by drumm: usability improvment: tabified the user account pages (login, register, request new password). 2004-09-19 08:33:53 +00:00
Steven Wittens 30b69380af - #10689: Group permissions by module in UI + minor code cleanups.
- Adding a drupal_goto to the block admin.
2004-09-17 22:07:17 +00:00
Dries Buytaert 4b9926263c - Patch #10896 by ccourtne: user access rules for name were not enforced due to an incorrect URL. 2004-09-17 18:24:32 +00:00
Dries Buytaert 5c7983c4de - Patch #8179 by JonBob: reintroduced menu caching. 2004-09-16 07:17:56 +00:00
Dries Buytaert 00ceea0986 - Fixed stupid 'SELECT u.* FROM users u WHERE LOWER(u.uid) = 'S' AND u.status < N LIMIT N, N' query. 2004-09-13 18:07:54 +00:00
Dries Buytaert 04ef7b1636 - Patch #10777 by ccourtne: performance improvement: the user module executes a query and never uses the results. 2004-09-13 09:00:27 +00:00
Steven Wittens 8c07aaa9c7 #10733: fixing problems when creating users. 2004-09-12 12:47:51 +00:00
Steven Wittens f6033d29e7 #10733: fixing broken user registration due to roles selection patch. 2004-09-11 22:49:20 +00:00
Dries Buytaert 0ddee8ff09 - Patch #10718 by drumm: bugfix: it was possible to save a user with no roles assigned when the form clearly said at least one was required. The result of saving that was silently leaving the roles unchanged, which is rather bad. 2004-09-10 20:00:28 +00:00
Dries Buytaert 2dedf5fbc3 - Modified patch #10644 by drumm: fixed some broken URLs. Patch modified to
use /user/$uid instead of /user/$uid/edit (where possible).
2004-09-08 18:39:14 +00:00
Steven Wittens 89b0a0a90e - #10398: User role settings corrupt after requesting new password. 2004-08-27 22:52:00 +00:00
Steven Wittens 674e2f493b Removing a left-over debug statement from Distributed Authentication. 2004-08-24 19:58:17 +00:00
Steven Wittens 44f341bebc Patch by me and Kjartan.
Upload.module
- Fixing a bug caused by the PHP5 patches.
Beware: PHP4's array_merge() will silently accept objects and convert them to arrays. We should not depend on this behaviour in the future.

File.inc / file-using modules:
- Removing the constant FILE_SEPARATOR: forward slashes work fine on Windows, and it was being used incorrectly as an URL separator sometimes.
- Adding @ to mkdir and chmod to supress ugly PHP errors. They are already reported with drupal_set_message().
- Fixing default for variable 'file_directory_temp'.
- Clarifying the help tip for 'file_directory_temp' in admin > settings.
2004-08-24 19:21:30 +00:00