Step 11 in the tutorial goes like this: Now go back to qa-external-users.php and read it through in full. You will need to modify several functions in order to complete the single sign-on integration. Everything is explained in this file, and lots of examples are included.
You might have missed something in that file. In short, you define who is logged in or not. That is handled in the qa_get_logged_in_user function in the qa-external-users.php file. You shouldn't be changing any code in Drupal.