How to destory conference if moderator left the conference

I have added some code on muc-occupent-left, it destroys the room but if the user reloaded the page. it will become the moderator or automatically rejoin. i want to move the user on the login page.

second one how to fix a password for room/conference.