Create a new user


  $user = new stdClass();
  $user->name = 'Dribbit';
  $user->pass = 'test123';
  $user->mail = 'test@dribbit.eu';
  $user->status = 1;
  // Role id 3 is administrator.
  $roles = array(3 => true);
  $user->roles = $roles;
  user_save($user);

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.