The serverhost I uses on one of my sites has disable exec command. So if I go to user/%/troll I get a lot of php errors in the log for every IP address that the user has visit the site from.

I can easy remove that short text of code in the troll.admin.inc. But I think there are problably some more users out there that has the same "problem".

So a request from my side is to have a checkbox in the troll settings, to use exec or not. Then just a simple if-else around that code where the exec command is used.

CommentFileSizeAuthor
#2 troll-948334.patch1.51 KBScyther
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Scyther’s picture

Example:

function troll_admin_settings() {

  ...
  ...
  ...

  // Add this

  $form['exec_command'] = array(
    '#type' => 'fieldset',
    '#title' => t('Exec command'),
  );
  $form['exec_command']['troll_exec_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable exec'),
    '#description' => t('Enable exec for DNS lookup on IP addresses.'),
    '#default_value' => variable_get('troll_exec_enabled', 1),
  );

  return system_settings_form($form);
}

  // Replace 

  $rows[] = array($ip->ip_address, $status, format_date($ip->accessed, 'large'), format_date($ip->created, 'large'), exec('host '. $ip->ip_address));

  // with 

  if (variable_get('troll_exec_enabled', 1)) {
    $rows[] = array($ip->ip_address, $status, format_date($ip->accessed, 'large'), format_date($ip->created, 'large'), exec('host '. $ip->ip_address));
  }
  else {
    $rows[] = array($ip->ip_address, $status, format_date($ip->accessed, 'large'), format_date($ip->created, 'large'), '');
  }

Scyther’s picture

Status: Active » Needs review
FileSize
1.51 KB

Here is a patch for my example.

Scyther’s picture

Any update?

mgifford’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

If this is still an issue, please re-open and upgrade version to D7. Drupal 6 is no longer being maintained.