title: Override user_login_submit in Drupal 6 to redirect an authenticated user
body: <p>I would like to redirect a user that logged in over the user login block. What I have is a module that contains the following code:</p>
  
  <p>Appendix, 3.9.2011, 15:30h: Changed code according to the advice of kiamlaluno.</p>
  
  <p>Appendix, 3.9.2011, 17:08h: Small Fix: Changed node/admin to admin.</p>
  
  <p>Appendix, 3.9.2011, 17:24h: removed <code>[]</code> 
  -> code is working like this now, but do not forget to change the module priority in DB.</p>
  
  <pre><code>function _MYMODULE_user_login_submit($form, &amp;$form_state) {
    global $user;
    if ($user-&gt;uid == 1) {
      $form_state['redirect'] = 'admin';
    } elseif ($user-&gt;uid) {
      $form_state['redirect'] = 'node/add/image';
      return;
    }
  }
  
  /**
   * Modifies the outfit and behaviour of the user login block.
   */
  function MYMODULE_form_user_login_block_alter(&amp;$form, $form_state) {
      unset($form['#action']);
      // removes the forgot password and register links
      $form['links'] = array();
      // Redirects the user to the image upload page after login
      // This cannot be done by a rule, the rule based redirect is only
      // working for the login page not the user login block.
      $form['#submit'] = array('_MYMODULE_user_login_submit');
  } 
  </code></pre>
  
  <p>It doesn't redirect users; it seems like <code>_MYMODULE_user_login_submit()</code> is simply ignored.</p>
  
  <p>What I know already:</p>
  
  <ul>
  <li>I cannot use Rules/Triggers, because I do not login over the login page but the user login block</li>
  <li>It is always said: "use logintoboggan" on posts, but there I only have redirection options for "on registration" and "on confirmation", but I need "on authentication" or "after login".</li>
  <li>Anyway, I do not want to use more modules, I prefer a few lines of PHP.</li>
  </ul>