Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1001065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:36:38+00:00 2026-05-16T07:36:38+00:00

We have to have a register method available via web service that is written

  • 0

We have to have a “register” method available via web service that is written in java so hence forth we do not have access to the Drupal API. But we need to be able to register a user successfully. Simply adding a user to the users table will not do it as the newly created users are never able to login successfully. Again I love the Drupal API and would always use that as that is the “correct” way to do it but in this case we just dont have the faculty to do that. Any insights to this dilemma ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:36:39+00:00Added an answer on May 16, 2026 at 7:36 am

    You’ll want to step through the user_save() API function to get an idea of what Drupal does when creating a new user.

    There isn’t any deep magic to what Drupal does with saving that type of data: it’s all in the database. So, while it’s not ideal that you can’t use the Drupal API, you’re really only dealing with two database inserts: the {user} table insert (which you’ve already done), and the {users_roles} table insert.

    Based on your info, I suspect the missing link is that you’re not adding a row to the {users_roles} table for your new user’s UID. The relevant line in user_save():

    db_query('INSERT INTO {users_roles} (uid, rid) VALUES (%d, %d)', $account->uid, $rid);
    

    Where $account->uid is the UID of the newly created user, and $rid is the ID of the role you want to give the user. A new user needs at least the authenticated user role.

    Everything else in user_save() is mainly sanity checking (user_save() handles updating a user in addition to creating a new one) and hook firing, which you likely don’t need to worry about for this use-case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application (Java, Websphere, JSP) which allows co-workers to register visitors
I have decided that all my WPF pages need to register a routed event.
I have PHP configured so that magic quotes are on and register globals are
I have a web page in which people go to register for my site.
I have a class that implements multiple interfaces. I would like to register these
I have a third-party ActiveX dll, and I'd like to register it programmatically at
I have this function: RegisterGlobalHotKey(Keys.F6, MOD_SHIFT | MOD_CONTROL); which call an API to register
Have just started using Google Chrome , and noticed in parts of our site,
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.