1
aitor
xoops 2.5 antispammer?
  • 2010/2/7 14:40

  • aitor

  • Not too shy to talk

  • Posts: 148

  • Since: 2002/1/2 2


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 '<br> <form method="post" action="spamremove.php?id=' $user->getVar('uid') . '"> <input type="hidden" name="uid" value="11091" /> <input type="hidden" name="level" value="1" /> <input type="button" value="Borrar_Spam" onclick="submit();" /> </form> '; } } 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

<?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


Login

Who's Online

212 user(s) are online (145 user(s) are browsing Support Forums)


Members: 0


Guests: 212


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits