XML-RPC error (Access denied)

  • Sanjay Pal
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #1 by Sanjay Pal
XML-RPC error (Access denied) was created by Sanjay Pal
Hi All,

Can you please reply any update to

www.joomdle.com/en/forum/r04-no-longer-s...-method?limitstart=0

I am really in need of this... :sick:

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

More
13 years 6 months ago #2 by Chris
Replied by Chris on topic XML-RPC error (Access denied)
Sorry I am not sure what you are looking for. That thread was 'solved'. If you are asking has the connectivity changed? No you still require IP addresses to connect Joomla and Moodle.

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

  • Sanjay Pal
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #3 by Sanjay Pal
Replied by Sanjay Pal on topic XML-RPC error (Access denied)
Hello Chris,

Thank you very much for your reply.
As mentioned in that post, I am facing same problem as the server on which the Moodle 2.2 + Joomla 1.5 is installed is configured on AWS with load balancing. So whenever System Check is done, it toggles between two ips and last option turns to red crossed.

I need help with patching in php scripts so that it can work with both the ip address.

Please let me know if I am able to make you understand what I mean.

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

More
13 years 6 months ago #4 by Chris
Replied by Chris on topic XML-RPC error (Access denied)
I understand what you mean. At this time Joomdle is looking for 1 IP address. As yours is only the second request for such a modification, it is low on our priorities. Naturally, if you wish to sponsor such a development I can speak with Antonio on the time required and associated costs to make this happen.

Chris

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

  • Sanjay Pal
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 5 months ago #5 by Sanjay Pal
Replied by Sanjay Pal on topic XML-RPC error (Access denied)
Hi Chris,

Many thanks.
I am able to hack the script and now application is accepting two ips.

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

More
13 years 5 months ago #6 by Chris
Replied by Chris on topic XML-RPC error (Access denied)
Excellent. Perhaps you can share the code so that:
- others can benefit from your experience
- we can include the code in a future release, if appropriate, saving you the need to hack future versions.

Regards

Chris

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

  • Sanjay Pal
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 5 months ago #7 by Sanjay Pal
Replied by Sanjay Pal on topic XML-RPC error (Access denied)
Hi Chrish,
Yeah sure, i will share the modified script.
We have made changes in joomla/plugins/xmlrpc/joomdle.php
function check_origin ()
{
$request_ip = JRequest::getVar ('REMOTE_ADDR', '', 'server');
$comp_params = &JComponentHelper::getParams( 'com_joomdle' );
$moodle_url = $comp_params->get( 'MOODLE_URL' );
$url = parse_url ($moodle_url);
$domain = $url;
$moodle_ip = gethostbyname ($domain);

//echo $moodle_ip = gethostbyname ($domain);
//echo "<br>".$request_ip;
//echo "IPPPP:: ".$_SERVER;
//exit;

$plugin =& JPluginHelper::getPlugin('xmlrpc','joomdle');
$params = new JParameter( $plugin->params );

// if IP configured, check it
$configured_moodle_ip = $params->get('moodle_ip');
//$configured_moodle_ip = "10.128.73.104";
//return true;
if ($configured_moodle_ip){
$ips = explode(',', $configured_moodle_ip);
$ipList = array();
foreach($ips as $ip){
$ipList[] = trim($ip);
}
return in_array($request_ip, $ipList);
//return ($request_ip == $configured_moodle_ip);
}
// else, check public ip
return ($request_ip == $moodle_ip);
}


Please let us know if this is proper or need some modification to work smoothly in future realeases.

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