1
wishcraft
Basi User Sign-up sentry for XOOPS 2.5 with preloaders

This is way of having a signup sentry on your XOOPS 2.5 site these are the following files:-

/modules/systems/preloads/sentry.php

<?php /** * System Preloads * * You may not change or alter any portion of this comment or credits * of supporting developers from this source code or any supporting source code * which is considered copyrighted (c) material of the original comment or credit authors. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @author Simon Roberts (AKA +61405130385) * @version $Id: xortify.php 8066 2011-11-06 05:09:33Z beckmi $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); class SystemSentryPreload extends XoopsPreloadItem { function eventCoreFooterEnd($args) { $criteriaAvarta = new Criteria('user_avarta', '%blank.gif%', 'LIKE'); $criteriaNewReg = new CriteriaCompo(new Criteria('user_regdate', time() - 2 * 24 * 3600, '<=')); $criteriaNewReg->add(new Criteria('last_login', 0)); $criteriaIdle = new CriteriaCompo(new Criteria('last_login', time() - 24 * 7 *4 * 24 * 3600, '<')); $criteriaIdle->add(new Criteria('last_login', 0, '<>')); $criteriaFirst = new CriteriaCompo($criteriaAvarta); $criteriaFirst->add($criteriaNewReg); $criteria = new CriteriaCompo($criteriaFirst); $criteria->add($criteriaIdle, "OR"); $user_handler = xoops_gethandler('user'); $tokill = array(); foreach($user_handler->getObjects($criteria, true) as $key => $user) { if (!$user->isAdmin() && in_array(XOOPS_GROUP_USER, $user->getGroups())) $tokill[$user->getVar("uid")] = $tokill; } if (!empty($tokill)) { xoops_loadLanguage('user'); $xoopsMailer =& xoops_getMailer(); $xoopsMailer->useMail(); $xoopsMailer->setTemplate('deletion.tpl'); $xoopsMailer->setSubject(sprintf("Your account on '%s' has been deleted by the sentry!", $xoopsConfig['sitename'])); $xoopsMailer->setToUsers($tokill); @$xoopsMailer->send(); $GLOBALS["xoopsDB"]->queryF("DELETE FROM `" . $GLOBALS["xoopsDB"]->prefix('users') . "` WHERE UID IN(" . implode(", ", array_keys($tokill)) . ")"); $GLOBALS["xoopsDB"]->queryF("DELETE FROM `" . $GLOBALS["xoopsDB"]->prefix('groups_users_link') . "` WHERE UID IN(" . implode(", ", array_keys($tokill)) . ")"); } } } ?>



/language/english/mail_template/deletion.tpl

le="color: #000000"><?php Your account "{X_UNAME}" at {SITENAME} has been deleted automatically by our sentry. This is because you either creating the account have not changed your avarta within 2 days or you have not logged-on within 24 months! You can not login anymore and you account is no longer active. ----------- {SITENAME} ({SITEURL}) webmaster {ADMINMAIL}

Who's Online

204 user(s) are online (142 user(s) are browsing Support Forums)


Members: 0


Guests: 204


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits