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 8847755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:16:00+00:00 2026-06-14T12:16:00+00:00

When one of our Registered users places an order, we have a plugin that

  • 0

When one of our “Registered” users places an order, we have a plugin that successfully adds them to another User Group called “Customer”. This works very nicely in the flow of things using JUserHelper::addUserToGroup().

The problem is that even though the user record IS correctly updated, they’re already logged in, so they are forced to log out and back in to have the necessary ACL that they need.

I’ve hunted through all the jUser code and docs, and cannot find a way to alter the currently logged in user that is yielded by $user =& JFactory::getUser();.

I expect the answer may be obvious to someone who understands the Joomla MVC better than I, but my head is reeling with all the code I’ve read trying to find a way to accomplish this.

UPDATE:

Lodder’s answer below technically works, but while the “User Groups” ARE actually being updated, the AuthGroups and AuthLevels are not. After my code is run, the $user object DOES show the groups there in, but further down in the object,

        [_authGroups:protected] => Array
            (
                [0] => 1
                [1] => 2
            )

        [_authLevels:protected] => Array
            (
                [0] => 1
                [1] => 1
                [2] => 2
            )

There appears to be no way to change this in the current session because it’s all protected, and the only place it’s updated is in user.php at $identities = $this->getAuthorisedGroups();, which only executes on the first time it’s encountered.

  • 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-06-14T12:16:01+00:00Added an answer on June 14, 2026 at 12:16 pm

    I found this but I’m not 100% sure if it will work in your situation. Best give it a try:

    $user = JFactory::getUser();
    if ($user->id == $user['id']){
       $session = JFactory::getSession();
       $session->set('user', new JUser($user->id));
    }
    

    It has been known to work for a few people.

    Let me know if it works and if not, I’ll see what else I can find.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following COM object installed on one of our servers that I
As part of one our system's we enable a user in the backoffice to
One of our user did an insert statement in development server. The insert worked
There are times when we need a registered member on our website that allows
Hi guys we have following structure in one of our project's pages: <asp:UpdatePanel ID=up1
I have a users table, the user ID is public. But I want to
One of the requirements proposed for an ASP.NET application is that we have Session
Our website lets users create small widgets that can be embedded on other third
One of our servers has 4 gb of data. But as of now i
One of our products contains multiple WCF services whose business layers all sit on

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.