Missing Security

Home Forums Legacy Support Support queries Other issues Missing Security

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #180149
    dadoge
    Spectator
    Good morning, I apologize for my English. I can not solve the error message Missing Security, I saw other posts in which it was recommended to remove the cache, but with me it did not work, I also tried W3 total Cache, Wp super cache and others but without result, I also tried prevent browser caching but without success. I would not like to disable Ajax login because in case of incorrect password I would like to keep the popup control and not redirect the user on other pages. I would also have another request if possible. I would like to customize the redirect on login, I found the code to be included in wplms-customizer that works properly, but I would like to make sure that the user is redirected to the My Courses page, I tried to change the code in this way:   add_filter ( 'wplms_student_login_redirect_filters', 'wplms_redirect_student_to_custom'); function wplms_redirect_student_to_custom ($ labels) { $ labels ['custom'] = 'Custom Link'; return $ labels; } add_filter ( 'wplms_redirect_location', 'wplms_custom_filter_location_student'); function wplms_custom_filter_location_student ($ links) { global $ user_login;       get_currentuserinfo (); $ links ['custom'] = 'https://www.<b>mydomain.com</b>/member/'.$user_login.'/course/'; return $ links; } but does not value $ user_login can you suggest the right procedure? Thank you Daniele
    #180299
    Anshuman Sahu
    Keymaster
     
    1. for this please make sure that your wplms theme and all its plugin updated to latest version 3.7.x .
    if still issue appears please share your site url , admin credentials in private reply to check this issue at your end .    
    1. try this code :
        add_filter('login_redirect','login_redirect_custom',999,3); function login_redirect_custom($redirect_url,$request_url,$user){     global $bp;     if(!user_can($user->ID,'edit_posts')){       $redirect_url = bp_core_get_user_domain($user->ID).'/'.(defined('WPLMS_COURSE_SLUG')?WPLMS_COURSE_SLUG:'course');     }     return $redirect_url.'?1'; }
    #180457
    dadoge
    Spectator
    Great! The code is perfect and it works great, I would have some other requests: 1) if a user registers without enrolling in any course, at the next login you will be redirected to the page my courses empty, you can retrieve the number of courses to which he is enrolled so that if he has no courses at login is redirected to the page all courses? 2) if a new user wants to register for a course, is postponed to registration and will then repeat the choice of course to register, is it possible to make sure that after registering is automatically enrolled in the course he had chosen? 3) I would like to be able to redirect the user to different pages based on the role, I modified the previous code like this:   add_filter('login_redirect','login_redirect_custom',999,3); function login_redirect_custom($redirect_url,$request_url,$user){ global $bp; if(!user_can($user->ID,'edit_posts')){ $redirect_url = bp_core_get_user_domain($user->ID).'/'.(defined('WPLMS_COURSE_SLUG')?WPLMS_COURSE_SLUG:'course'); } else { $redirect_url = 'https://www.mydomain.com/area-clienti/bacheca/';  } return $redirect_url.'?1'; }   it works, the student is redirected to the page my courses, while all the others on the bulletin board page. But I would like a particular user with a "guest" role to be redirected to a certain page, a user with a "client" role on a different page etc ... But I can not find a condition that controls the role. I know it's not about WPLMS in particular, can you help me? Thank you In private msg, I share Administrator credentials to resolve the Missing Security problem.
    #180459
    dadoge
    Spectator
    This reply has been marked as private.
    #180606
    Anshuman Sahu
    Keymaster
    provide me some time to modify the code.
    #180662
    dadoge
    Spectator
    Take your time. There is no hurry.
    #180789
    Anshuman Sahu
    Keymaster
    1. done.
    modified code : add_filter('login_redirect','login_redirect_custom',999,3);   function login_redirect_custom($redirect_url,$request_url,$user){   global $bp;   if(!user_can($user->ID,'edit_posts')){ if(!empty(bp_course_get_total_course_count_for_user($user->ID))){ $redirect_url = bp_core_get_user_domain($user->ID).'/'.(defined('WPLMS_COURSE_SLUG')?WPLMS_COURSE_SLUG:'course');   }else{ $pages = get_option('bp-pages'); $course_dir = isset($pages['course'])?$pages['course']:0; if(function_exists('icl_object_id')){ $course_dir = icl_object_id($course_dir, 'page', true); } $redirect_url = get_permalink($course_dir); }     }   else {   $redirect_url = 'https://www.mydomain.com/area-clienti/bacheca/';   }   return $redirect_url.'?1';   }  
    1. sorry not possible ..

    2. you can use this function I made to check :

        function check_user_role($uer_id,$role){ $user= get_userdata( $user_id );   // Get all the user roles as an array. $user_roles = $user_meta->roles;   // Check if the role you're interested in, is present in the array. if ( in_array($role, $user_roles) ) { // Do something. return true; } return false; }     USAGE :   if(check_user_role($user_id, 'guest')){ $redirect_url = 'gues-redirect-url'; }

    #180981
    dadoge
    Spectator
    Hi Alex, do you have good news to give me about Missing Securiy? Thanks for the help, it works correctly, if the student is enrolled in at least one course he is redirected to my courses otherwise to all courses. Excuse me but I do not understand how to redirect based on the role, I tried like this:   function check_user_role($uer_id,$role){ $user= get_userdata( $user_id ); // Get all the user roles as an array. $user_roles = $user_meta->roles; // Check if the role you're interested in, is present in the array.   if ( in_array($role, $user_roles) ) { // Do something. return true; } return false; }   add_filter('login_redirect','login_redirect_custom',999,3); function login_redirect_custom($redirect_url,$request_url,$user){ global $bp; if(!user_can($user->ID,'edit_posts')){ if(!empty(bp_course_get_total_course_count_for_user($user->ID))){ $redirect_url = bp_core_get_user_domain($user->ID).'/'.(defined('WPLMS_COURSE_SLUG')?WPLMS_COURSE_SLUG:'course'); }else{ $pages = get_option('bp-pages'); $course_dir = isset($pages['course'])?$pages['course']:0; if(function_exists('icl_object_id')){ $course_dir = icl_object_id($course_dir, 'page', true); } $redirect_url = get_permalink($course_dir); } } else { if(check_user_role($user_id, 'guest')){ $redirect_url = 'https://www.mydomain.com/redirect'; } } return $redirect_url.'?1'; }   it does not work, where am I wrong?
    #181195
    Anshuman Sahu
    Keymaster
    missing security issue : password not working : http://prntscr.com/l9hw40  please share a valid one . the issue is actually related to the custom code you are adding in file . Please tell me in which files did you try to add the custom php codes ?  
    #181200
    dadoge
    Spectator
    Sorry, I corrected the password (same as before) added in wplms-customizer.php as reported in the previous message
    #181418
    Anshuman Sahu
    Keymaster
    need: network admin credentials , also ftp or cpanel credentials to check your files .   mark reply as private while sharing .
    #181558
    dadoge
    Spectator
    This reply has been marked as private.
    #181849
    Anshuman Sahu
    Keymaster
    This reply has been marked as private.
    #181867
    dadoge
    Spectator
    This reply has been marked as private.
    #181967
    Anshuman Sahu
    Keymaster
    okay please clear cache and check this again ,
Viewing 15 posts - 1 through 15 (of 21 total)
  • The topic ‘Missing Security’ is closed to new replies.