Php Login/Logout with XML-Driven Menu?

I have been working with Senocular’s XML-Driven Drop down menu tutorial. I’m not too conserned with appearance at the moment, I prefer function first. I have the menu working perfectly with the pages loading in the same window etc… It’s a great tutorial I really appreciate you sharing this knowledge. Here’s my problem tho:

I am planning on implementing this menu into a php site that uses phpbb for most of it. This may be a simple thing and I’m overlookg it, but how can I use this menu for the dynamic login?

What I want to do:

  1. Have the menu display a login and register entry when user is not logged in
  2. Have the menu display log out when a regular user is logged in
  3. Have Moderator controls displayed when a moderator is logged in
  4. Have Admin controls displayed when Admin is loged in

Is this possible? If so, what do I need to do? If Not, what are my alternatives?

Thanks
Pyrael