title: How to get userid of newly registered user in Joomla 1.5.x?
body: <p>I want to perform some operations on newly registered user when he hits the <strong>register</strong> button on register form and before he gets the system message about the activation mail(if useractivation setting is ON)</p>
  
  <p>For that i have modified the file <strong>components/com_user/controller.php</strong>
  In <strong>register_save</strong> method of the class <strong>JController</strong>, I have changed the original PHP code</p>
  
  <pre><code>if ( !$user-&gt;save() )
  {
      JError::raiseWarning('', JText::_( $user-&gt;getError()));
      $this-&gt;register();
      return false;
  }
  </code></pre>
  
  <p>into </p>
  
  <pre><code>if ( !$user-&gt;save() )
  {
      JError::raiseWarning('', JText::_( $user-&gt;getError()));
      $this-&gt;register();
      return false;
  }
  include('custom_operations.php');
  </code></pre>
  
  <p>In <strong>custom_operations.php</strong> file, i have used <strong>$user</strong> variable to access username and email of newly registered user but following code gives me <strong>0 value</strong></p>
  
  <pre><code>$user-&gt;get('id');
  </code></pre>
  
  <p>How can i access the userid of that newly registered user? Is there any other way to execute custom_operations.php file(I have also put an extra field in register form which is essential in this file)?
  Please guide</p>