You are here

function user_fields in Drupal 5

Same name and namespace in other branches
  1. 4 modules/user.module \user_fields()
  2. 6 modules/user/user.module \user_fields()
2 calls to user_fields()
profile_field_form_validate in modules/profile/profile.module
Validate profile_field_form submissions.
user_save in modules/user/user.module
Save changes to a user account or add a new user.

File

modules/user/user.module, line 404
Enables the user registration and login system.

Code

function user_fields() {
  static $fields;
  if (!$fields) {
    $result = db_query('SELECT * FROM {users} WHERE uid = 1');
    if (db_num_rows($result)) {
      $fields = array_keys(db_fetch_array($result));
    }
    else {

      // Make sure we return the default fields at least
      $fields = array(
        'uid',
        'name',
        'pass',
        'mail',
        'picture',
        'mode',
        'sort',
        'threshold',
        'theme',
        'signature',
        'created',
        'access',
        'login',
        'status',
        'timezone',
        'language',
        'init',
        'data',
      );
    }
  }
  return $fields;
}