0

enter image description here

Joomla Version: 3.4 Possible related extension: Community Builder

This is the form of a logout button on my site, the method being "post" means when users click "logout", a $_POST or #_REQUEST is being generated. I think no matter what libraries or framework Joomla is using, there should still be somewhere directly taking care of these variables. So I search $_POST and $_REQUEST among all *.php files, but I couldn't find anything that seem to be what I am seeking.

So where is the code?

2

2 Answers 2

2

Its received by JInput which is instantiated in JApplicationBase::_construct().

By default it's source is $_REQUEST like you can see here.

1

In Joomla, the POST,GET,REQUEST method is achieved through jinput .

Example Code:

$jinput= JFactory::getApplication()->input; $data = $app->post->get('variablename','defaultvalue','filter'); Refernce Link: https://docs.joomla.org/Retrieving_request_data_using_JInput

For logout method, a task is defined here:

<input type="hidden" name="task" value="user.logout">

Tasks are defined in master/sub-controllers which are basically functions.

For this go to components/com_users/controllers/user.php

In this file, you will find a logout function which performs the logout methodology.

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.