How can I redirect users upon password reset? The solution shown in How can I redirect users upon login sometimes but not break the &quot;Forgot password?&quot; function? work for Drupal 7.

In Drupal 6, with the User:user has logged in event and the following PHP conditions, nothing happens.

if (arg(0) == 'user' &amp;&amp; arg(1) == 'reset') { 
  return false; 
} else { 
  return true; 
}


How can I redirect users upon password reset in Drupal 6?

PS. The only variable for this event is $account for the logged-in user.

This is the exported rule I am using.

array (
  'rules' =&gt; 
  array (
    'rules_passwordreset' =&gt; 
    array (
      '#type' =&gt; 'rule',
      '#set' =&gt; 'event_user_login',
      '#label' =&gt; 'passwordreset',
      '#active' =&gt; 1,
      '#weight' =&gt; '0',
      '#categories' =&gt; 
      array (
      ),
      '#status' =&gt; 'custom',
      '#conditions' =&gt; 
      array (
        0 =&gt; 
        array (
          '#weight' =&gt; 0,
          '#type' =&gt; 'condition',
          '#settings' =&gt; 
          array (
            'code' =&gt; 'if (arg(0) == \'user\' &amp;&amp; arg(1) == \'reset\') { 
  return false; 
} else { 
  return true; 
}',
            'vars' =&gt; 
            array (
            ),
          ),
          '#name' =&gt; 'rules_condition_custom_php',
          '#info' =&gt; 
          array (
            'label' =&gt; 'Execute custom PHP code',
            'module' =&gt; 'PHP',
            'eval input' =&gt; 
            array (
              0 =&gt; 'code',
            ),
          ),
        ),
      ),
      '#actions' =&gt; 
      array (
        0 =&gt; 
        array (
          '#weight' =&gt; 0,
          '#info' =&gt; 
          array (
            'label' =&gt; 'Page redirect',
            'module' =&gt; 'System',
            'eval input' =&gt; 
            array (
              0 =&gt; 'path',
              1 =&gt; 'query',
              2 =&gt; 'fragment',
            ),
          ),
          '#name' =&gt; 'rules_action_drupal_goto',
          '#settings' =&gt; 
          array (
            'path' =&gt; 'http://www.sample.com',
            'query' =&gt; '',
            'fragment' =&gt; '',
            'force' =&gt; 0,
            'immediate' =&gt; 0,
          ),
          '#type' =&gt; 'action',
        ),
      ),
      '#version' =&gt; 6003,
    ),
  ),
)
You can define submit function in your password form_alter and then $form_state['redirect'] = 'user'; or 'user/register'