mirror of
https://gh.wpcy.net/https://github.com/webguyio/dam-spam.git
synced 2026-05-25 03:03:57 +08:00
30 lines
No EOL
705 B
PHP
30 lines
No EOL
705 B
PHP
<?php
|
|
|
|
if ( !defined( 'ABSPATH' ) ) {
|
|
status_header( 404 );
|
|
exit;
|
|
}
|
|
|
|
class dam_spam_check_admin_log extends dam_spam_module {
|
|
public function process( $ip, &$stats = array(), &$options = array(), &$post = array() ) {
|
|
$sname = $this->getSname();
|
|
if ( !class_exists( 'GoogleAuthenticator' )
|
|
&& strpos( $sname, 'wp-login.php' ) !== false
|
|
&& function_exists( 'wp_authenticate' )
|
|
) {
|
|
$log = $post['author'];
|
|
$pwd = $post['pwd'];
|
|
if ( empty( $log ) || empty( $pwd ) ) {
|
|
return false;
|
|
}
|
|
$user = @wp_authenticate( $log, $pwd );
|
|
if ( !is_wp_error( $user ) ) {
|
|
return esc_html__( 'Authenticated User Login', 'dam-spam' );
|
|
}
|
|
return false;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
?>
|