Login/User Management/Permissions

Agreement Module

The Agreement module displays a text-based agreement (e.g. Terms of Service) that users of a particular role must accept before they are granted access.

Anonymous User

By default, Drupal creates a user with uid=0 in the users table.  This is the "anonymous user", and is a placeholder used by Drupal when a site visitor is not logged in.

If you want to do something special in a template for anonymous users, use the following code construct:

global $user

if (user->$uid == 0 ) {
  <something for anonymous users>
}

Lost Username/Password

Normally, Drupal does a great job of resetting the password for an account as long as you know either the username or email address associated with the user account.

However, if you have lost both, or perhaps the Drupal installation has a non-functioning email interface, do the following (requires accessing the database using phpMyAdmin):

In phpMyAdmin, browse the users table.  You will see the user names and associated email addresses.  if the email interface for the site is working, simply enter the appropriate email address or username in the "Request New Password" page (http://example.com/user/password), and Drupal will send an email that has a temporary login link so that the password may be reset.  If the desired account has an old (non-functional) email address, you can update the email address using phpMyAdmin and have the temporary login link sent to the new email address.

If for some reasaon Drupal can not send an email to reset the password, browse to the desired user account and click edit icon, and enter a new password in plain text in the "pass" field, and in the Function column choose MD5, then click Go.

 

 

Permissions

An introduction to user permissions can be found at: http://gotdrupal.com/videos/understanding-drupal-permissions.
 

Sessions

The Drupal session handler is based on the PHP session handler $_SESSION['key'] = 'value.  It works for both anonymous and authenticated users.  Using the Drupal session handler, infomation may be stored so that it persists over multiple pages.

User #1

When Drupal is installed (install.php) a special user, referred to as User #1 (user id = 1) is created. This user is the "super admin" with full privlidges to everything. Typically this user is named admin, but it is a good idea, for security reasons, to give this user another name. Normally this account is not used except for technical support and administration purposes.

User Profile Module

In Version 6, User Profile Module associates a node with each user to make possible the addition of additional fields using CCK.

In Version 7, the argument of "Users should be nodes" will be over, as the User object (and other core objects) will be similar to nodes in that they will be "field-able" (able to have fields).

 

hook_user