mirror of
https://gh.wpcy.net/https://github.com/webguyio/dam-spam.git
synced 2026-05-27 03:23:56 +08:00
26 lines
623 B
PHP
26 lines
623 B
PHP
<?php
|
|
|
|
if ( !defined( 'ABSPATH' ) ) {
|
|
status_header( 404 );
|
|
exit;
|
|
}
|
|
|
|
class dam_spam_check_admin extends dam_spam_module {
|
|
public function process( $ip, &$stats = array(), &$options = array(), &$post = array() ) {
|
|
$login = $post['author'];
|
|
$pwd = $post['pwd'];
|
|
if ( stripos( $login, 'admin' ) === false ) {
|
|
return false;
|
|
}
|
|
if ( !function_exists( 'get_users' ) ) {
|
|
return false;
|
|
}
|
|
if ( get_user_by( 'login', $login ) ) {
|
|
return false;
|
|
}
|
|
// translators: %s is the admin username detected
|
|
return sprintf( esc_html__( 'Admin Login or Registration Attempt: %s', 'dam-spam' ), $login );
|
|
}
|
|
}
|
|
|
|
?>
|