How To / General

Trigger fresh moodle login after Virtuemart order?

  • michaelhermary
  • Topic Author
  • Offline
  • Banned
  • Banned
More
10 years 1 month ago #1 by michaelhermary
We're using an external database for Moodle course enrolment, and with Joomdle, students are being logged into Moodle before their Virtuemart payment is completed, which means when they go into the Moodle, they don't yet have access to their course - not until they log out and back in again, which is confusing for many of them.

How could we trigger a fresh moodle login after an order is confirmed? I believe this could be done using a Joomdle moodle login that would be called from the Virtuemart thank you page after an order is completed. Or if that's not possible, is there a way to at least trigger a logout at that time?

We're on Joomla 3.4.8, Moodle 1.9, and Joomdle 0.95.

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #2 by Antonio Durán
Replied by Antonio Durán on topic Trigger fresh moodle login after Virtuemart order?
I guess you could add code on thank you page to log the user out.
It would be something like this:
Code:
$mainframe = JFactory::getApplication('site'); $id = JUserHelper::getUserId($username); $error = $mainframe->logout($id, array ( 'clientid' => 0));

Please Log in or Create an account to join the conversation.