PDA

View Full Version : Hyperlink feature of editor being used to spam


Snowhog
12-27-2016, 07:08 PM
Running vBulletin 4.2.3 Patch Level 2

The Basic and Enhanced Editor (we have the Enhanced Editor as the default when a user registers) has a Hyperlink button. We have been experiencing a number of (maybe the same person using different usernames) new registrations where the first post is responding to an existing post and 'almost' makes sense given the prior posts contents, but they always contain a hyperlink (the text varies) pointing to the same services website.

If I remember correctly, changing the default editor under User Registration Options > Default Registration Options > Options > Message Editor Interface to Do Not Show Editor Toolbar is the only way to prevent this from happening without the new member going into Settings > General Settings and changing the editor to either Standard or Enhanced.

Is there any way to make the Standard and Enhanced editor available as a function of Usergroups Promotion, forcing new registrations to use of the Basic editor only?

Seven Skins
12-27-2016, 07:17 PM
That will not make any difference they can still type manually ..

www.site.com

However there is mod here which can stop users from posting links ..search for "url posting" or something similar.

Kane@airrifle
12-27-2016, 07:21 PM
https://vborg.vbsupport.ru/showthread.php?t=233979

--------------- Added 1482873781 at 1482873781 ---------------

or, if it is the same url every time you can add it to your style RVM and change it to something arbitrary.

Snowhog
12-27-2016, 07:28 PM
That will not make any difference they can still type manually ..

www.site.com

I don't think that is an issue for us, as we disallow use of BB code for all new registered users; they gain use of BB code when they get promoted (based on number of posts) into the next usergroup.

Dragonsys
12-28-2016, 05:30 PM
I don't think that is an issue for us, as we disallow use of BB code for all new registered users; they gain use of BB code when they get promoted (based on number of posts) into the next usergroup.

If they cannot use BBCode, how are they posting links?

Snowhog
12-28-2016, 06:26 PM
If they cannot use BBCode, how are they posting links?

Thru the Link button in the Editor.

Use of BB Code as Yes or No only exists in the Blog and Signature sections of Usergroup settings; it isn't in Post/Thread section. So, the Editor is the vector for spamming with hyperlinks.

Dragonsys
12-28-2016, 06:51 PM
Thru the Link button in the Editor.

which uses BBCode. If they cannot post BBCode, then the link button won't get around it, as that check is performed in POST

You might want to double check the usergroup permissions & the forum permissions, which they are posting to.

MarkFL
12-28-2016, 07:09 PM
If you wish to remove the link button from the toolbar, create a plugin hooked at "editor_construct" and use the Plugin PHP Code:

if (is_member_of($vbulletin->userinfo, array(X, Y, Z)))
{
$k1 = 0;
$k2 = 0;

foreach($this->config['toolbar'] AS $arr_1)
{
if (is_array($arr_1))
{
foreach($arr_1 AS $arr_2)
{
if ($arr_2 === 'Link')
{
unset($this->config['toolbar'][$k1][$k2]);
break 2;
}

$k2++;
}
}

$k1++;
$k2 = 0;
}
}

Replace "X, Y, Z" with the comma-delimited list of usergroupids of those groups for which you wish to remove the link button.

Snowhog
12-28-2016, 07:29 PM
I'm assuming that X,Y,Z simply means "a comma separated list of usergroup id's", and not simply "three different usergroup id's". Correct? What if I only want to remove the link for Registered Users (id: 2), the usergroup these spam posts are generated from? Would the array then take a single value?

MarkFL
12-28-2016, 07:34 PM
Yes, it you want just usergroup 2 then just put a 2 in the array, but for example if you wanted usergroups 2,3, and 8 then you would put 2, 3, 8 in there. :D

Snowhog
12-28-2016, 07:45 PM
Thank you.

Okay, created a test user. The default editor for all new registrants is the Enhanced Editor.

I logged out and logged in as the new user. Started a new Thread and the Link button is still in the editor and is functional. Previewing the post shows an active hyperlink. :(

MarkFL
12-28-2016, 07:54 PM
Thank you.

Okay, created a test user. The default editor for all new registrants is the Enhanced Editor.

I logged out and logged in as the new user. Started a new Thread and the Link button is still in the editor and is functional. Previewing the post shows an active hyperlink. :(

Odd, because it removes the "Link" button for me, whether I set the Standard or Enhanced editor. What code are using in the plugin?

Snowhog
12-28-2016, 07:55 PM
if (is_member_of($vbulletin->userinfo, array(2)))
{
$k1 = 0;
$k2 = 0;

foreach($this->config['toolbar'] AS $arr_1)
{
if (is_array($arr_1))
{
foreach($arr_1 AS $arr_2)
{
if ($arr_2 === 'Link')
{
unset($this->config['toolbar'][$k1][$k2]);
break 2;
}

$k2++;
}
}

$k1++;
$k2 = 0;
}
}

MarkFL
12-28-2016, 08:02 PM
Are you certain your test user is a member of usergroup 2?

When you saved the plugin, did you make it active?

Snowhog
12-28-2016, 08:04 PM
Yes, the plugin is marked Active. The new user I created is in Primary Usergroup Registered User, which is usergroupid 2.

--------------- Added 1482963810 at 1482963810 ---------------

What about using hook location editor_switch_wysiwyg_to_standard instead? What would the PHP code consist of for this for members of usergroupid 2?

MarkFL
12-29-2016, 12:05 AM
Try adding the following line to the top of the plugin I posted:

global $vbulletin;

Snowhog
12-29-2016, 02:54 AM
That worked. The Enhanced Editor for my test user now doesn't contain the Link button. Thank you.

MarkFL
12-29-2016, 08:50 AM
I have published a product here that will allow you to remove whichever buttons you want and select the affected usergroups:

Custom Toolbar (https://vborg.vbsupport.ru/showthread.php?t=324086)

I have cited you as a co-author. :)

Snowhog
12-29-2016, 09:10 AM
Thank you so very much.

Installed the MOD after making the prior plugin inactive. I'll check it out with my test user. I selected Link, Unlink, Html, and Php to be removed from the editor for Registered Users.

--------------- Added 1483010822 at 1483010822 ---------------

Works perfectly. The buttons I selected to be removed were not on the toolbar when I logged in with my test user. This is great! :up:

Snowhog
04-27-2017, 01:55 PM
Just noticed that in Custom Toolbar v1.1 under Buttons to Remove you have "Hold down the [CTRL] key to select multiple forums". That should be "Hold down the [CTRL] key to select multiple buttons".

MarkFL
04-27-2017, 03:47 PM
Just noticed that in Custom Toolbar v1.1 under Buttons to Remove you have "Hold down the [CTRL] key to select multiple forums". That should be "Hold down the [CTRL] key to select multiple buttons".

Thank you! I have made the correction. :)