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 568075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:09:03+00:00 2026-05-13T13:09:03+00:00

I’m new to Drupal6 and spent long time searching how to implement the following

  • 0

I’m new to Drupal6 and spent long time searching how to implement the following feature without success: I use Drupal as front-end/doc board for a web-app. I want to mirror all user account creation, update and deletion on this web-app, i.e. send user name and password.

I started coding a little module implementing hook_user (http://api.drupal.org/api/function/hook_user/6), but I am still wondering on several question concerning this hook:

1) I can’t find a doc concerning the $account fields, and thus don’t know how to retrieve the user name and password.
2) The insert operation informs that “The user account is being added”. Is that triggered when the user query an account or when his/her pending account creation has been approved?
3) User management on the ‘slave’ webapp is done through a URL interface. I only know the header("Location: http://webapp/users/add?user=martin&pwd=bla") PHP primitive, but I fear this will make a redirection, instead of just hiting the target page and continue code flow. Any suggestion?

Maybe some of you already programmed such a module, or would have links for more documentation?
Thanks in advance,
Martin

  • 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-13T13:09:03+00:00Added an answer on May 13, 2026 at 1:09 pm

    Here is the final piece of code that works. Note that the password is retrieved md5ified, so the slave webapp must be able to do so as well:

    function mirror_registration_user($op, &$edit, &$account, $category = NULL) {
     $cmd = 'http://www.example.com/register?name='.$account->name.'&pass='.$account->pass;
    
     if($op == 'insert'){
    $cmd .= '&op=insert';
    drupal_http_request( $cmd );
     }
     else if($op == 'delete'){
    $cmd .= '&op=delete';
    drupal_http_request( $cmd );
     }
     else if($op == 'after_update'){ // 'update' is a "before update event"
    $cmd .= '&op=update';
    drupal_http_request( $cmd );
     }
    }
    

    Remark: in our case, registration requires admin approval. In this case, there’s an ‘update’ event. The ‘insert’ event is triggered as soon as the user queries an account.

    Informations for other newbies:

  2. When trying to debug the code, one can echo $cmd to have the content of $cmd writen on top left of the following page.
  3. If you write crapy php code and get a blank page when using the hook, you may add to Drupal/index.php the following calls: error_reporting(E_ALL);
    ini_set(‘display_errors’, TRUE);
    ini_set(‘display_startup_errors’, TRUE); that allow having debug info.
  • 0
  • Reply
  • Share
    Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
    • Share on WhatsApp
    • Report

Sidebar

Related Questions

No related questions found

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.