1
I would want if anti spam system could be inserted in XOOPS 2.5 in this two days 3 spammers get in to the web so after deleting comments with phpmyadmin i make a hack in XOOPS 2.4 and show that XOOPS 2.5 has same system.
I changed this file.
modules/profile/admin/deactivate.php
From
$user->setVar('level', $_REQUEST['level']); if ($member_handler->insertUser($user)) { if ($_REQUEST['level'] == 1) { $message = _PROFILE_AM_USER_ACTIVATED; } else { $message = _PROFILE_AM_USER_DEACTIVATED; } } else { if ($_REQUEST['level'] == 1) { $message = _PROFILE_AM_USER_NOT_ACTIVATED; } else { $message = _PROFILE_AM_USER_NOT_DEACTIVATED; } }
To
if ($member_handler->insertUser($user)) { if ($_REQUEST['level'] == 1) { $message = _PROFILE_AM_USER_ACTIVATED; } else { $message = _PROFILE_AM_USER_DEACTIVATED . '
'; } } else { if ($_REQUEST['level'] == 1) { $message = _PROFILE_AM_USER_NOT_ACTIVATED; } else { $message = _PROFILE_AM_USER_NOT_DEACTIVATED; } }
and created the file
modules/profile/admin/spamremove.php
include 'header.php'; xoops_cp_header(); if (!isset($_REQUEST['uid'])) { redirect_header("index.php", 2, _PROFILE_AM_NOSELECTION); } $member_handler = xoops_gethandler('member'); $user = $member_handler->getUser($_REQUEST['uid']); if (!$user || $user->isNew()) { redirect_header("index.php", 2, _PROFILE_AM_USERDONEXIT); } if (in_array(XOOPS_GROUP_ADMIN, $user->getGroups())) { redirect_header("index.php", 2, _PROFILE_AM_CANNOTDEACTIVATEWEBMASTERS); } $user->setVar('level', $_REQUEST['level']); if ($member_handler->insertUser($user)) { if ($_REQUEST['level'] == 1) { $message = "Spam Removed " . $xoopsDB->query('delete from '.$xoopsDB->prefix('xoopscomments').' where com_uid = '. $user->getVar('uid') ); } } else { if ($_REQUEST['level'] == 1) { $message = _PROFILE_AM_USER_NOT_ACTIVATED; } else { $message = _PROFILE_AM_USER_NOT_DEACTIVATED; } } redirect_header("../userinfo.php?uid=" . $user->getVar('uid'), 3, $message); ?>
File can be downloaded from here.
http://sourceforge.net/projects/esxoops/files/XOOPS%20Scripts/antispam.zip/download