Changeset 1996343
- Timestamp:
- 12/17/2018 11:49:36 AM (6 years ago)
- Location:
- next-active-directory-integration/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
next-active-directory-integration/trunk/classes/Adi/Authentication/LoginService.php
r1986677 r1996343 89 89 { 90 90 add_filter('authenticate', array($this, 'authenticate'), 10, 3); 91 add_filter(NEXT_AD_INT_PREFIX . 'auth_before_create_or_update_user', array($this, 'beforeCreateOrUpdateUser'), 10 , 2);92 add_filter(NEXT_AD_INT_PREFIX . 'auth_after_create_or_update_user', array($this, 'afterCreateOrUpdateUser'), 10, 3);93 91 94 92 // disable 'lost password' feature … … 102 100 } 103 101 } 102 103 /** 104 * Register custom authentication hooks required during the authentication process. 105 */ 106 public function registerAuthenticationHooks() 107 { 108 add_filter(NEXT_AD_INT_PREFIX . 'auth_before_create_or_update_user', array($this, 'beforeCreateOrUpdateUser'), 10 , 2); 109 add_filter(NEXT_AD_INT_PREFIX . 'auth_after_create_or_update_user', array($this, 'afterCreateOrUpdateUser'), 10, 3); 110 } 104 111 105 112 /** … … 826 833 */ 827 834 public function beforeCreateOrUpdateUser($credentials, $ldapAttributes) { 835 $this->logger->info("Hook beforeCreateOrUpdateUser executed"); 828 836 return true; 829 837 } … … 836 844 */ 837 845 public function afterCreateOrUpdateUser($credentials, $adiUser, $wpUser) { 846 $this->logger->info("Hook afterCreateOrUpdateUser executed, wpUser: '" . is_object($wpUser) . "'"); 838 847 return $wpUser; 839 848 } -
next-active-directory-integration/trunk/classes/Adi/Init.php
r1861755 r1996343 1 1 <?php 2 if ( !defined('ABSPATH')) {2 if ( ! defined('ABSPATH')) { 3 3 die('Access denied.'); 4 4 } … … 65 65 // At a later point we check for ID = 1 (local WordPress admin) but this user can be different from the current user (= another WordPress administrator). 66 66 $currentUser = wp_get_current_user(); 67 $optionName = NextADInt_Adi_Configuration_Options::EXCLUDE_USERNAMES_FROM_AUTHENTICATION;67 $optionName = NextADInt_Adi_Configuration_Options::EXCLUDE_USERNAMES_FROM_AUTHENTICATION; 68 68 $optionValue = $currentUser->user_login; 69 69 70 70 if (is_multisite()) { 71 $this->dc()->getProfileConfigurationRepository()->persistSanitizedValue($profileId, $optionName, $optionValue); 71 $this->dc()->getProfileConfigurationRepository()->persistSanitizedValue($profileId, $optionName, 72 $optionValue); 72 73 } else { 73 74 $this->dc()->getBlogConfigurationRepository()->persistSanitizedValue(0, $optionName, $optionValue); … … 119 120 120 121 // load internationalization (i18n) 121 load_plugin_textdomain('next-active-directory-integration', false, plugin_basename(NEXT_AD_INT_PATH) . '/languages'); 122 load_plugin_textdomain('next-active-directory-integration', false, 123 plugin_basename(NEXT_AD_INT_PATH) . '/languages'); 122 124 123 125 // ADI-354 (dme) 124 126 $configurationService = $this->dc()->getConfiguration(); 125 $enableLogging = $configurationService->getOptionValue(NextADInt_Adi_Configuration_Options::LOGGER_ENABLE_LOGGING);126 $customPath = $configurationService->getOptionValue((NextADInt_Adi_Configuration_Options::LOGGER_CUSTOM_PATH));127 $enableLogging = $configurationService->getOptionValue(NextADInt_Adi_Configuration_Options::LOGGER_ENABLE_LOGGING); 128 $customPath = $configurationService->getOptionValue((NextADInt_Adi_Configuration_Options::LOGGER_CUSTOM_PATH)); 127 129 128 130 NextADInt_Core_Logger::initializeLogger($enableLogging, $customPath); … … 196 198 } 197 199 200 // ADI-665 register the hooks required during the test authentication process 201 if ($this->isOnTestAuthenticationPage()) { 202 $this->dc()->getLoginService()->registerAuthenticationHooks(); 203 } 204 205 198 206 $currentUserId = wp_get_current_user()->ID; 199 207 200 if ( !$currentUserId) {208 if ( ! $currentUserId) { 201 209 // the current user is not logged in so further hooks must not be processed 202 210 return false; … … 236 244 { 237 245 // only network dashboard views are relevant 238 if ( !$this->isOnNetworkDashboard()) {246 if ( ! $this->isOnNetworkDashboard()) { 239 247 return; 240 248 } … … 267 275 // register authentication 268 276 $this->dc()->getLoginService()->register(); 277 $this->dc()->getLoginService()->registerAuthenticationHooks(); 269 278 // register custom password validation 270 279 $this->dc()->getPasswordValidationService()->register(); … … 284 293 285 294 $this->dc()->getSsoService()->register(); 295 $this->dc()->getSsoService()->registerAuthenticationHooks(); 286 296 } 287 297 … … 390 400 $r = false; 391 401 392 $page = $_SERVER['PHP_SELF'];393 $required = "wp-login.php";402 $page = $_SERVER['PHP_SELF']; 403 $required = "wp-login.php"; 394 404 $isOnWpLogin = substr($page, -strlen($required)) == $required; 395 $isOnXmlRpc = strpos($page, 'xmlrpc.php') !== false;405 $isOnXmlRpc = strpos($page, 'xmlrpc.php') !== false; 396 406 397 407 if ($isOnWpLogin || $isOnXmlRpc) { … … 403 413 return $r; 404 414 } 415 416 /** 417 * Return true if current page is the test authentication page. 418 */ 419 public function isOnTestAuthenticationPage() 420 { 421 return isset($_GET['page']) && $_GET['page'] === 'next_ad_int_test_connection'; 422 } 405 423 } -
next-active-directory-integration/trunk/index.php
r1986677 r1996343 4 4 Plugin URI: https://www.active-directory-wp.com 5 5 Description: This is the successor of the Active Directory Integration plug-in which allows you to authenticate, authorize, create and update users through Active Directory. 6 Version: 2.1. 56 Version: 2.1.7 7 7 Author: NeosIT GmbH 8 8 Author URI: http://www.neos-it.de/ -
next-active-directory-integration/trunk/readme.txt
r1986677 r1996343 4 4 Requires at least: 4.0 5 5 Tested up to: 4.9.8 6 Stable tag: 2.1. 56 Stable tag: 2.1.7 7 7 License: GPLv3 8 8 … … 127 127 For detailed information you can visit the official [GitHub repository of Active Directory Integration 2](https://github.com/NeosIT/active-directory-integration2) 128 128 129 = 2.1.7 = 130 * FIXED: the hooks auth_before_create_or_update_user and auth_after_create_or_update_user were not registered so the SSO authentication always failed silently (ADI-668) 131 132 = 2.1.6 = 133 * FIXED: custom authentication filters were not registered properly (ADI-665) this will fix SSO related issues 134 * FIXED: test authentication will now properly check for authorization groups again 135 129 136 = 2.1.5 = 130 137 * FIXED: replaced all references to the deprecated each-function with foreach (ADI-628)
Note: See TracChangeset
for help on using the changeset viewer.