Making WordPress.org


Ignore:
Timestamp:
04/13/2021 07:23:31 AM (3 years ago)
Author:
dd32
Message:

Login: Add an interstitial to record ToS/CoC/Privacy policy acceptance upon login, blocking login if not accepted.

This is currently only enabled for super admins while the feature is debugged/finalised.

See #5618.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/wporg-sso/class-wporg-sso.php

    r10374 r10889  
    1111        const SUPPORT_EMAIL = 'forum-password-resets@wordpress.org';
    1212
     13        const LOGIN_TOS_COOKIE  = 'wporg_tos_login';
     14        const TOS_USER_META_KEY = 'tos_revision';
     15
    1316        const VALID_HOSTS = [
    1417            'wordpress.org',
     
    2528        public $script;
    2629
     30        private static $instance = null;
     31
    2732        /**
    2833         * Constructor, instantiate common properties
     
    3742                $this->script = $_SERVER['SCRIPT_NAME'];
    3843            }
     44        }
     45
     46        public static function get_instance() {
     47            if ( is_null( self::$instance ) ) {
     48                $class = get_called_class();
     49                self::$instance = new $class;
     50            }
     51
     52            return self::$instance;
    3953        }
    4054
     
    195209            }
    196210
     211            if ( function_exists( 'apply_filters' ) ) {
     212                $to = apply_filters( 'wp_redirect', $to, $status );
     213            }
     214
    197215            header(
    198216                'Location: ' . $to,
Note: See TracChangeset for help on using the changeset viewer.