From 44d1e70ef62fd425a19a48f013df56fe6c745bd8 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 8 Mar 2018 16:11:28 -0500 Subject: [PATCH] adding locked to member check for users in member profile edit pages making it so users can't add cities unless they are admin or have capabilities --- index.php | 6 ++-- models/admin/member/memberInfo.php | 3 +- readme.txt | 3 ++ .../member/memberInfo/editProfileAddress.html | 33 ++++++++++--------- .../member/memberInfo/editProfileMailing.html | 31 +++++++++-------- 5 files changed, 43 insertions(+), 33 deletions(-) diff --git a/index.php b/index.php index a8d244ec..48110e7b 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.10.25 + * Version: 2.10.26 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -19,7 +19,7 @@ * @package glmMembersDatabase * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 2.10.25 + * @version 2.10.26 */ $GLOBALS['glmAssociateMemTracker'] = memory_get_usage(); @@ -46,7 +46,7 @@ if (!defined('ABSPATH')) { * */ -define('GLM_MEMBERS_PLUGIN_VERSION', '2.10.25'); +define('GLM_MEMBERS_PLUGIN_VERSION', '2.10.26'); define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.34'); // Check if plugin version is not current in WordPress option and if needed updated it diff --git a/models/admin/member/memberInfo.php b/models/admin/member/memberInfo.php index 2240f393..e8e99c38 100644 --- a/models/admin/member/memberInfo.php +++ b/models/admin/member/memberInfo.php @@ -533,7 +533,8 @@ class GlmMembersAdmin_member_memberInfo extends GlmDataMemberInfo 'noActive' => $this->noActiveInfoRecord(), 'time' => time(), 'slug' => GLM_MEMBERS_PLUGIN_SLUG, - 'customFieldResults' => $customFieldResults + 'customFieldResults' => $customFieldResults, + 'lockedToMember' => $lockedToMember ); // Return status, suggested view, and data to controller diff --git a/readme.txt b/readme.txt index ec545fcd..07a04f87 100644 --- a/readme.txt +++ b/readme.txt @@ -66,6 +66,9 @@ There is of course much more to this. (none) == Changelog == += 2.10.26 = +* Hiding the add cities button in member edit admin page for non-admin, locked to member users + = 2.10.24 = * Fix location of the custom field output in member edit profile form when adding the member info record. diff --git a/views/admin/member/memberInfo/editProfileAddress.html b/views/admin/member/memberInfo/editProfileAddress.html index d240f91d..f0d99068 100644 --- a/views/admin/member/memberInfo/editProfileAddress.html +++ b/views/admin/member/memberInfo/editProfileAddress.html @@ -19,24 +19,27 @@

City

- -
Add a new City
-
-
-
-

City Name:

-
- -
+ {if !$lockedToMember} + +
Add a new City
+
+
+
+

City Name:

+
+ +
+
+

* Required

+ Cancel +
-

* Required

- Cancel - -
- - + + + + {/if} -
+ {if !$lockedToMember} + +
Add a new City
+
+
+
+

City Name:

+
+ +
+
+

* Required

+ Cancel +
-

* Required

- Cancel - -
- + + + {/if}