Fix for two factor authrezation.

https://groups.google.com/forum/#!topic/joomla-dev-general/08MfD2V11Bc

It is not excactly 100 % identical. some code removed, i am not abselutly sure it is correct.

just trying to make this to push it allong.!