Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
098b42eb
Commit
098b42eb
authored
May 31, 2007
by
Donal McMullan
Browse files
Fix the xmlrpc_server_url value
parent
af1ef745
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/api/xmlrpc/client.php
View file @
098b42eb
...
...
@@ -24,6 +24,9 @@
*
*/
defined
(
'INTERNAL'
)
||
die
();
require_once
(
$CFG
->
docroot
.
'/api/xmlrpc/lib.php'
);
class
Client
{
private
$requesttext
=
''
;
...
...
@@ -47,8 +50,10 @@ class Client {
function
send
(
$wwwroot
)
{
$this
->
peer
=
get_peer
(
$wwwroot
);
$this
->
response
=
''
;
$URL
=
$this
->
peer
->
wwwroot
.
$this
->
peer
->
application
->
xmlrpcserverurl
;
$ch
=
curl_init
(
$URL
);
$ch
=
curl_init
(
$this
->
peer
->
wwwroot
.
$this
->
peer
->
xmlrpcserverurl
);
$this
->
requesttext
=
xmlrpc_encode_request
(
$this
->
method
,
$this
->
params
,
array
(
"encoding"
=>
"utf-8"
));
$this
->
signedrequest
=
xmldsig_envelope
(
$this
->
requesttext
);
$this
->
encryptedrequest
=
xmlenc_envelope
(
$this
->
signedrequest
,
$this
->
peer
->
certificate
);
...
...
@@ -56,12 +61,13 @@ class Client {
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
$this
->
timeout
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_setopt
(
$ch
,
CURLOPT_POST
,
true
);
curl_setopt
(
$ch
,
CURLOPT_USERAGENT
,
'M
oodle
'
);
curl_setopt
(
$ch
,
CURLOPT_USERAGENT
,
'M
ahara
'
);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$this
->
encryptedrequest
);
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
array
(
"Content-Type: text/xml charset=UTF-8"
));
$timestamp_send
=
time
();
$this
->
rawresponse
=
curl_exec
(
$ch
);
$timestamp_receive
=
time
();
$remote_timestamp
=
null
;
...
...
@@ -73,7 +79,6 @@ class Client {
try
{
$xml
=
new
SimpleXMLElement
(
$this
->
rawresponse
);
}
catch
(
Exception
$e
)
{
echo
'a'
;
exit
;
throw
new
Exception
(
'Payload is not a valid XML document'
,
6001
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment