Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7611355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:38:59+00:00 2026-05-31T01:38:59+00:00

Joomla 1.7.2 : I fear I’m making this more difficult than it needs to

  • 0

Joomla 1.7.2: I fear I’m making this more difficult than it needs to be. Here’s what I need to do:

if( !$this->userInUserGroup() ){
    // Log the user out
    // Redirect to home page displaying system message
    $this->setRedirect( '/', 'You must be in Usergroup XYZ to log in to this website.', 'error' );
    $this->redirect();
}

This does not work as I cannot log the user out. session_destroy() does not work, as it eliminates the error message data invoked with $this->setRedirect().

I thought about modifying the login module, but I’d prefer to not modify the core if I can help it. This method would be comfortably restricted to my ComponentController class.

Thanks for any help you can provide!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:39:01+00:00Added an answer on May 31, 2026 at 1:39 am

    ShaneC you can use the mainframe’s logout method.

    global $mainframe;
    
    $mainframe->logout();
    

    or

    $mainframe = JFactory::getApplication();
    $mainframe->logout();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Joomla project, I need a user registration module, which has 3 kind
Joomla has a built-in function on its login screen I've forgotten my user name,
In Joomla 1.0, the current User object was stored in a global variable called
I am developing a Joomla component and one of the views needs to render
I'm using Joomla 1.5.22. I tried to manually insert a new user to the
how to validate joomla default text editor on blur using jQuery? This is the
I am running Joomla! 2.5.1 for my website. I wish to have this mass-registration
I am new to Joomla and this is my first project in Joomla. I
Can Joomla's DB object add multiple rows at once? MySQL can do this like
I am using joomla 1.0.13 and i am trying to access JACLplus but this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.