Joomla 3.X – Log Out And Return To Home Page

I used this set up to for logging users out of Joomla and return them to the home page.

  1. I installed Sourcer plug-in to run some PHP. Just a great plug-in to use any ways.
  2. I create a link in the main menu and set it to registered, so once the login in it shows.
  3. Create an article called “logout” and add the following code to that page.

{source}

<?php

$mainframe =JFactory::getApplication(); $mainframe->logout();

$allDone=&JFactory::getApplication();

$allDone->redirect(‘/’);

?>
{/source}

I hope this helps someone else out there…

 

1 Comments

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.