How to get user's IP address?

Hi:

I want to store the user’s IP address upon logging in. How do I do that?

Moreover, I don’t want this to affect the update_time attribute automatically updated by CTimeStampBehavior, as I want that to track other changes to the user’s record.

Thanks for the help.

You can get the user IP Address by calling userHostAddress http://www.yiiframework.com/doc/api/CHttpRequest#userHostAddress-detail