예제 #1
0
 public static function init()
 {
     spl_autoload_register(array(__CLASS__, 'autoloader'));
     // WP_Auth0_Referer_Check::init();
     WP_Auth0_Ip_Check::init();
     add_action('init', array(__CLASS__, 'wp_init'));
     // Add hooks for clear up session
     add_action('wp_logout', array(__CLASS__, 'logout'));
     add_action('wp_login', array(__CLASS__, 'end_session'));
     // Add hooks for install uninstall and update
     register_activation_hook(WPA0_PLUGIN_FILE, array(__CLASS__, 'install'));
     register_deactivation_hook(WPA0_PLUGIN_FILE, array(__CLASS__, 'uninstall'));
     add_action('plugins_loaded', array(__CLASS__, 'check_update'));
     add_action('plugins_loaded', array(__CLASS__, 'initialize_wpdb_tables'));
     add_action('template_redirect', array(__CLASS__, 'init_auth0'), 1);
     // Add an action to append a stylesheet for the login page
     add_action('login_enqueue_scripts', array(__CLASS__, 'render_auth0_login_css'));
     // Add a hook to add Auth0 code on the login page
     add_filter('login_message', array(__CLASS__, 'render_form'));
     // Add hook to redirect directly on login auto
     add_action('login_init', array(__CLASS__, 'login_auto'));
     // Add hook to handle when a user is deleted
     add_action('delete_user', array(__CLASS__, 'delete_user'));
     add_shortcode('auth0', array(__CLASS__, 'shortcode'));
     add_action('wp_enqueue_scripts', array(__CLASS__, 'wp_enqueue'));
     add_action('widgets_init', array(__CLASS__, 'wp_register_widget'));
     add_filter('query_vars', array(__CLASS__, 'a0_register_query_vars'));
     $plugin = plugin_basename(__FILE__);
     add_filter("plugin_action_links_{$plugin}", array(__CLASS__, 'wp_add_plugin_settings_link'));
     if (isset($_GET['message'])) {
         add_action('wp_footer', array(__CLASS__, 'a0_render_message'));
     }
     WP_Auth0_UsersRepo::init();
     WP_Auth0_Settings_Section::init();
     WP_Auth0_Admin::init();
     WP_Auth0_ErrorLog::init();
     WP_Auth0_Configure_JWTAUTH::init();
     add_action('plugins_loaded', array(__CLASS__, 'checkJWTAuth'));
     add_filter('woocommerce_checkout_login_message', array(__CLASS__, 'override_woocommerce_checkout_login_form'));
     add_filter('woocommerce_before_customer_login_form', array(__CLASS__, 'override_woocommerce_login_form'));
 }
예제 #2
0
 public static function init()
 {
     spl_autoload_register(array(__CLASS__, 'autoloader'));
     // WP_Auth0_Referer_Check::init();
     WP_Auth0_Ip_Check::init();
     add_action('init', array(__CLASS__, 'wp_init'));
     // Add hooks for clear up session
     add_action('wp_logout', array(__CLASS__, 'logout'));
     add_action('wp_login', array(__CLASS__, 'end_session'));
     // Add hooks for install uninstall and update
     register_activation_hook(WPA0_PLUGIN_FILE, array(__CLASS__, 'install'));
     register_deactivation_hook(WPA0_PLUGIN_FILE, array(__CLASS__, 'uninstall'));
     add_action('plugins_loaded', array(__CLASS__, 'check_update'));
     add_action('plugins_loaded', array(__CLASS__, 'initialize_wpdb_tables'));
     add_action('template_redirect', array(__CLASS__, 'init_auth0'), 1);
     add_filter('login_message', array(__CLASS__, 'render_form'));
     // Add hook to redirect directly on login auto
     add_action('login_init', array(__CLASS__, 'login_auto'));
     // Add hook to handle when a user is deleted
     add_action('delete_user', array(__CLASS__, 'delete_user'));
     add_shortcode('auth0', array(__CLASS__, 'shortcode'));
     add_action('wp_enqueue_scripts', array(__CLASS__, 'wp_enqueue'));
     WP_Auth0_Admin::init();
 }