Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_sidebar.php on line 8

Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_menu.php on line 278

VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: User must log out to see effect of group change

User must log out to see effect of group change 19 May 2016 12:24 #1

Hi,
I got the plug-in working and now when an order is placed, the customer is placed in the Joomla! "Customer" group. This should allow the user to view additional menus on the site that are available only to customers. However, the user has to log out and then back in again before these menus appear. It seems to me the session needs to be updated the new group membership information.
I found an article about this issue at www.ostraining.com/support-forum/joomla-...-s-group-membership/
Perhaps the plug-in needs to do something along the lines of:
$session = JFactory::getSession();
$session->set('user', new JUser($currentUser->id)); // Force load from database
It would be nice to avoid making the user log in again to access the restricted areas.
Thanks.
The administrator has disabled public write access.

User must log out to see effect of group change 21 May 2016 00:59 #2

Dear John,
Thank you for the suggestion and even the effort to investigate possible solutions.

A while back I already investigated this issue, but I couldn't find a proper solution. The main issue is that order status changes usually don't happen on a page load, where the user's session comes into play, but typically either through the payment gateway sending the payment notification to the server or through the admin manually changing the order status. The Payment gateway's IPN (instant payment notification) message is usually a normal http-call from the payment server to VirtueMart. However, the payment gateway is technically completely different from the user, so when the payment gateway indicates a successfull payment and VM changes the order status to Confirmed, the user's session is NOT available (it would be the payment gateway's session, but that one is not logged in for apparent reasons). So, modifying the user's session is not possible at that point.

The only other way I can see to have the user's group changes have an immediate effect on the current session is to force loading the user from the database for every page call. Clearly this is overkill and a performance killer (somehow defeats the purpose of caches and session storage).

So, for now I don't really know of any proper technical solution to have group changes effect the user's session immediately.

Best regards,
Reinhold
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular