From 73f57bf7ffece187c282d767641f87ab3f27afc0 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Tue, 1 Dec 2015 12:15:30 -0500 Subject: [PATCH] Dealing with login situations for various contact users --- glm-member-db-contacts.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/glm-member-db-contacts.php b/glm-member-db-contacts.php index 0a8cbea..139d6b3 100644 --- a/glm-member-db-contacts.php +++ b/glm-member-db-contacts.php @@ -168,6 +168,12 @@ add_filter('glm-member-db-register-addon','glmMembersRegisterContacts', 10, 1); */ require_once(GLM_MEMBERS_CONTACTS_PLUGIN_SETUP_PATH.'/permissions.php'); + +// If they are a restricted user, kick them back out +if (current_user_can('glm_members_restricted_contact')) { + wp_logout(); +} + /* * Add filter to redirect user to a particular destination on * login based on their roles. @@ -184,11 +190,12 @@ function my_login_redirect( $redirect_to, $request, $user ) { foreach ($user->roles as $r) { if (substr($r,0,12) != 'glm_members_') { // Go to normal destination for this user - return 'htt://www.gaslightmedia.com'; + return $redirect_to(); } } // If we get here, this is a pure contact user, start them at their profile + return '/wp-admin/admin.php?page=glm-members-admin-menu-profile'; } -- 2.17.1