removed code used for testing.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 31 Jan 2017 20:41:43 +0000 (15:41 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 31 Jan 2017 20:41:43 +0000 (15:41 -0500)
index.php

index 2fe59d0..4e1ad99 100644 (file)
--- a/index.php
+++ b/index.php
@@ -251,9 +251,10 @@ if ($wpUserID) {
 //
 function my_login_redirect($redirect_to, $request, $user) {
 
+    global $current_user;
+
     // If this is a front-end request, return them to the front-end ($redirect_to should already point there)
     if (get_option('glm_members_database_frontend_login_request') != 'false') {
-trigger_error('Front-End request', E_USER_NOTICE);
 
         // Also clear the front-end login request flag
         update_option('glm_members_database_frontend_login_request', 'false');
@@ -263,21 +264,18 @@ trigger_error('Front-End request', E_USER_NOTICE);
 
     // If user is administrator send them to the main dashboard
     if (!in_array('administrator', $current_user->roles)) {
-trigger_error('Sending to main dashboard', E_USER_NOTICE);
         $redirect_to = admin_url();
         return $redirect_to;
     }
 
     // If this is not a GLM Associate login or members are not enabled, allow the default (should be profile menu)
     if (!current_user_can('glm_members_login') || !$config['settings']['enable_members']) {
-trigger_error('Not GLM Associate Login', E_USER_NOTICE);
 
         return $redirect_to;
     }
 
     // If user is an all members manager, send them to the "Members" menu
     if (current_user_can('glm_members_members')) {
-trigger_error('Members Manager', E_USER_NOTICE);
 
         $redirect_to = get_admin_url() . "admin.php?page=glm-members-admin-menu-members";
          return $redirect_to;
@@ -285,13 +283,11 @@ trigger_error('Members Manager', E_USER_NOTICE);
 
     // If user is a member manager, send them to the "Member" menu
     if (current_user_can('glm_members_member')) {
-trigger_error('Member Manager', E_USER_NOTICE);
 
         $redirect_to = get_admin_url() . "admin.php?page=glm-members-admin-menu-member";
         return $redirect_to;
     }
 
-trigger_error('Doing default', E_USER_NOTICE);
     // If there's anything else going on, they go to what was requested
     return $redirect_to;