You are here

function drd_server_error in Drupal Remote Dashboard Server 7.2

Same name and namespace in other branches
  1. 6.2 drd_server.module \drd_server_error()
  2. 6 drd_server.module \drd_server_error()
  3. 7 drd_server.module \drd_server_error()

Prepare an error message for returning to the XMLRPC caller.

Parameters

mixed $message: The message to be sent to the XMLRPC caller.

int $code: An optional error code which determines whether the result can be encrypted before it's returned to DRD.

Return value

string Returns the encoded message.

6 calls to drd_server_error()
drd_server_domain_reset_user1 in ./drd_server.domain.inc
Define name and password for the special user 1.
drd_server_execute in ./drd_server.module
This is called to execute one of the actions that are defined on one of the hook_drd_server_actions().
drd_server_key in ./drd_server.module
This is called to update the excryption keys for this server and all it's domains hosted in the same Drupal installation.
drd_server_server_php_error_log in ./drd_server.server.inc
DRD Action to retrieve the PHP error log from the OS.
drd_server_svn_config_read in ./drd_server_svn.module
Extra parameter: $options

... See full list

File

./drd_server.module, line 987
Provides XMLRPC implementation to respond to requests from DRD.

Code

function drd_server_error($message, $code = 1) {
  if (is_object($message)) {
    $message = (array) $message;
  }
  if (is_array($message)) {
    $message = implode(' ', $message);
  }
  $encrypt = !in_array($code, array(
    DRD_SERVER_ERROR_WRONG_REFERER,
    DRD_SERVER_ERROR_NO_REFERER,
    DRD_SERVER_ERROR_MISSING_AES,
    DRD_SERVER_ERROR_WRONG_KEYS,
  ));
  return drd_server_output(xmlrpc_error($code, strip_tags($message)), $encrypt);
}