StikkBomber, thank you for showing me the thread. I followed it and eventually installed the pluggin from here. https://carthik.net/blog/vault/2005/05/12/registered-only-plugin-reworked/
which was exactly what I need. But I got a problem, on the login page, the register link does not seems to work. It loads the same page again instead of another form to register…