Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mnet/xmlrpc/serverlib.php File Reference

Go to the source code of this file.

Data Structures

class  mnet_server_exception

Functions

 mnet_server_strip_encryption ($HTTP_RAW_POST_DATA)
 mnet_server_strip_signature ($plaintextmessage)
 mnet_server_fault ($code, $text, $param=null)
 mnet_server_fault_xml ($code, $text, $privatekey=null)
 mnet_server_prepare_response ($response, $privatekey=null)
 mnet_server_dispatch ($payload)
 mnet_system ($method, $params, $hostinfo)
 mnet_server_invoke_plugin_method ($method, $callstack, $rpcrecord, $payload)
 mnet_server_invoke_dangerous_method ($includefile, $methodname, $method, $payload)
 mnet_keyswap ($function, $params)
 mnet_verify_permissions ($rpcrecord)
 mnet_setup_dummy_method ($method, $callstack, $rpcrecord)
 mnet_server_dummy_method ($methodname, $argsarray, $functionname)

Function Documentation

mnet_keyswap ( function,
params 
)

Accepts a public key from a new remote host and returns the public key for this host. If 'register all hosts' is turned on, it will bootstrap a record for the remote host in the mnet_host table (if it's not already there)

Parameters:
string$functionXML-RPC requires this but we don't... discard!
array$paramsArray of parameters $params[0] is the remote wwwroot $params[1] is the remote public key
Returns:
string The XML-RPC response

Definition at line 526 of file serverlib.php.

Here is the call graph for this function:

mnet_server_dispatch ( payload)

If security checks are passed, dispatch the request to the function/method

The config variable 'mnet_dispatcher_mode' can be: strict: Only execute functions that are in specific files off: The default - don't execute anything

Parameters:
string$payloadThe XML-RPC request
Exceptions:
mnet_server_exception
Returns:
No return val - just echo the response

What has the site administrator chosen as his dispatcher setting? strict: Only execute functions that are in specific files off: The default - don't execute anything

Definition at line 248 of file serverlib.php.

Here is the call graph for this function:

mnet_server_dummy_method ( methodname,
argsarray,
functionname 
)

Dummy function for the XML-RPC dispatcher - use to call a method on an object or to call a function

Translate XML-RPC's strange function call syntax into a more straightforward PHP-friendly alternative. This dummy function will be called by the dispatcher, and can be used to call a method on an object, or just a function

The methodName argument (eg. mnet/testlib/mnet_concatenate_strings) is ignored.

Exceptions:
mnet_server_exception
Parameters:
string$methodnameWe discard this - see 'functionname'
array$argsarrayEach element is an argument to the real function
string$functionnameThe name of the PHP function you want to call
Returns:
mixed The return value will be that of the real function, whatever it may be.

Definition at line 647 of file serverlib.php.

Here is the call graph for this function:

mnet_server_fault ( code,
text,
param = null 
)

Return the proper XML-RPC content to report an error in the local language.

Parameters:
int$codeThe ID code of the error message
string$textThe full string of the error message (get_string will not be called)
string$paramThe $a param for the error message in the lang file
Returns:
string $text The text of the error message

Definition at line 167 of file serverlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

mnet_server_fault_xml ( code,
text,
privatekey = null 
)

Return the proper XML-RPC content to report an error.

Parameters:
int$codeThe ID code of the error message
string$textThe error message
resource$privatekeyThe private key that should be used to sign the response
Returns:
string $text The XML text of the error message

Definition at line 183 of file serverlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

mnet_server_invoke_dangerous_method ( includefile,
methodname,
method,
payload 
)

Initialize the object (if necessary), execute the method or function, and return the response

Parameters:
string$includefileThe file that contains the object definition
string$methodnameThe name of the method to execute
string$methodThe full path to the method
string$payloadThe XML-RPC request payload
string$classThe name of the class to instantiate (or false)
Exceptions:
mnet_server_exception
Returns:
string The XML-RPC response

Definition at line 489 of file serverlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

mnet_server_invoke_plugin_method ( method,
callstack,
rpcrecord,
payload 
)

Invoke a normal style plugin method This will verify permissions first.

Parameters:
string$methodthe full xmlrpc method that was called eg auth/mnet/auth.php/user_authorise
array$callstackthe exploded callstack
stdclass$rpcrecordthe record from mnet_rpc
Returns:
mixed the response from the invoked method

Definition at line 463 of file serverlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

mnet_server_prepare_response ( response,
privatekey = null 
)

Package a response in any required envelope, and return it to the client

Parameters:
string$responseThe XMLRPC response string
resource$privatekeyThe private key to sign the response with
Returns:
string The encoded response string

Definition at line 222 of file serverlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

mnet_server_strip_encryption ( HTTP_RAW_POST_DATA)

-----XML-Envelope--------------------------------- | | | Encrypted-Symmetric-key---------------- | | |_____________________________________| | | | | Encrypted data------------------------- | | | | | | | -XML-Envelope------------------ | | | | | | | | | | | --Signature------------- | | | | | | |______________________| | | | | | | | | | | | | --Signed-Payload-------- | | | | | | | | | | | | | | | XML-RPC Request | | | | | | | |______________________| | | | | | | | | | | | |_____________________________| | | | |_____________________________________| | | | |________________________________________________|

Definition at line 36 of file serverlib.php.

Here is the call graph for this function:

mnet_server_strip_signature ( plaintextmessage)

Definition at line 98 of file serverlib.php.

Here is the call graph for this function:

mnet_setup_dummy_method ( method,
callstack,
rpcrecord 
)

Figure out exactly what needs to be called and stashes it in $remoteclient Does some further verification that the method is callable

Parameters:
string$methodthe full xmlrpc method that was called eg auth/mnet/auth.php/user_authorise
array$callstackthe exploded callstack
stdclass$rpcrecordthe record from mnet_rpc
Exceptions:
mnet_server_exception

Definition at line 588 of file serverlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

mnet_system ( method,
params,
hostinfo 
)

Execute the system functions - mostly for introspection

Parameters:
string$methodXMLRPC method name, e.g. system.listMethods
array$paramsArray of parameters from the XMLRPC request
string$hostinfoHostinfo object from the mnet_host table
Exceptions:
mnet_server_exception
Returns:
mixed Response data - any kind of PHP variable

Definition at line 358 of file serverlib.php.

mnet_verify_permissions ( rpcrecord)

Verify that the requested xmlrpc method can be called This just checks the method exists in the rpc table and is enabled.

Parameters:
stdclass$rpcrecordthe record from mnet_rpc
Exceptions:
mnet_server_exception

Definition at line 550 of file serverlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations