Smart no code solution to get the current user that is filling in your infoPath 2007 form:
You can get the current user by using the build-in function “Username”
Drag an Expression box on the form, insert formula – insert function and choose Username.
Voila :p
via msdn