5
it happened again. the user received around 90 emails of the same notification. my hosting provider replying that their mailing server is alright and there is something on my site. the notification sending script modules/catads/adsmode.php has been heavily hacked before but it worked alright till i upgraded to 2.4. maybe some code incompatibility? guys plz check the code:
//notifications hack
$user_handler =& xoops_getmodulehandler('profile', 'profile');
$criteria1 = new CriteriaCompo(new Criteria('source_language', $ads->getVar('ads_lang1')));
$criteria1->add(new Criteria('target_language', $ads->getVar('ads_lang2')));
$criteria2 = new CriteriaCompo(new Criteria('source_language', $ads->getVar('ads_lang2')));
$criteria2->add(new Criteria('target_language', $ads->getVar('ads_lang1')));
$criteria = new CriteriaCompo($criteria1);
if ($vice_versa == 1) {
$criteria->add($criteria2, 'OR');
}
$users = $user_handler->getList($criteria);
unset($criteria, $criteria1, $criteria2);
//hack if no user found
if (!is_array($users)|| (count($users) == 0)) {
$users = array('999999999'); //this a userid that will not be found.
}
//end of hack
$user_list = array_keys($users);
$notification_handler->triggerEvent('global', 0, 'new_ads', $tags, $user_list);
//end of hack
$notification_handler->triggerEvent('category', $cat_id, 'new_ads', $tags, $user_list);
$notification_handler->triggerEvent('ads', $ads_id, 'approve', $tags);
} else {
$messagesent = _AM_CATADS_ERROR_UPDATE;
}
redirect_header("index.php?op=show&sel_status=2", 1, $messagesent);
exit();
}