From: Steve Sutton Date: Thu, 31 Aug 2017 19:48:15 +0000 (-0400) Subject: Remove old ajax file X-Git-Tag: v1.0.0^2~430 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=35b5dcd30205a2418c75d98585d445f05f1618a9;p=WP-Plugins%2Fglm-member-db-registrations.git Remove old ajax file This is now in the account.php --- diff --git a/models/admin/ajax/checkEmail.php b/models/admin/ajax/checkEmail.php deleted file mode 100644 index 1722ed6..0000000 --- a/models/admin/ajax/checkEmail.php +++ /dev/null @@ -1,125 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @version 0.1 - */ - -/** - * Steve Note... - * - * You can get to this using the following URL. - * - * {host}/wp-admin/admin-ajax.php?action=glm_members_admin_ajax&glm_action=login - * - * You should be able to do this as POST or GET and should be able to add and read additional parameters. - * I added a "mystuff" parameter to the URL above and it does output from the code in the - * modelAction() function below. - * - * To add another model under models/admin/ajax all you need to do is create it and add it to the - * setup/validActions.php file. - * - */ - -/** - * This class performs the work of handling images passed to it via - * an AJAX call that goes through the WorPress AJAX Handler. - * - */ -class GlmMembersAdmin_ajax_checkEmail -{ - - /** - * WordPress Database Object - * - * @var $wpdb - * @access public - */ - public $wpdb; - /** - * Plugin Configuration Data - * - * @var $config - * @access public - */ - public $config; - - /* - * Constructor - * - * This contructor sets up this model. At this time that only includes - * storing away the WordPress data object. - * - * @return object Class object - * - */ - public function __construct ($wpdb, $config) - { - - // Save WordPress Database object - $this->wpdb = $wpdb; - - // Save plugin configuration object - $this->config = $config; - - // Run constructor for data class - //parent::__construct(false, false); - - } - - /* - * Perform Model Action - * - * This model checks to see if the creditials passed in are correct. - * - * This model action does not return, it simply does it's work then calls die(); - * - * @param $actionData - * - * Echos JSON string as response and does not return - */ - public function modelAction( $actionData = false ) - { - $return = false; - - if ( $email = filter_var( $_REQUEST['email'], FILTER_VALIDATE_EMAIL ) ) { - $accountId = $this->wpdb->get_var( - $this->wpdb->prepare( - "SELECT id - FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "account - WHERE email = %s", - $email - ) - ); - if ( $accountId ) { - $return = array( - 'valid' => true, - 'validEmail' => true, - 'id' => (int)$accountId, - 'email' => $email, - ); - } else { - $return = array( - 'valid' => false, - 'validEmail' => true, - ); - } - } else { - $return = array( - 'valid' => false, - 'validEmail' => false, - ); - } - header('Content-type:application/json;charset=utf-8', true); - echo json_encode( $return ); - exit(); - } -}