|
5 | 5 | Plugin URI: http://github.com/psignoret/aad-sso-wordpress |
6 | 6 | Description: Allows you to use your organization's Azure Active Directory user accounts to log in to WordPress. If your organization is using Office 365, your user accounts are already in Azure Active Directory. This plugin uses OAuth 2.0 to authenticate users, and the Azure Active Directory Graph to get group membership and other details. |
7 | 7 | Author: Philippe Signoret |
8 | | -Version: 0.6.2 |
| 8 | +Version: 0.6.3 |
9 | 9 | Author URI: https://www.psignoret.com/ |
10 | 10 | Text Domain: aad-sso-wordpress |
11 | 11 | Domain Path: /languages/ |
|
17 | 17 | define( 'AADSSO_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
18 | 18 | define( 'AADSSO_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
19 | 19 |
|
20 | | -defined( 'AADSSO_DEBUG' ) or define( 'AADSSO_DEBUG', FALSE ); |
| 20 | +defined( 'AADSSO_DEBUG' ) or define( 'AADSSP_DEBUG', FALSE ); |
21 | 21 | defined( 'AADSSO_DEBUG_LEVEL' ) or define( 'AADSSO_DEBUG_LEVEL', 0 ); |
22 | 22 |
|
23 | 23 | // Proxy to be used for calls, should be useful for tracing with Fiddler |
@@ -638,8 +638,24 @@ public static function debug_log( $message, $level = 0 ) { |
638 | 638 | */ |
639 | 639 | do_action( 'aadsso_debug_log', $message ); |
640 | 640 |
|
641 | | - // AADSSO_DEBUG and AADSSO_DEBUG_LEVEL are already defined. |
642 | | - if ( AADSSO_DEBUG && AADSSO_DEBUG_LEVEL >= $level ) { |
| 641 | + /** |
| 642 | + * Allow other plugins or themes to set the debug status of this plugin. |
| 643 | + * |
| 644 | + * @since 0.6.3 |
| 645 | + * @param bool The current debug status. |
| 646 | + */ |
| 647 | + $debug_enabled = apply_filters( 'aadsso_debug', AADSSO_DEBUG ); |
| 648 | + |
| 649 | + |
| 650 | + /** |
| 651 | + * Allow other plugins or themes to set the debug level |
| 652 | + * @since 0.6.3 |
| 653 | + * @param int |
| 654 | + */ |
| 655 | + $debug_level = apply_filters( 'aadsso_debug_level', AADSSO_DEBUG_LEVEL ); |
| 656 | + |
| 657 | + |
| 658 | + if ( true === $debug_enabled && $debug_level >= $level ) { |
643 | 659 | if ( false === strpos( $message, "\n" ) ) { |
644 | 660 | error_log( 'AADSSO: ' . $message ); |
645 | 661 | } else { |
|
0 commit comments