Start for cron task
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 11 Apr 2018 20:31:20 +0000 (16:31 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 11 Apr 2018 20:31:20 +0000 (16:31 -0400)
For setting member contacts to login only when they expire.

models/admin/ajax/flagExpired.php [new file with mode: 0644]

diff --git a/models/admin/ajax/flagExpired.php b/models/admin/ajax/flagExpired.php
new file mode 100644 (file)
index 0000000..3977775
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * PDF Output by admin-ajax
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @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 '<pre>$currentDate: ' . print_r( $currentDate, true ) . '</pre>';
+
+        // 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();
+    }
+}