1

Topic: A couple of mods needed...

Hello, I need a couple of things.
Firstly I have alot of spammers joining up, so I want a mod where I can activate each account personally. Other forums have it. 'Your account needs approval by an administrator, you will be emailed when your account is active' is the kind of email you usually get

Secondly I need a mod so only administrators can see ip addresses, not moderators.

Anyone know if these features or tweaks are available?

chrz

Re: A couple of mods needed...

Moved to Modifications

3

Re: A couple of mods needed...

Okie, anyone got the info for these mods?
Chrz smile

Re: A couple of mods needed...

1. Set the default usergroup to one that can't see much of anything. Manually move people out of it.
2. I don't know that anyone has written that one.

5

Re: A couple of mods needed...

Hi, thanks for reply. Nah I dont want to do that. I know other forums have a setting so the administrator can approve accounts before they become active. That is the mod I need.

Also does anyone know a way of mass-deleting users? Im getting 20 spammers join per day & I dont want to delete each one individually as we have about 5000 now sad

Re: A couple of mods needed...

I'm not seeing the difference between what you want and what I'm suggesting. Turn off the permission to Read board for that group and they're essentially not activated.

As for mass deleting users, try the User Management plugin

7

Re: A couple of mods needed...

Its not that I dont want them posting on forum, I dont want them in my user list full stop, with names like 'cheap viagra' and 'britneyspearsnude' as user names. I would rather they werent able to register at all.

Re: A couple of mods needed...

Then that's not admin activation per-se, that's simply trying to block spam registrations. For example:

http://www.punres.org/desc.php?pid=347
http://www.punres.org/desc.php?pid=400

9

Re: A couple of mods needed...

If I am able to approve every registration, then that is admin activation, chrz

Re: A couple of mods needed...

Which is what I suggested with the usergroups. wink

11

Re: A couple of mods needed...

The usergroups solution sounds like it would work, but, like peepo said, having such names on your users list is annoying.

12

Re: A couple of mods needed...

It's simple enough to adapt the query in userlist.php to exclude that group from the results.

13 (edited by peepo 2008-03-27 17:50)

Re: A couple of mods needed...

spammers taken care of! smile
Now does anyone know how I can stop moderators from seeing ip addresses?

14

Re: A couple of mods needed...

peepo wrote:

Now does anyone know how I can stop moderators from seeing ip addresses?

Yup. smile

15

Re: A couple of mods needed...

Any parts of the code where the I.P address is output, enclose that code within:

if ($pun_user['g_id'] == PUN_ADMIN)
{
    [ I.P output code here ]
}

16

Re: A couple of mods needed...

ah brilliant, what file am I modifying for this?
Chrz

17

Re: A couple of mods needed...

Whichever files where the I.P address is displayed. Off the top of my head, there is viewtopic.php, userlist.php, profile.php, but probably more.

18 (edited by bbray 2008-04-17 17:38)

Re: A couple of mods needed...

I started to make a new post on the following information but this one isn't that old and is related to spam so i'll just put it here.

Here are the steps I have taken to deal with spam. this has been very effective so far as I'm getting 20-30 a day trying to get through but rarely ( maybe once a week) get actual spam posts on the board.

First off and I think this is the most effective step I modified the welcome message so that the spammers software can't find the login and password. this keeps them from automatically activating the account.  Just change the formating up and maybe the wording.

Secondly I created a shell script which I run from cron that does a delete on any account older than 24 hours with 0 posts and a group_id of 32000 I also note in the welcome email that the user has until midnight to finish the activation process.

Next I modified the code in <forum_root>/index.php which read:

$result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Unable to fetch newest registered user', __FILE__, __LINE__, $db->error());
$stats['last_user'] = $db->fetch_assoc($result);

to read:

$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE group_id != 32000 ORDER BY registered DESC LIMIT 1') or error('Unable to fetch newest registered user', __FILE__, __LINE__, $db->error());
$stats['last_user'] = $db->fetch_assoc($result);

This ensures only validated user names are displayed keeping offensive words off the page. I honestly think this is the way it should be since a user that hasn't completed the activation process isn't actually registered yet.

I also made a similar change to the query that brings up the total number of registered users and added a new query that displays the total number of unactivated accounts. the last change also requred em to add a line to the language file.
These changes have worked well for me so I wanted to share.

So to review here is the entire section of code:

// Collect some statistics from the database
$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users WHERE group_id != 32000') or error('Unable to fetch total user count', __FILE__, __LINE__, $db->error());
$stats['total_users'] = $db->result($result);

$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE group_id != 32000 ORDER BY registered DESC LIMIT 1') or error('Unable to fetch newest registered user', __FILE__, __LINE__, $db->error());
$stats['last_user'] = $db->fetch_assoc($result);

$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $db->error());
list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);

// Added by bbray
$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users WHERE group_id = 32000') or error('Unable to fetch total user count', __FILE__, __LINE__, $db->error());
$stats['total_users_noactivation'] = $db->result($result);

?>
<div id="brdstats" class="block">
        <h2><span><?php echo $lang_index['Board info'] ?></span></h2>
        <div class="box">
                <div class="inbox">
                        <dl class="conr">
                                <dt><strong><?php echo $lang_index['Board stats'] ?></strong></dt>
                                <dd><?php echo $lang_index['No of users'].': <strong>'. $stats['total_users'] ?></strong></dd>
                                <dd><?php echo $lang_index['No of non activated users'].': <strong>'. $stats['total_users_noactivation'] ?></strong></dd>
                                <dd><?php echo $lang_index['No of topics'].': <strong>'.$stats['total_topics'] ?></strong></dd>
                                <dd><?php echo $lang_index['No of posts'].': <strong>'.$stats['total_posts'] ?></strong></dd>
                        </dl>