You are here

function drd_server_domain_run_update in Drupal Remote Dashboard Server 6

Same name and namespace in other branches
  1. 6.2 drd_server.domain.inc \drd_server_domain_run_update()
  2. 7.2 drd_server.domain.inc \drd_server_domain_run_update()
  3. 7 drd_server.domain.inc \drd_server_domain_run_update()
1 string reference to 'drd_server_domain_run_update'
drd_server_xmlrpc in ./drd_server.module
Implementation of hook_xmlrpc().

File

./drd_server.domain.inc, line 87

Code

function drd_server_domain_run_update($sid) {
  global $user;
  $user = drd_server_load_user($sid);
  if (is_string($user)) {
    return drd_server_error($user);
  }
  $old_user = $user;
  $user = user_load(1);
  variable_set('site_offline', TRUE);
  $batch = array(
    'operations' => array(
      array(
        'drd_server_domain_find_required_updates',
        array(),
      ),
    ),
  );
  batch_set($batch);
  $batch =& batch_get();
  $batch['progressive'] = FALSE;
  $_GET['token'] = drupal_get_token('update');
  $_REQUEST['op'] = 'Update';
  $_POST['start'] = array();
  include_once './update.php';
  variable_set('site_offline', FALSE);
  drupal_set_message('Update completed');
  $result = theme('status_messages');
  $user = $old_user;
  return drd_server_result('run.update', $result);
}