Commit f47ffbcf authored by Mathieu Lutfy's avatar Mathieu Lutfy Committed by Aegir user

infrastructure/ops#825 Moved contrib modules from sites/all to sites-specific

parent 1c96c086

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

Modules extend your site functionality beyond Drupal core.
WHAT TO PLACE IN THIS DIRECTORY?
--------------------------------
Placing downloaded and custom modules in this directory separates downloaded and
custom modules from Drupal core's modules. This allows Drupal core to be updated
without overwriting these files.
DOWNLOAD ADDITIONAL MODULES
---------------------------
Contributed modules from the Drupal community may be downloaded at
https://www.drupal.org/project/project_module.
ORGANIZING MODULES IN THIS DIRECTORY
------------------------------------
You may create subdirectories in this directory, to organize your added modules,
without breaking the site. Some common subdirectories include "contrib" for
contributed modules, and "custom" for custom modules. Note that if you move a
module to a subdirectory after it has been enabled, you may need to clear the
Drupal cache so it can be found. (Alternatively, you can disable the module
before moving it and then re-enable it after the move.)
MULTISITE CONFIGURATION
-----------------------
In multisite configurations, modules found in this directory are available to
all sites. Alternatively, the sites/your_site_name/modules directory pattern
may be used to restrict modules to a specific site instance.
MORE INFORMATION
----------------
Refer to the "Developing for Drupal" section of the README.txt in the Drupal
root directory for further information on extending Drupal with custom modules.
AntiSpam 7.x-1.6, 2017-08-01
----------------------------
- Fixed a bug that was causing node spam history to be deleted rather than comment spam history.
- Fixed a bug that showed "Anonymous" as the comment author name for any logged-out comment.
- Fixed a bug causing user comment signatures to be hidden.
- Removed the assumption that the comment module is enabled.
- Fixed a bug causing unpublished nodes to appear as published in the admin.
- Added basic Webform integration.
- Fixed a bug causing the module to break during installation.
- Fixed a bug causing PHP warnings.
- Removed obsolete service Typepad Antispam.
- Removed obsolete service Defensio.
- Fixed a bug causing the submit-spam API call to be used incorrectly.
- Removed a superfluous confirmation message after a comment is submitted.
- Added feedback when the API key that is entered is not valid.
- Updating wording of the spam/ham links to be "Spam" and "Not Spam."
- Reduced the possibility of conflicts with other modules.
- Fixed a bug that was not checking the Subject field of comments for spam.
AntiSpam 7.x-1.5, 2012-07-09
----------------------------
- Ensure that the module can be enabled in Drupal 7
\ No newline at end of file
INSTALLATION:
1. Create the folder '(drupal-root)/sites/all/modules/antispam'
2. Copy all modules files, keeping directory structure, to the
folder.
3. Enable the antispam module in 'admin/modules'
4. Visit 'admin/config/antispam' and enter your API key for the
selected antispam service provider.
You may wish to review and adapt the other options to suit
your needs.
5. Check new permissions added by this module at 'admin/access'.
6. You're done.
UNINSTALLATION:
Should you wish to uninstall this module, you may proceed as follows:
1. Disable the antispam module in 'admin/modules'.
2. Uninstall the antispam module in 'admin/modules'.
3. You're done.
NOTE: All the data stored in the database for the antispam module
will be deleted when you perform the step 2. If you may want to enable
and use it again in the future, do only the step 1.
This diff is collapsed.
This diff is collapsed.
<?php
/**
* @file
* The antispam cron code.
*/
/**
* Shutdown function executed at cron time.
*/
function antispam_cron_shutdown() {
// Expired content spam that we have to remove from each content repository.
$expired_content_spam = array('nids' => array(), 'cids' => array());
// Spam marks that we have to remove from the 'spam marks' table.
$obsolete_spam_marks = array('nids' => array(), 'cids' => array());
// Retrieve the list of expired content spam, based on the age specified in
// the settings panel.
$expire_spam_age = variable_get('antispam_remove_spam_age', 259200);
if ($expire_spam_age > 0) {
$result = db_query('SELECT content_type, content_id FROM {antispam_spam_marks} WHERE spam_created < :spam_created', array(':spam_created' => time() - $expire_spam_age));
foreach ($result as $s) {
$key = ($s->content_type == 'node' ? 'nids' : 'cids');
$expired_content_spam[$key][] = $s->content_id;
$obsolete_spam_marks[$key][] = $s->content_id;
}
}
// Deal with possible spam marks for content that have already been removed
// from database.
// Note: when Drupal deletes a node, all its comments are deleted, but no
// hook is invoked, so that may lead to orphans in the 'spam marks' table.
// This is why this cron task is being more complex that it could really be.
// Anyway, these queries shouldn't be too heavy.
$result = db_query('SELECT s.content_id FROM {antispam_spam_marks} s LEFT JOIN {node} n ON s.content_id = n.nid WHERE s.content_type = \'node\' AND n.nid IS NULL');
foreach ($result as $s) {
if (!in_array($s->content_id, $obsolete_spam_marks['nids'])) {
$obsolete_spam_marks['nids'][] = $s->content_id;
}
}
$result = db_query('SELECT s.content_id FROM {antispam_spam_marks} s LEFT JOIN {comment} c ON s.content_id = c.cid WHERE s.content_type = \'comment\' AND c.cid IS NULL');
foreach ($result as $s) {
if (!in_array($s->content_id, $obsolete_spam_marks['cids'])) {
$obsolete_spam_marks['cids'][] = $s->content_id;
}
}
// From this point on is where we really will delete stuff from database.
// Drupal cache will need to be cleared so anonymous users get updated views.
$clear_cache = FALSE;
// Remove expired spam from each content repository.
$expired_nids_removed = count($expired_content_spam['nids']);
$expired_cids_removed = count($expired_content_spam['cids']);
if ($expired_nids_removed > 0) {
$deleted_items = array();
$delete_count = 0;
foreach ($expired_content_spam['nids'] as $nid) {
if (antispam_content_delete('node', $nid)) {
$deleted_items[] = $nid;
$delete_count++;
}
}
if ($delete_count > 0) {
$message = t('AntiSpam housekeeping') . ': ' . format_plural($delete_count, '1 expired spam node removed from database', '@count expired spam nodes removed from database') .
'<br />'
. t('Node ID List: %nids', array('%nids' => implode(',', $deleted_items)));
watchdog('cron', $message);
$clear_cache = TRUE;
}
}
if ($expired_cids_removed > 0) {
$deleted_items = array();
$delete_count = 0;
foreach ($expired_content_spam['cids'] as $cid) {
if (antispam_content_delete('comment', $cid)) {
$deleted_items[] = $cid;
$delete_count++;
}
}
if ($delete_count > 0) {
$message = t('AntiSpam housekeeping') . ': ' . format_plural($delete_count, '1 expired spam comment removed from database', '@count expired spam comments removed from database') .
'<br />'
. t('Comment ID List: %cids', array('%cids' => implode(',', $deleted_items)));
watchdog('cron', $message);
$clear_cache = TRUE;
}
}
// Remove obsolete spam marks from database.
$spam_nids_removed = count($obsolete_spam_marks['nids']);
$spam_cids_removed = count($obsolete_spam_marks['cids']);
$spam_marks_removed = $spam_nids_removed + $spam_cids_removed;
if ($spam_nids_removed > 0) {
// $spam_nids_list = implode(',', $obsolete_spam_marks['nids']);
$spam_nids_list = $obsolete_spam_marks['nids'];
db_delete('antispam_spam_marks')
->condition('content_type', 'node')
->condition('content_id', $spam_nids_list, 'IN')
->execute();
}
if ($spam_cids_removed > 0) {
// $spam_cids_list = implode(',', $obsolete_spam_marks['cids']);
$spam_cids_list = $obsolete_spam_marks['cids'];
db_delete('antispam_spam_marks')
->condition('content_type', 'comment')
->condition('content_id', $spam_cids_list, 'IN')
->execute();
}
if ($spam_marks_removed > 0) {
$message = t('AntiSpam housekeeping') . ': ' . format_plural($spam_marks_removed, '1 spam mark removed from database', '@count spam marks removed from database');
if (isset($spam_nids_list)) {
$message .= '<br />';
$message .= t('Node ID List: %nids', array('%nids' => $spam_nids_list));
}
if (isset($spam_cids_list)) {
$message .= '<br />';
$message .= t('Comment ID List: %cids', array('%cids' => $spam_cids_list));
}
watchdog('cron', $message);
$clear_cache = TRUE;
}
// If anything was removed, then clear Drupal cache.
if ($clear_cache) {
antispam_clear_cache();
}
}
name = AntiSpam
description = Use the Akismet anti-spam service to protect your site from spam.
configure = admin/config/spamprevention/antispam
core = 7.x
files[] = tests/antispam.test
; Information added by Drupal.org packaging script on 2017-08-01
version = "7.x-1.6"
core = "7.x"
project = "antispam"
datestamp = "1501569110"