Personalize login, logout, 404, and other resources


I am using z2jh and would like to stop the user’s server upon logout. So i need to override the logout function. how can I do that?
in addition, I would like to personalize login, logout and 404 pages based on the user, i.e., pass some user’s data to these pages and render them there. how would it be possible?