-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude pages on "enforce_privacy" sites #494
Comments
My idea would be to add this filter: public function enforce_privacy_redirect() {
if ( $this->settings->enforce_privacy && ! is_user_logged_in() ) {
// The client endpoint relies on the wp-admin ajax endpoint.
if ( ! defined( 'DOING_AJAX' ) || ! constant( 'DOING_AJAX' ) || ! isset( $_GET['action'] ) || 'openid-connect-authorize' != $_GET['action'] ) {
$exclude = apply_filters( 'openid-connect-generic-exclude-auth', false );
if ( ! $exclude ) {
auth_redirect();
}
}
} This does not work! |
You mention "single sites" so does this mean you are trying to do this on a Multi site instance? |
Sorry for the wrong choice of words. We run a intranet site that requires the users to be logged in obviously. I need to
|
@timnolte any idea to get this integrated? public function enforce_privacy_redirect() {
if ( $this->settings->enforce_privacy && ! is_user_logged_in() ) {
// The client endpoint relies on the wp-admin ajax endpoint.
if ( ! defined( 'DOING_AJAX' ) || ! constant( 'DOING_AJAX' ) || ! isset( $_GET['action'] ) || 'openid-connect-authorize' != $_GET['action'] ) {
$exclude = is_page(array(144,194,5,));
// $exclude = apply_filters( 'openid-connect-generic-exclude-auth', false );
if ( ! $exclude ) {
auth_redirect();
}
}
}
}
if I use that intended filter the |
@cfoellmann hmm, that doesn't make sense that |
it is not available in a mu-plugins/ plugin |
Can I go via another action to fire the filter later from within the must-use plugin code? |
Hi, |
I would like to exclude single sites from the login enforcement (enforce_private = 1) but the action
template_redirect
is pretty hard/impossible to manipulate.Anyone know a way to conditionally remove the action?
is_page
is not available in that context.The text was updated successfully, but these errors were encountered: