Woot... It works Now!!! I really needed this... I will leave it between the two coders that made the hacks to decide who deserves the credit as I just slapped the two pieces together....
PHP Code:
//if the cookie exists then we know that the user already has an account
if (isset($_COOKIE['IDstack']) && $vbulletin->options['marpon'])
{
//set the usergroup to the one specified in options, or Users Awaiting Moderation
$userdata->set('usergroupid', $vbulletin->options['marpusergroup']);
//Update their ID stack and PM or Post to thread
$idstack = $_COOKIE['IDstack'];
$idstack .= ",{$vbulletin->userinfo['userid']},";
setcookie("IDstack", $idstack, time()+10368000, "/");
$Unums = split(",", $idstack);
$andids = null;
$numvs = 0;
for ($i = 0; $i < (sizeof($Unums)); $i++)
{
if( verify_id('user', $Unums[$i], FALSE, -1, -1) )
{
if (!empty($Unums[$i]) && is_numeric($Unums[$i])) {
$checkuser = $vbulletin->db->query_first("SELECT username FROM " . TABLE_PREFIX . "user WHERE userid={$Unums[$i]}");
if ( !empty($andids) ) $andids .= "and";
$andids .= " [url=". $vbulletin->options['bburl'] ."/member.php?u=" . $Unums[$i] . "] ". $checkuser['username'] ."[/url] ";
$numvs++;
}
}
}
$allowsmilie = '1';
$visible = '1';
//$message = construct_phrase($vbphrase['multiplelogin_alert'], htmlspecialchars_uni($vbulletin->userinfo['username']), $andids);
$message = htmlspecialchars_uni($vbulletin->userinfo['username']) . " seems to be registering a multiple personality using $andids sharing the same computer.";
// get admin users
$adminusers = split(",", $vbulletin->options['ae_adminusers']);
$fromuser = fetch_userinfo($vbulletin->options['ae_sender']);
$subject = $vbulletin->userinfo['username'] . " opened another account";
// create the DM to do error checking and insert the new PM (needs to be here)
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_SILENT);
$ipaddress = $vbulletin->config['ae_adminip'];
if($vbulletin->options['ae_sendpm'] == '1')
{
$pmdm->set('fromuserid', $fromuser['userid']);
$pmdm->set('fromusername', $fromuser['username']);
$pmdm->set_info('reciept', false);
$pmdm->set_info('savecopy', false);
$pmdm->set('title', $subject);
$pmdm->set('message', $message);
$pmdm->set_recipients($vbulletin->options['ae_recipients'], $fromuser['permissions']);
$pmdm->set('dateline', TIMENOW);
$pmdm->save();
}
if($vbulletin->options['ae_startthread'] == '1' AND $vbulletin->options['ae_forumid'])
{
require_once(DIR . '/includes/class_dm_threadpost.php');
// setup variables
$forumid = $vbulletin->options['ae_forumid'];
$threaddm = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);
// insert thread
$threaddm->do_set('forumid', $forumid);
$threaddm->do_set('userid', $fromuser['userid']);
$threaddm->do_set('username', $fromuser['username']);
$threaddm->do_set('pagetext', $message);
$threaddm->do_set('title', $subject);
$threaddm->do_set('allowsmilie', $allowsmilie);
$threaddm->do_set('visible', $visible);
$tid = $threaddm->save();
require_once(DIR . '/includes/functions_databuild.php');
build_forum_counters($forumid);
}
}
If this was wrong of me to post the code here with the code from the original AE detector mod, send me a PM and I will remove it...