You are here

function user_fields in Drupal 4

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

File

modules/user.module, line 434
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;
}