本文整理匯總了PHP中IPSMember::querySpamService方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSMember::querySpamService方法的具體用法?PHP IPSMember::querySpamService怎麽用?PHP IPSMember::querySpamService使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSMember
的用法示例。
在下文中一共展示了IPSMember::querySpamService方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: registerProcessForm
//.........這裏部分代碼省略.........
//-----------------------------------------
// Do we have any questions?
//-----------------------------------------
$data = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as questions', 'from' => 'question_and_answer'));
if ($data['questions']) {
$pass = false;
}
}
if (!$pass) {
$form_errors['general'][$this->lang->words['err_q_and_a']] = $this->lang->words['err_q_and_a'];
}
/* CHECK 2: Any errors ? */
if (count($form_errors)) {
$this->registerForm($form_errors);
return;
}
/* Build up the hashes */
$mem_group = $this->settings['member_group'];
/* Are we asking the member or admin to preview? */
if ($this->settings['reg_auth_type']) {
$mem_group = $this->settings['auth_group'];
} else {
if ($coppa == 1) {
$mem_group = $this->settings['auth_group'];
}
}
/* Create member */
$member = array('name' => $this->request['members_display_name'], 'password' => $in_password, 'members_display_name' => $this->request['members_display_name'], 'email' => $in_email, 'member_group_id' => $mem_group, 'joined' => time(), 'ip_address' => $this->member->ip_address, 'time_offset' => $this->request['time_offset'], 'coppa_user' => $coppa, 'members_auto_dst' => intval($this->settings['time_dst_auto_correction']), 'allow_admin_mails' => intval($this->request['allow_admin_mail']), 'language' => $this->member->language_id);
/* Spam Service */
$spamCode = 0;
$_spamFlag = 0;
if ($this->settings['spam_service_enabled']) {
/* Query the service */
$spamCode = IPSMember::querySpamService($in_email);
/* Action to perform */
$action = $this->settings['spam_service_action_' . $spamCode];
/* Perform Action */
switch ($action) {
/* Proceed with registration */
case 1:
break;
/* Flag for admin approval */
/* Flag for admin approval */
case 2:
$member['member_group_id'] = $this->settings['auth_group'];
$this->settings['reg_auth_type'] = 'admin';
$_spamFlag = 1;
break;
/* Approve the account, but ban it */
/* Approve the account, but ban it */
case 3:
$member['member_banned'] = 1;
$member['bw_is_spammer'] = 1;
$this->settings['reg_auth_type'] = '';
break;
/* Deny registration */
/* Deny registration */
case 4:
$this->registry->output->showError('spam_denied_account', '100x001', FALSE, '', 200);
break;
}
}
//-----------------------------------------
// Create the account
//-----------------------------------------
$member = IPSMember::create(array('members' => $member, 'pfields_content' => $custom_fields->out_fields), FALSE, FALSE, FALSE);
示例2: registerProcessForm
//.........這裏部分代碼省略.........
//-----------------------------------------
// Do we have any questions?
//-----------------------------------------
$data = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as questions', 'from' => 'question_and_answer'));
if (!$data['questions']) {
$pass = true;
}
}
if (!$pass) {
$form_errors['general'][$this->lang->words['err_q_and_a']] = $this->lang->words['err_q_and_a'];
}
}
/* CHECK 2: Any errors ? */
if (count($form_errors)) {
$this->registerForm($form_errors);
return;
}
/* Build up the hashes */
$mem_group = $this->settings['member_group'];
/* Are we asking the member or admin to preview? */
if ($this->settings['reg_auth_type']) {
$mem_group = $this->settings['auth_group'];
} else {
if ($coppa == 1) {
$mem_group = $this->settings['auth_group'];
}
}
/* Create member */
$member = array('name' => $this->request['UserName'], 'password' => $in_password, 'members_display_name' => $this->settings['auth_allow_dnames'] ? $this->request['members_display_name'] : $this->request['UserName'], 'email' => $in_email, 'member_group_id' => $mem_group, 'joined' => time(), 'ip_address' => $this->member->ip_address, 'time_offset' => $this->request['time_offset'], 'coppa_user' => $coppa, 'members_auto_dst' => intval($this->request['dst']), 'allow_admin_mails' => intval($this->request['allow_admin_mail']), 'hide_email' => $this->request['allow_member_mail'] ? 0 : 1);
/* Spam Service */
$spamCode = 0;
if ($this->settings['spam_service_enabled'] && $this->settings['spam_service_api_key']) {
/* Query the service */
$spamCode = IPSMember::querySpamService($in_email);
/* Action to perform */
$action = $this->settings['spam_service_action_' . $spamCode];
/* Perform Action */
switch ($action) {
/* Proceed with registraction */
case 1:
break;
/* Flag for admin approval */
/* Flag for admin approval */
case 2:
$member['member_group_id'] = $this->settings['auth_group'];
$this->settings['reg_auth_type'] = 'admin';
break;
/* Approve the account, but ban it */
/* Approve the account, but ban it */
case 3:
$member['member_banned'] = 1;
$member['member_group_id'] = $this->settings['banned_group'];
$this->settings['reg_auth_type'] = '';
break;
}
}
//-----------------------------------------
// Create the account
//-----------------------------------------
$member = IPSMember::create(array('members' => $member, 'pfields_content' => $this->request));
//-----------------------------------------
// Login handler create account callback
//-----------------------------------------
$this->han_login->createAccount(array('email' => $member['email'], 'joined' => $member['joined'], 'password' => $in_password, 'ip_address' => $this->member->ip_address, 'username' => $member['members_display_name']));
//-----------------------------------------
// We'll just ignore if this fails - it shouldn't hold up IPB anyways
示例3: _memberToggleSpam
/**
* Toggle member spam [process]
*
* @access private
* @return void [Outputs to screen]
*/
private function _memberToggleSpam()
{
/* INIT */
$toSave = array();
$this->request['member_id'] = intval($this->request['member_id']);
if (!$this->request['member_id']) {
$this->registry->output->showError($this->lang->words['m_specify'], 11228);
}
$member = IPSMember::load($this->request['member_id']);
if (!$member['member_id']) {
$this->registry->output->showError($this->lang->words['m_noid'], 11229);
}
//-----------------------------------------
// Allowed to spam administrators?
//-----------------------------------------
if ($member['g_access_cp'] and !$this->registry->getClass('class_permissions')->checkPermission('member_ban_admin')) {
$this->registry->output->global_message = $this->lang->words['m_banadmin'];
$this->_memberView();
return;
}
/* Load mod lib */
require IPSLib::getAppDir('forums') . '/sources/classes/moderate.php';
$this->modLibrary = new moderatorLibrary($this->registry);
/* Spam or not ? */
if ($member['bw_is_spammer']) {
$toSave['core']['bw_is_spammer'] = 0;
$toSave['core']['restrict_post'] = 0;
$toSave['core']['members_disable_pm'] = 0;
/* Flag them as a spammer */
IPSMember::save($member['member_id'], $toSave);
} else {
$toSave['core']['bw_is_spammer'] = 1;
/* What do to.. */
if ($this->settings['spm_option']) {
switch ($this->settings['spm_option']) {
case 'disable':
$toSave['core']['restrict_post'] = 1;
$toSave['core']['members_disable_pm'] = 2;
break;
case 'unapprove':
$toSave['core']['restrict_post'] = 1;
$toSave['core']['members_disable_pm'] = 2;
/* Unapprove posts and topics */
$this->modLibrary->toggleApproveMemberContent($member['member_id'], FALSE, 'all', intval($this->settings['spm_post_days']) * 24);
break;
}
}
/* Send an email */
if ($this->settings['spm_notify'] and $this->settings['email_out'] != $this->memberData['email']) {
IPSText::getTextClass('email')->getTemplate('possibleSpammer');
IPSText::getTextClass('email')->buildMessage(array('DATE' => $this->registry->class_localization->getDate($member['joined'], 'LONG', 1), 'MEMBER_NAME' => $member['members_display_name'], 'IP' => $member['ip_address'], 'EMAIL' => $member['email'], 'LINK' => $this->registry->getClass('output')->buildSEOUrl("showuser=" . $member['member_id'], 'public', $member['members_seo_name'], 'showuser')));
IPSText::getTextClass('email')->subject = $this->lang->words['new_registration_email_spammer'] . $this->settings['board_name'];
IPSText::getTextClass('email')->to = $this->settings['email_out'];
IPSText::getTextClass('email')->sendMail();
}
/* Send Spammer to Spam Service */
if ($this->settings['spam_service_send_to_ips'] && $this->settings['spam_service_api_key']) {
IPSMember::querySpamService($member['email'], $member['ip_address'], 'markspam');
}
/* Flag them as a spammer */
IPSMember::save($member['member_id'], $toSave);
}
//-----------------------------------------
// Redirect
//-----------------------------------------
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf($this->lang->words['t_log_spam'], $member['members_display_name']));
$this->registry->output->doneScreen($this->lang->words['t_log_spam'], $this->lang->words['m_search'], "{$this->form_code}&do=viewmember&member_id={$member['member_id']}", "redirect");
}
示例4: unmarkMembersAsSpam
/**
* Unmarks member(s) as spam
*
* @note Exceptions CAN bubble up, so you should still capture exceptions from calls to this method
* @param array Array of member ids
* @param bool Unmark posts additionally
* @return string Confirmation message
*/
public function unmarkMembersAsSpam($ids, $unmarkPosts = false)
{
/* Load Member Data */
$members = IPSMember::load($ids);
foreach ($ids as $i) {
IPSMember::save($i, array('core' => array('bw_is_spammer' => 0, 'restrict_post' => 0, 'members_disable_pm' => 0)));
if ($this->settings['spam_service_send_to_ips']) {
IPSMember::querySpamService($members[$i]['email'], $members[$i]['ip_address'], 'notspam');
}
$this->DB->update('validating', array('spam_flag' => 0), 'member_id=' . $i);
}
/* Reset last member */
IPSMember::resetLastRegisteredMember();
if ($unmarkPosts) {
/* Toggle their content */
$classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums');
$modLibrary = new $classToLoad($this->registry);
foreach ($ids as $id) {
$modLibrary->toggleApproveMemberContent($id, TRUE, 'all', intval($this->settings['spm_post_days']) * 24);
/* Run member sync */
IPSLib::runMemberSync('onUnSetAsSpammer', array('member_id' => $id));
}
}
$message = sprintf($this->lang->words['t_memunspammed'], count($ids));
ipsRegistry::getClass('adminFunctions')->saveAdminLog($message);
IPSMember::resetLastRegisteredMember();
return $message;
}
示例5: _manageValidating
//.........這裏部分代碼省略.........
/* Load custom fields class */
require_once IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php';
$fields = new customProfileFields();
/* Load language file */
$this->registry->getClass('class_localization')->loadLanguageFile(array('public_mod'), 'forums');
foreach ($members as $member_id => $member) {
$toSave = array('core' => array('bw_is_spammer' => 1, 'member_group_id' => $this->settings['member_group']));
/* Protected group? */
if (strstr(',' . $this->settings['warn_protected'] . ',', ',' . $member['member_group_id'] . ',')) {
continue;
}
/* What do to.. */
if ($this->settings['spm_option']) {
switch ($this->settings['spm_option']) {
case 'disable':
$toSave['core']['restrict_post'] = 1;
$toSave['core']['members_disable_pm'] = 2;
break;
case 'unapprove':
$toSave['core']['restrict_post'] = 1;
$toSave['core']['members_disable_pm'] = 2;
/* Unapprove posts and topics */
$modLibrary->toggleApproveMemberContent($member_id, FALSE, 'all', intval($this->settings['spm_post_days']) * 24);
break;
case 'ban':
/* Unapprove posts and topics */
$modLibrary->toggleApproveMemberContent($member_id, FALSE, 'all', intval($this->settings['spm_post_days']) * 24);
$toSave = array('core' => array('member_banned' => 1, 'title' => '', 'bw_is_spammer' => 1), 'extendedProfile' => array('signature' => '', 'pp_bio_content' => '', 'pp_about_me' => '', 'pp_status' => ''));
//-----------------------------------------
// Avatar
//-----------------------------------------
$toSave['extendedProfile']['avatar_location'] = "";
$toSave['extendedProfile']['avatar_size'] = "";
try {
IPSMember::getFunction()->removeAvatar($member['member_id']);
} catch (Exception $e) {
// Maybe should show an error or something
}
//-----------------------------------------
// Photo
//-----------------------------------------
IPSMember::getFunction()->removeUploadedPhotos($member['member_id']);
$toSave['extendedProfile'] = array_merge($toSave['extendedProfile'], array('pp_main_photo' => '', 'pp_main_width' => '', 'pp_main_height' => '', 'pp_thumb_photo' => '', 'pp_thumb_width' => '', 'pp_thumb_height' => ''));
//-----------------------------------------
// Profile fields
//-----------------------------------------
$fields->member_data = $member;
$fields->initData('edit');
$fields->parseToSave(array());
if (count($fields->out_fields)) {
$toSave['customFields'] = $fields->out_fields;
}
//-----------------------------------------
// Update signature content cache
//-----------------------------------------
IPSContentCache::update($member['member_id'], 'sig', '');
break;
}
}
/* Send an email */
if ($this->settings['spm_notify'] and $this->settings['email_out'] != $this->memberData['email']) {
IPSText::getTextClass('email')->getTemplate('possibleSpammer');
IPSText::getTextClass('email')->buildMessage(array('DATE' => $this->registry->class_localization->getDate($member['joined'], 'LONG', 1), 'MEMBER_NAME' => $member['members_display_name'], 'IP' => $member['ip_address'], 'EMAIL' => $member['email'], 'LINK' => $this->registry->getClass('output')->buildSEOUrl("showuser=" . $member['member_id'], 'public', $member['members_seo_name'], 'showuser')));
IPSText::getTextClass('email')->subject = $this->lang->words['new_registration_email_spammer'] . ' ' . $this->settings['board_name'];
IPSText::getTextClass('email')->to = $this->settings['email_out'];
IPSText::getTextClass('email')->sendMail();
}
/* Flag them as a spammer */
IPSMember::save($member['member_id'], $toSave);
/* Send Spammer to Spam Service */
if ($this->settings['spam_service_send_to_ips'] && $this->settings['spam_service_api_key']) {
IPSMember::querySpamService($member['email'], $member['ip_address'], 'markspam');
}
/* Remove validating rows */
$this->DB->delete('validating', "member_id IN(" . implode(",", $ids) . ")");
$this->registry->output->global_message = count($ids) . ' ' . $this->lang->words['t_setasspammers'];
$this->_viewQueue('validating');
return;
}
} else {
$denied = array();
$this->DB->build(array('select' => 'members_display_name', 'from' => 'members', 'where' => "member_id IN(" . implode(",", $ids) . ")"));
$this->DB->execute();
while ($r = $this->DB->fetch()) {
$denied[] = $r['members_display_name'];
}
try {
IPSMember::remove($ids);
} catch (Exception $error) {
$this->registry->output->showError($error->getMessage(), 11247);
}
ipsRegistry::getClass('adminFunctions')->saveAdminLog(count($ids) . $this->lang->words['t_regdenied'] . implode(", ", $denied));
$this->registry->output->global_message = count($ids) . $this->lang->words['t_removedmem'];
$this->_viewQueue('validating');
return;
}
}
}
}
}
示例6: _testApiConnection
protected function _testApiConnection()
{
/* Test the connection */
$result = IPSMember::querySpamService('', '', '', 1);
$this->registry->output->html .= $this->html->spamServiceTest($result);
}
示例7: _setAsSpammer
/**
* Flag a user account as a spammer
*
* @access private
* @return void Outputs error screen
*/
private function _setAsSpammer()
{
/* INIT */
$member_id = intval($this->request['member_id']);
$toSave = array('core' => array('bw_is_spammer' => 1));
/* Load member */
$member = IPSMember::load($member_id);
if (!$member['member_id']) {
$this->_showError('moderate_no_permission', 10311900);
}
/* Check permissions */
$this->_genericPermissionCheck('bw_flag_spammers');
/* Protected group? */
if (strstr(',' . $this->settings['warn_protected'] . ',', ',' . $member['member_group_id'] . ',')) {
$this->_showError('moderate_no_permission', 10311901);
}
/* What do to.. */
if ($this->settings['spm_option']) {
switch ($this->settings['spm_option']) {
case 'disable':
$toSave['core']['restrict_post'] = 1;
$toSave['core']['members_disable_pm'] = 2;
break;
case 'unapprove':
$toSave['core']['restrict_post'] = 1;
$toSave['core']['members_disable_pm'] = 2;
/* Unapprove posts and topics */
$this->modLibrary->toggleApproveMemberContent($member_id, FALSE, 'all', intval($this->settings['spm_post_days']) * 24);
break;
case 'ban':
/* Unapprove posts and topics */
$this->modLibrary->toggleApproveMemberContent($member_id, FALSE, 'all', intval($this->settings['spm_post_days']) * 24);
$toSave = array('core' => array('member_banned' => 1, 'title' => '', 'bw_is_spammer' => 1), 'extendedProfile' => array('signature' => '', 'pp_bio_content' => '', 'pp_about_me' => '', 'pp_status' => ''));
//-----------------------------------------
// Avatar
//-----------------------------------------
$toSave['extendedProfile']['avatar_location'] = "";
$toSave['extendedProfile']['avatar_size'] = "";
try {
IPSMember::getFunction()->removeAvatar($member['member_id']);
} catch (Exception $e) {
// Maybe should show an error or something
}
//-----------------------------------------
// Photo
//-----------------------------------------
IPSMember::getFunction()->removeUploadedPhotos($member['member_id']);
$toSave['extendedProfile'] = array_merge($toSave['extendedProfile'], array('pp_main_photo' => '', 'pp_main_width' => '', 'pp_main_height' => '', 'pp_thumb_photo' => '', 'pp_thumb_width' => '', 'pp_thumb_height' => ''));
//-----------------------------------------
// Profile fields
//-----------------------------------------
require_once IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php';
$fields = new customProfileFields();
$fields->member_data = $member;
$fields->initData('edit');
$fields->parseToSave(array());
if (count($fields->out_fields)) {
$toSave['customFields'] = $fields->out_fields;
}
//-----------------------------------------
// Update signature content cache
//-----------------------------------------
IPSContentCache::update($member['member_id'], 'sig', '');
break;
}
}
/* Send an email */
if ($this->settings['spm_notify'] and $this->settings['email_out'] != $this->memberData['email']) {
IPSText::getTextClass('email')->getTemplate('possibleSpammer');
IPSText::getTextClass('email')->buildMessage(array('DATE' => $this->registry->class_localization->getDate($member['joined'], 'LONG', 1), 'MEMBER_NAME' => $member['members_display_name'], 'IP' => $member['ip_address'], 'EMAIL' => $member['email'], 'LINK' => $this->registry->getClass('output')->buildSEOUrl("showuser=" . $member['member_id'], 'public', $member['members_seo_name'], 'showuser')));
IPSText::getTextClass('email')->subject = $this->lang->words['new_registration_email_spammer'] . $this->settings['board_name'];
IPSText::getTextClass('email')->to = $this->settings['email_out'];
IPSText::getTextClass('email')->sendMail();
}
/* Flag them as a spammer */
IPSMember::save($member_id, $toSave);
/* Send Spammer to Spam Service */
if ($this->settings['spam_service_send_to_ips'] && $this->settings['spam_service_api_key']) {
IPSMember::querySpamService($member['email'], $member['ip_address'], 'markspam');
}
/* Add mod log */
$this->_addModeratorLog($this->lang->words['flag_spam_done'] . ': ' . $member['member_id'] . ' - ' . $member['email']);
/* Redirect */
if ($this->topic['tid']) {
$this->registry->output->redirectScreen($this->lang->words['flag_spam_done'], $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . "&st=" . intval($this->request['st']), $this->topic['title_seo']);
} else {
$this->registry->output->redirectScreen($this->lang->words['flag_spam_done'], $this->settings['base_url'] . "showuser=" . $member['member_id'], $member['members_seo_name']);
}
}