From 008d0c72e52be8429f0cbe0878391d3cd91b11c6 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 11 Apr 2018 16:31:20 -0400 Subject: [PATCH] Start for cron task For setting member contacts to login only when they expire. --- models/admin/ajax/flagExpired.php | 82 +++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 models/admin/ajax/flagExpired.php diff --git a/models/admin/ajax/flagExpired.php b/models/admin/ajax/flagExpired.php new file mode 100644 index 0000000..3977775 --- /dev/null +++ b/models/admin/ajax/flagExpired.php @@ -0,0 +1,82 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @version 0.1 + */ + +require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/billingSupport.php'; +/** + * Steve Note... + * + * You can get to this using the following URL. + * + * {host}/wp-admin/admin-ajax.php?action=glm_members_admin_ajax&glm_action=setupQueue + * + * 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. + * + */ + +// Load Members data abstract +// require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataImages.php'; + +/** + * 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_flagExpired +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + } + + public function modelAction( $actionData = false ) { + + $currentDate = new DateTime(); + echo '
$currentDate: ' . print_r( $currentDate, true ) . '
'; + + // Update All expired accounts so they can only be in members only not admin. + // TODO: Find all member contacts (by ref_dest) with accounts that are expired. + // With those set their contact_role to 30 (login only) + + + wp_die(); + } +} -- 2.17.1