Those 3 ifs that are checking $this->isTempUser() probably can be collapsed.