Problems creating new login module.

I have designed a layout where the login form would appear in the header of the page rather than in the main content. To achieve this I have extended a portlet and copied most of the login action code and given then form new styles to be quite small. This all works fine until I attempt to login.

On a failed attempt it will print the standard error message that I would like to overwrite with a more subtle message that would appear above my new form. On a successful attempt I receive the error: TinyLoginPortlet does not have a method named "redirect".

This is because I copied the following code


where obviously $this is not valid in the portlet.

This had me thinking. Am I going about this the wrong way? can anyone suggest a better way for me to achieve this task?



Thanks for the response Mike.

That fixed it.