hook_form_alter checking $user->uid == $node->uid
hey You can simply do this :-

function custom_form_alter(&amp;$form, $form_state, $form_id) 
 { 
    global $user;
    $node = node_load(arg(1));
    if($form_id=='custom_type_node_form')
     {
       if($user-&gt;uid == $node-&gt;uid)
        {
          $form['#attributes'] = array('class' =&gt; 'test-class');
        }
      }
}


I hope this will work for you.