function debo_mostrar_captcha() { global $globals; // Sólo mostramos el captcha si se ha registrado con éxito ya esta ip en las últimas 24 horas // o si se han fallado 3 veces durante el registro en las últimas 24 horas return log_get("register_ok", ip2long($globals['ip']), 0, 24 * 60 * 60) > 0 || log_get("register_fail", ip2long($globals['ip']), 0, 24 * 60 * 60) >= 3; }
function borrar_usuarios_no_activados_antiguos() { global $dbc; // miro si se han borrado usuarios inactivos en las últimas 72 horas $borrados_inactivos = log_get("users_inactives_deleted", 0, 0, 72 * 60 * 60); if ($borrados_inactivos == 0) { // si no se ha realizado borrado en las últimas 72 horas lo hago ahora $sql_delete = "DELETE from `users` WHERE `approved` = 0 AND `date` < now() - INTERVAL 3 DAY"; mysql_query($sql_delete, $dbc['link']) or die("Deletion Failed:" . mysql_error()); log_insert("users_inactives_deleted", 0, 0); } }
$content .= "<td>" . $userip . "</td>"; $content .= "<td>" . $log->logURL . "</td>"; $content .= "</tr>"; $numrow++; if ($numrow == 3) { $numrow = 1; } } $content .= "</table>"; } elseif ($action == 'details') { $logid = $_GET['id']; if (empty($logid) or !is_numeric($logid) or !log_get($logid)) { header('Location: index.php?module=logs'); die; } else { $log = log_get($logid); $userip = long2ip($log->userIP); if (!empty($log->userHost)) { $userip .= " (" . $log->userHost . ")"; } // End if(!empty) $content .= "<h2>" . lang("Details for logentry ") . " #" . $logid . "</h2>"; $content .= "<a href='javascript:history.back()'>Back</a>"; $content .= "<table>"; $content .= "<tr class='logrow1'><th>" . lang("User", "logs") . "</th><td>" . display_username($log->userID) . "</td></tr>"; $content .= "<tr class='logrow2'><th>" . lang("Timestamp", "logs") . "</th><td>" . $log->logTime . "</td></tr>"; $content .= "<tr class='logrow1'><th>" . lang("IP", "logs") . " / " . lang("Host", "logs") . "</th><td>" . $userip . "</td></tr>"; $content .= "<tr class='logrow2'><th>" . lang("URL", "logs") . "</th><td>" . $log->logURL . "</td></tr>"; $content .= "<tr class='logrow1'><th>" . lang("Logmodule", "logs") . "</th><td>" . $log->logModule . "</td></tr>"; $content .= "<tr class='logrow2'><th>" . lang("Logfunction", "logs") . "</th><td>" . $log->logFunction . "</td></tr>"; $content .= "</table>";
function debo_mostrar_captcha() { global $globals; // Sólo mostramos el captcha si la ip se ha logueado erroneamente 3 veces en las últimas 24 horas return log_get("login_fail", ip2long($globals['ip']), 0, 24 * 60 * 60) >= 3; }