From 4b9b4de9b313147261f702b347463d8b66d2cadc Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Thu, 1 Jun 2017 14:18:28 -0400 Subject: [PATCH] Fixed problem with not retrieving plugin configuration parameters in some cases. --- index.php | 55 +++++++++++++++++++++++++++--------------------------- readme.txt | 5 +++-- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/index.php b/index.php index d48510bb..10f4a7d4 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 2.9.16 + * Version: 2.9.17 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -38,7 +38,7 @@ * */ -define('GLM_MEMBERS_PLUGIN_VERSION', '2.9.16'); +define('GLM_MEMBERS_PLUGIN_VERSION', '2.9.17'); define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.31'); // Check if plugin version is not current in WordPress option and if needed updated it @@ -349,31 +349,6 @@ require_once GLM_MEMBERS_PLUGIN_PATH . '/classes/glmPluginSupport.php'; // Load Smarty Template Support require_once GLM_MEMBERS_PLUGIN_PATH . '/lib/smartyTemplateSupport.php'; -/* - * Hook through which an add-on may supply additional logged in user information and - * have that data stored in the config array. Typically it would be the - * glm-members-db-contacts add-on supplying the information. - * - * This hook provides default data with the current WordPress user 'data' object - * as a 'wpUser' sub-array if a WordPress user is logged in. If not 'wpUser' will - * be false. The supplied data is the basic information on the WordPress user - * provided by the 'data' object from wp_get_current_user(). - * - * To permit more than one routine to access this filter and therefore to supply - * additional information on the logged in user, code may merge it's own data or may - * add another sub-array containing user information specific to an add-on (i.e. - * contacts add-on might supply a 'contactUser' sub-array). - * - */ -if (function_exists('is_user_logged_in')) { - $config['loggedInUser'] = array( - 'wpUser' => false - ); - if (is_user_logged_in()) { - $config['loggedInUser']['wpUser'] = (array) wp_get_current_user()->data; - } - $config['loggedInUser'] = apply_filters('glm_members_current_logged_in_user', $config['loggedInUser']); -} // Check all database tables for all registered add-ons, allow install/update if (glmCheckDatabase('install')) { @@ -415,6 +390,32 @@ if (glmCheckDatabase('install')) { } // have databases +/* + * Hook through which an add-on may supply additional logged in user information and + * have that data stored in the config array. Typically it would be the + * glm-members-db-contacts add-on supplying the information. + * + * This hook provides default data with the current WordPress user 'data' object + * as a 'wpUser' sub-array if a WordPress user is logged in. If not 'wpUser' will + * be false. The supplied data is the basic information on the WordPress user + * provided by the 'data' object from wp_get_current_user(). + * + * To permit more than one routine to access this filter and therefore to supply + * additional information on the logged in user, code may merge it's own data or may + * add another sub-array containing user information specific to an add-on (i.e. + * contacts add-on might supply a 'contactUser' sub-array). + * + */ +if (function_exists('is_user_logged_in')) { + $config['loggedInUser'] = array( + 'wpUser' => false + ); + if (is_user_logged_in()) { + $config['loggedInUser']['wpUser'] = (array) wp_get_current_user()->data; + } + $config['loggedInUser'] = apply_filters('glm_members_current_logged_in_user', $config['loggedInUser']); +} + /* * * Determine which controller to load diff --git a/readme.txt b/readme.txt index e9022d80..a3c9a437 100644 --- a/readme.txt +++ b/readme.txt @@ -67,7 +67,8 @@ There is of course much more to this. == Changelog == -= 2.9.15 = += 2.9.17 = + +* Fixed login contact permission issues where there were difficulties reading the current contact role. -Current version. -- 2.17.1