Home › Forums › Legacy Support › Support queries › Other issues › Missing Security
Tagged: missing security
- This topic has 20 replies, 2 voices, and was last updated 6 years ago by dadoge.
-
AuthorPosts
-
October 15, 2018 at 3:37 pm #180149dadogeSpectatorGood 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 DanieleOctober 16, 2018 at 2:14 pm #180299Anshuman SahuKeymaster
- for this please make sure that your wplms theme and all its plugin updated to latest version 3.7.x .
- try this code :
October 17, 2018 at 4:50 pm #180457dadogeSpectatorGreat! 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.October 17, 2018 at 5:11 pm #180459dadogeSpectatorThis reply has been marked as private.October 18, 2018 at 2:13 pm #180606Anshuman SahuKeymasterprovide me some time to modify the code.October 19, 2018 at 9:08 am #180662dadogeSpectatorTake your time. There is no hurry.October 20, 2018 at 1:23 pm #180789Anshuman SahuKeymaster- done.
- sorry not possible ..
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'; }
October 22, 2018 at 11:38 am #180981dadogeSpectatorHi 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?October 23, 2018 at 2:56 pm #181195Anshuman SahuKeymastermissing 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 ?October 23, 2018 at 3:05 pm #181200dadogeSpectatorSorry, I corrected the password (same as before) added in wplms-customizer.php as reported in the previous messageOctober 24, 2018 at 3:05 pm #181418Anshuman SahuKeymasterneed: network admin credentials , also ftp or cpanel credentials to check your files . mark reply as private while sharing .October 25, 2018 at 9:05 am #181558dadogeSpectatorThis reply has been marked as private.October 26, 2018 at 2:50 pm #181849Anshuman SahuKeymasterThis reply has been marked as private.October 26, 2018 at 4:12 pm #181867dadogeSpectatorThis reply has been marked as private.October 27, 2018 at 12:49 pm #181967Anshuman SahuKeymasterokay please clear cache and check this again , -
AuthorPosts
- The topic ‘Missing Security’ is closed to new replies.