Now only after paying for the product, the user is added to Drupal with the role that is set for the product. I would like the user to be added to Drupal as "authenticated user" after he orders a product, even when the product is not paid yet. After payment, his role should be upgraded to the role that is set for the product. What alteration to the Drupal plugin must i make to realize this? Please could you supply me the PHP code, that I must add to drupal.inc.php.
Just found the solution I changed the function after_login: How it was: PHP: function after_login($user) { $u = $this->get_user_by_login($user['login']); if ($u['pass'] != md5($user['pass'])) return; if ($u['status'] != 1) return; Now the user is added to Drupal as authenticated user when he logs into aMember. PHP: function after_login($user) { $n_user_id = $this->query_one("SELECT uid FROM [db]users WHERE name = '$user[login]'"); if (!$n_user_id) { if ($this->drupal_sequences_test()) { $this->query("LOCK TABLES [db]sequences WRITE"); $uid = $this->query_one("SELECT id FROM [db]sequences WHERE name = 'users_uid'") + 1; $this->query("REPLACE INTO [db]sequences VALUES ('users_uid', $uid)"); $this->query("UNLOCK TABLES"); $uid_row = "uid, "; $uid_value = "$uid, "; } $active = 1; $tm = time(); $this->query("INSERT INTO [db]users ($uid_row name, pass,mail, init, status,created,timezone) VALUES ($uid_value '$user[login]', '$user[pass]', '$user[email]', '$user[email]', '$active', $tm, 0)"); } $u = $this->get_user_by_login($user['login']); if ($u['pass'] != md5($user['pass'])) return; if ($u['status'] != 1) return;