This is not the variable to be checking I believe.  Secret Key can be set to a default value like 0 and this may return.  I think the proper method is isTFAEnabled(). @xillibit can probably confirm my thinking.

Also please move login = KunenaLogin::getInstance(); to the top of the file.