login redirect

Hi, I am trying to add something to the login view In yii, but I only want to do this if the user was redirected to that page by trying to access other controller/action.

Is there a way to know if the user was redirected or accessed the login link directly?