Whenever new user registered, how to make them active based on some condition automatically I have a cloud driven drupal site. In the site one content type exists named as people it has email field. The content in this content type is around 5000. Whenever new user registered I want to check user email with the people content type email field that is around 5000 content i want to check. If user email matches with any one email in people content type I want to make them active automatically. How to do this.? Can anyone give me suggestions. I tried with rules but its not happening. Can anyone suggest some custom php code for rules module
Using PHP on admin end is not recommended. If you are interested in custom module here are the pointers


Implement hook_user_presave : Invoked when a user is created or updated.
Make sure your code inside presave hook is conditional for new account created but not updated. You can use in_new property of account object

if ($account->is_new) {...}
Use Entity Field query to find a node with email id of current account being created
if you found a result then Set $edit['status'] as 1.