Heya,
Thought I'd post the code of check4hack.php written by the OP. It is really short, and maybe someone browsing this can say, "oh, well that needs to be set when called by cron automatically vs. run 'by hand'" or something?
Code:
<?php
/*======================================================================*\
|| #################################################################### ||
|| # Check4Hack by Hoffi # ||
|| #################################################################### ||
\*======================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db))
{
exit;
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
// Send the reminder email only once.
$infections = $vbulletin->db->query_read("SELECT title FROM " . TABLE_PREFIX . "datastore WHERE data LIKE '%base64%'");
//vbmail_start();
$send = false;
$storages = array();
$recipent = ($vbulletin->options['check4hack_email']?$vbulletin->options['check4hack_email']:$vbulletin->options['webmasteremail']);
while ($infect = $vbulletin->db->fetch_array($infections))
{
$storages[] = $infect['title'];
$send = true;
echo $infect['title']."-";
}
foreach($storages as $item)
{
switch ($item)
{
// During the following found Items, the Datastore need to rebuild.
case 'pluginlist':
vBulletinHook::build_datastore($vbulletin->db);
break;
}
}
if ($send)
{
vbmail($recipent,$vbphrase['c4h_subject'],construct_phrase($vbphrase['c4h_body'], implode(", ",$storages)));
log_cron_action("whodahtest1 ".$recipent, $nextitem, 1);
log_cron_action("whodahtest2 ".$vbphrase['c4h_subject'], $nextitem, 1);
log_cron_action("whodahtest3 ".construct_phrase($vbphrase['c4h_body'], implode(", ",$storages)), $nextitem, 1);
log_cron_action(implode(", ",$storages), $nextitem, 1);
}
vbmail_end();
?>