hard to say without seeing the machine in person.
If you smell something burnt inside, you have to figure out if it's the PSU or mobo or both.
Also, when you say "20 seconds after logging on it shuts down", are you saying that it will boot to Windows and then shut down?
Because you then state that after you unplug it and turn it back on it turns off after a few seconds.