/var/www/html/wp-content/plugins/checkout-for-woocommerce/includes/Action/AccountExistsAction.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php

namespace Objectiv\Plugins\Checkout\Action;

/**
 * Class AccountExistsAction
 *
 * @link checkoutwc.com
 * @since 1.0.0
 * @package Objectiv\Plugins\Checkout\Action
 * @author Brandon Tassone <[email protected]>
 */
class AccountExistsAction extends CFWAction {

    
/**
     * AccountExistsAction constructor.
     *
     * @since 1.0.0
     * @access public
     */
    
public function __construct() {
        
parent::__construct'account_exists'false );
    }

    
/**
     * Checks whether the account exists on the website or not
     *
     * @since 1.0.0
     * @access public
     */
    
public function action() {
        
$email $_POST['email'] ?? '';

        
$this->out(
            array(
                
/**
                 * Filters whether or not an email address has an account
                 *
                 * @since 1.0.0
                 *
                 * @param bool $exists Whether an email exists or not
                 * @param string $email The email address we are checking
                 */
                
'account_exists' => (bool) apply_filters'cfw_email_exists'email_exists$email ), $email ),
            )
        );
    }
}