title: Drupal 6: Modifying uid of a submitted node
body: <p>I have a situation where I want a set of users (employees) to be able to create a node, but to replace the uid (user ID) with that of the users profile currently displayed.</p>
  
  <p>In other words, I have a block that that calls a form for a content type. If an employee (uid = 20) goes to a clients page (uid =105), and fills out the form, I want the uid associated with the form to be the client's(105), not the employee's. </p>
  
  <p>I'm using arg(1) to grab the Client's uid - here is what I have..</p>
  
  <pre><code> &lt;?php
  function addSR_form_service_request_node_form_alter(&amp;$form, $form_state) {
         if (arg(0) == 'user' &amp;&amp; is_numeric(arg(1))) {
          $form['#submit'][] = 'addSR_submit_function';
      }
  }
  
  function addSR_submit_function($form, $form_state) {
      $account = user_load(arg(1));
      $form_state['values']['uid'] = $account-&gt;uid;
      $form_state['values']['name'] = $account-&gt;name;
  }
  
  ?&gt;
  </code></pre>
  
  <p>The form is loading in the block, but when submitted, is still showing the employee uid. I don't want to use hook_form_alter because I don't want to modify the actual form, because clients can fill out the form directly, in this case, I don't want to modify the form at all.</p>
  
  <p>I'm also ashamed that I'm putting this in a block, but I couldn't think of a way to put this in a module, so any suggestions on that would also be appreciated...</p>