'. t("Mollom can be used to block all sorts of spam received by your website. Your Drupal site will send data you want checked for spam to the Mollom servers, which will reply with either 'spam' or 'ham' (not spam). If Mollom is not fully confident in its decision, it will ask the user to fill out a CAPTCHA. On the rare occasion that Mollom asks the poster to fill out a CAPTCHA, Mollom assumes that all legitimate posters will take the extra time to fill out this CAPTCHA. Using the CAPTCHA, Mollom avoids legitimate messages being incorrectly classified as spam and it eliminates the need to moderate messages that Mollom decided to block.") .'
'. - ''. t("Administrators can inspect the logs to see what Mollom has blocked. -If Mollom made a mistake and some spam slipped through, you can report it to Mollom when you delete the post or comment. By doing so, Mollom learns how it can do a better job protecting your site. If you want to report multiple posts at once, you can use Mollom's bulk operations on the content administration page or the comment administration page.", array('@logs' => url('admin/reports/dblog'), '@content-admin' => url('admin/content/node'), '@comment-admin' => url('admin/content/comment'))) .'
'. - ''. t("To perform its service, Mollom processes, stores and compares the data submitted by your site's visitors as explained in our Web Service Privacy Policy. As the controller of the data being processed, it is your responsibility to inform your website's visitors, and to obtain appropriate consent from them to allow Mollom to process their data.") .'
', + ''. t("Mollom can be used to block all sorts of spam received by your website. Your Drupal site will send data you want checked for spam to the Mollom servers, which will reply with either 'spam' or 'ham' (not spam). If Mollom is not fully confident in its decision, it will ask the user to fill out a CAPTCHA. On the rare occasion that Mollom asks the poster to fill out a CAPTCHA, Mollom assumes that all legitimate posters will take the extra time to fill out this CAPTCHA. Using the CAPTCHA, Mollom avoids legitimate messages being incorrectly classified as spam and it eliminates the need to moderate messages that Mollom decided to block. Administrators can still inspect the logs to see what Mollom has blocked.", array('@logs' => url('admin/reports/dblog'))) .'
'. + ''. t("To perform its service, Mollom processes, stores and compares the data submitted by your site's visitors as explained in our Web Service Privacy Policy. As the controller of the data being processed, it is your responsibility to inform your website's visitors, and to obtain appropriate consent from them to allow Mollom to process their data.") .'
'. + ''. t("More information about how Mollom works, is available on the \"How Mollom works\" page and the Mollom FAQ.", array('@mollom-workings' => 'http://mollom.com/how-mollom-works', '@mollom-faq' => 'http://mollom.com/faq')) .'
', '#collapsible' => TRUE, ); @@ -737,7 +751,7 @@ form_set_error('mollom', t("The spam filter that is installed on this site is currently not available. Per the site's policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple minutes.")); } - watchdog('mollom', 'All Mollom servers were unavailable: %servers, last error: @errno - %error_msg', array('%servers' => print_r(variable_get('mollom_servers', array()), TRUE), '@errno' => xmlrpc_errno(), '%error_msg' => xmlrpc_error_msg()), WATCHDOG_ERROR); + watchdog('mollom', 'Mollom was unavailable (servers: %servers, error: @errno - %error_msg)', array('%servers' => variable_get('mollom_servers', array()), '@errno' => xmlrpc_errno(), '%error_msg' => xmlrpc_error_msg()), WATCHDOG_ERROR); } /** @@ -989,11 +1003,11 @@ '#type' => 'textfield', '#name' => 'captcha', '#id' => 'edit-captcha', - '#title' => t('Word verification'), - '#field_prefix' => '', + '#title' => t('CAPTCHA'), + '#prefix' => '', '#required' => TRUE, '#size' => 10, - '#description' => t("Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated."), + '#description' => t("Type in the characters shown in the above; if you can't read them, submit the form and a new image will be generated."), '#weight' => $weight, ); @@ -1033,12 +1047,9 @@ } else { watchdog('mollom', 'Error @errno: %server - %message - mollom.getServerList', array('@errno' => xmlrpc_errno(), '%server' => $server, '%message' => xmlrpc_error_msg()), WATCHDOG_ERROR); - - // Reset the XMLRPC error: - xmlrpc_error(0); // FIXME: this is crazy. } } - + return array(); } @@ -1049,25 +1060,20 @@ */ function mollom($method, $data = array()) { - // Initialize refresh variable: - $refresh = FALSE; - // Retrieve the list of Mollom servers from the database: $servers = variable_get('mollom_servers', NULL); if ($servers == NULL) { // Retrieve a new list of servers: $servers = _mollom_retrieve_server_list(); - + // Store the list of servers in the database: variable_set('mollom_servers', $servers); } if (is_array($servers)) { // Send the request to the first server, if that fails, try the other servers in the list: - - reset($servers); - while ($server = current($servers)) { + foreach ($servers as $server) { $result = xmlrpc($server .'/'. MOLLOM_API_VERSION, $method, $data + _mollom_authentication()); // Debug output: @@ -1079,42 +1085,23 @@ } if ($errno = xmlrpc_errno()) { - if ($errno == MOLLOM_REFRESH) { - if (!$refresh) { // Safety pal to avoid endless loops - // Retrieve a list of valid Mollom servers from mollom.com: - $servers = _mollom_retrieve_server_list(); - - // Reset the list of servers so we start from the first server in the list: - reset($servers); + watchdog('mollom', 'Error @errno: %server - %message - %method -@data', array('@errno' => xmlrpc_errno(), '%server' => $server, '%message' => xmlrpc_error_msg(), '%method' => $method, '@data' => print_r($data, TRUE)), WATCHDOG_ERROR); - // Store the updated list of servers in the database: - variable_set('mollom_servers', $servers); + if ($errno == MOLLOM_REFRESH) { + // Retrieve a list of valid Mollom servers from mollom.com: + $servers = _mollom_retrieve_server_list(); - // Log this for debuging purposes: - watchdog('mollom', 'The list of available Mollom servers was refreshed: @servers.', array('@servers' => print_r($servers, TRUE))); + // Store the updated list of servers in the database: + variable_set('mollom_servers', $servers); - // Mark that we have refreshed the list: - $refresh = TRUE; - } + // Log this for debuging purposes:: + watchdog('mollom', 'The list of available Mollom servers was set to @servers.', array('@servers' => print_r($servers, TRUE))); } - elseif ($errno == MOLLOM_REDIRECT) { - // If this is a network error, we go to the next server in the list. - $next = next($servers); - - // Do nothing, we automatically select the next server. - watchdog('mollom', 'The Mollom server %server asked to use the next Mollom server in the list: %next.', array('%server' => $server, '%next' => $next)); + elseif ($errno == MOLLOM_ERROR) { + return $result; } - else { - watchdog('mollom', 'Error @errno from %server: %message - %method -
@data', array('@errno' => xmlrpc_errno(), '%server' => $server, '%message' => xmlrpc_error_msg(), '%method' => $method, '@data' => print_r($data, TRUE)), WATCHDOG_ERROR); - - // If it is a 'clean' Mollom error we return instantly. - - if ($errno == MOLLOM_ERROR) { - return $result; - } - - // If this is a network error, we go to the next server in the list. - next($servers); + elseif ($errno == MOLLOM_REDIRECT) { + // Do nothing, we select the next client automatically. } // Reset the XMLRPC error: @@ -1189,4 +1176,4 @@ function _mollom_debug($message) { // print $message .'