Temporarily bypassed login user handling
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 25 Jan 2016 14:23:34 +0000 (09:23 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 25 Jan 2016 14:23:34 +0000 (09:23 -0500)
glm-member-db-contacts.php

index 0c2bc19..563bf40 100644 (file)
@@ -184,6 +184,7 @@ require_once(GLM_MEMBERS_CONTACTS_PLUGIN_SETUP_PATH.'/permissions.php');
 /*
  * Notification to user if logging in with restricted contact
  */
+$wpUserID = get_current_user_id();
 function glmMembersContactsNoLoginMessage( $message ) {
         $message .= "
             <div style=\"border-left:4px solid #dd3d36;background:#fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding-left: .5em;\">
@@ -193,27 +194,29 @@ function glmMembersContactsNoLoginMessage( $message ) {
         ";
         return $message;
 }
-$restrictedLoginAttempt = get_option('glmMembersDatabaseContactsRestrictedLogin');
+/*
+$restrictedLoginAttempt = get_user_meta($wpUserID, 'glmMembersDatabaseContactRestrictedLogin', false);
 if ($restrictedLoginAttempt) {
     add_filter('login_message', 'glmMembersContactsNoLoginMessage');
-    delete_option('glmMembersDatabaseContactsRestrictedLogin');
+    delete_user_mega($wpUserID, 'glmMembersDatabaseContactRestrictedLogin');
 }
 if (current_user_can('glm_members_restricted_contact')) {
-    update_option('glmMembersDatabaseContactsRestrictedLogin', true);
+    update_user_meta($wpUserID, 'glmMembersDatabaseContactRestrictedLogin', true);
     wp_logout();
 }
-
+*/
 /*
  * Check for a contact user that's inactive and send them back to login also
  */
+/*
 $wpUserID = get_current_user_id();
 $contactUser = get_user_meta($wpUserID, 'glmMembersContactID', true);
 $contactActive = get_user_meta($wpUserID, 'glmMembersContactActive', true);
 if ($contactUser && !$contactActive) {
-    update_option('glmMembersDatabaseContactsRestrictedLogin', true);
+    update_user_meta($wpUserID, 'glmMembersDatabaseContactRestrictedLogin', true);
     wp_logout();
 }
-
+*/