Thank you, nicolas, for your quick answer!
At the moment I am trying to make it more simple.
I need the information ("a certain joomla user payed a certain article") in an external script.
For better comprehension:
I have a Webservice (written in C#) contacting a PHP script to figure out, if a) an assigned user-password-combination exists in Joomla and b) the user has payed a certain article.
For a) I used this code:
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);
define('JPATH_BASE', dirname(__FILE__) . DS . '..'); // assuming we need to go up 1 step to get to the Joomla root
require_once (JPATH_BASE .DS. 'includes' .DS. 'defines.php');
require_once (JPATH_BASE .DS. 'includes' .DS. 'framework.php');
require_once (JPATH_BASE .DS. 'libraries' .DS. 'joomla'. DS. 'user' .DS. 'authentication.php');
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
$credentials = array(
'username' => $this->username,
'password' => $this->password);
$options = array();
$authenticate = JAuthentication::getInstance();
$response = $authenticate->authenticate($credentials, $options);
if ($response->status === JAUTHENTICATE_STATUS_SUCCESS) {
return true;
}
else {
return false;
}
Is there a solution similarly short and easy solution for
b)? Maybe I could call a hikashop script with assigned email address, username and article and the information returned is true, if the user (has bought the article and) has payed for it someday?