simulation(); $mailoutPlugins = e107::getConfig()->get('e_mailout_list'); if(empty($_GET['id'])) { $this->invalidURL(); return; } $tmp = base64_decode($_GET['id']); parse_str($tmp,$data); $data['plugin'] = $tp->filter($data['plugin'],'str'); $data['email'] = $tp->filter($data['email'],'email'); e107::getMessage()->addDebug(print_a($data,true)); $plugin = vartrue($data['plugin'],false); if(empty($data) || !e107::isInstalled($plugin) || !in_array($plugin, $mailoutPlugins)) { $this->invalidURL(); return; } $ml = e107::getAddon($plugin, 'e_mailout'); if(!empty($data['userclass'])) // userclass unsubscribe. { $data['userclass'] = intval($data['userclass']); $listName = e107::getUserClass()->getName($data['userclass']); } else { $listName = $ml->mailerName; } if(vartrue($_POST['remove']) && !empty($data)) { if($ml->unsubscribe('process',$data)!=false) { $text = "

".$data['email']." has been removed from ".$listName.".

"; $mes->addSuccess($text); } else { $text = "

There was a problem when attempting to remove ".$data['email']." from ".$listName.".

"; $mes->addError($text); } echo "
".$mes->render()."
"; return; } if($ml->unsubscribe('check',$data) != false) { $text = "

We are very sorry for the inconvenience.
Please click the button below to remove ".$data['email']." from ".$listName.".

"; $text .= $frm->open('unsub','post',e_REQUEST_URI); $text .= $frm->button('remove','Remove ','submit'); $text .= $frm->close(); $mes->setTitle('Unsubscribe',E_MESSAGE_INFO)->addInfo($text); echo "
".$mes->render()."
"; return; } else { $this->invalidURL(); return; } } function simulation() { $row = array(); $row['datestamp'] = time(); $row['email'] = "test@test.com"; $row['id'] = 23; $unsubscribe = array('date'=>$row['datestamp'],'email'=>$row['email'],'id'=>$row['id'],'plugin'=>'user'); $urlQuery = http_build_query($unsubscribe,null,'&'); $_GET['id'] = base64_encode($urlQuery); e107::getMessage()->addDebug("urlQuery = ".$urlQuery); //echo "urlQuery = ".$urlQuery."
"; e107::getMessage()->addDebug(e_SELF."?id=".$_GET['id']); } function invalidURL() { $mes = e107::getMessage(); $mes->addWarning("Invalid URL"); echo "
".$mes->render()."
"; return; } } new e_unsubscribe; require_once(FOOTERF);