summaryrefslogtreecommitdiff
path: root/modules/drupal/drupal.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/drupal/drupal.module')
-rw-r--r--modules/drupal/drupal.module28
1 files changed, 15 insertions, 13 deletions
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module
index a32303731..5c00536a9 100644
--- a/modules/drupal/drupal.module
+++ b/modules/drupal/drupal.module
@@ -8,22 +8,24 @@ function drupal_conf_options() {
}
function drupal_cron() {
+ if (time() - variable_get("drupal_cron_last", 0) > 21600) {
+ variable_set("drupal_cron_last", time());
- /*
- ** If this site acts as a Drupal XML-RPC server, delete the sites that
- ** stopped sending "ping" messages.
- */
-
- db_query("DELETE FROM directory WHERE timestamp < '". (time() - 259200) ."'");
+ /*
+ ** If this site acts as a Drupal XML-RPC server, delete the sites that
+ ** stopped sending "ping" messages.
+ */
- /*
- ** If this site acts as a Drupal XML-RPC client, send a message to the
- ** Drupal XML-RPC server.
- */
+ db_query("DELETE FROM directory WHERE timestamp < '". (time() - 259200) ."'");
+ /*
+ ** If this site acts as a Drupal XML-RPC client, send a message to the
+ ** Drupal XML-RPC server.
+ */
- if (variable_get("drupal_directory", 0) && variable_get("drupal_server", 0)) {
- drupal_notify(variable_get("drupal_server", ""));
+ if (variable_get("drupal_directory", 0) && variable_get("drupal_server", 0)) {
+ drupal_notify(variable_get("drupal_server", ""));
+ }
}
}
@@ -49,7 +51,7 @@ function drupal_directory_ping($arguments) {
*/
if ($link && $name && $mail && $slogan && $mission) {
- db_query("DELETE FROM directory WHERE link = '". check_query($link) ."'");
+ db_query("DELETE FROM directory WHERE link = '". check_query($link) ."' OR mail = '". check_query($mail) ."'");
db_query("INSERT INTO directory (link, name, mail, slogan, mission, timestamp) VALUES ('". check_query($link) ."', '". check_query($name) ."', '". check_query($mail) ."', '". check_query($slogan) ."', '". check_query($mission) ."', '". time() ."')");
watchdog("message", "directory: ping from '$name' ($link)");