removing glm_login functions from functions.php, changing enter admin area button
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 2 Feb 2017 15:03:46 +0000 (10:03 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 2 Feb 2017 15:03:46 +0000 (10:03 -0500)
to redirect to the main admin page

functions.php
parts/glm-members-only-top-bar.php

index b4ef486..cf49224 100644 (file)
@@ -230,44 +230,6 @@ if (!function_exists('is_in_tree')) {
         return false;
     }
 }
-
-/**
- * Function Name:   front_end_login_fail.
- * Added for:       GLM Member DB front-end login failure custom redirection.
- * Description:     This redirects the failed login to the custom login page
- *                  instead of default login page with a modified url
-**/
-add_action( 'wp_login_failed', 'front_end_login_fail' );
-function front_end_login_fail( $username ) {
-    // Getting URL of the login page
-    $referrer = $_SERVER['HTTP_REFERER'];
-    // if there's a valid referrer, and it's not the default log-in screen
-    if( !empty( $referrer ) && !strstr( $referrer,'wp-login' ) && !strstr( $referrer,'wp-admin' ) ) {
-        wp_redirect( get_permalink( get_option('glm_members_database_option_members_only_id') ) . "?login=failed" );
-        exit;
-    }
-}
-
-/**
- * Function Name:   front_end_blank_credentials.
- * Added for:       GLM Member DB front-end login failure custom redirection.
- * Description:     This redirects to the custom login page if user name or
- *                  password is empty with a modified url
-**/
-add_action( 'authenticate', 'front_end_blank_credentials', 1, 3);
-function front_end_blank_credentials( $login, $username, $password ) {
-
-    // Getting URL of the login page
-    $referrer = $_SERVER['HTTP_REFERER'];
-    // if there's a valid referrer, and it's not the default log-in screen
-    if( !empty( $referrer ) && !strstr( $referrer,'wp-login' ) && !strstr( $referrer,'wp-admin' ) ) {
-        if( $username == "" || $password == "" ){
-            wp_redirect( get_permalink( get_option('glm_members_database_option_members_only_id') ) . "?login=empty" );
-            exit;
-        }
-    }
-}
-
 if ( ! function_exists( 'glm_members_only_menu')) {
     function glm_members_only_menu() {
         wp_nav_menu(array(
index 0207260..733c002 100644 (file)
@@ -3,6 +3,6 @@
     <a class='button glm-button' href="<?php echo wp_logout_url( home_url() ); ?>">Logout</a>
     <?php if (current_user_can("glm_members_member")) { ?>
         <?php $glmAssociateTerms = apply_filters('glm_associate_terms', "");?>
-        <a class='button glm-button' href='<?php echo get_admin_url() ?>admin.php?page=glm-members-admin-menu-member'>Enter <?php echo $glmAssociateTerms['term_member_cap']; ?> Admin Area</a>                        
+        <a class='button glm-button' href='<?php echo get_admin_url() ?>'>Enter <?php echo $glmAssociateTerms['term_member_cap']; ?> Admin Area</a>                        
     <?php } ?>
 </div>
\ No newline at end of file