Changeset 511077
- Timestamp:
- 02/27/2012 12:52:40 PM (14 years ago)
- Location:
- active-directory-integration/trunk
- Files:
-
- 2 edited
-
ad-integration.php (modified) (6 diffs)
-
readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
active-directory-integration/trunk/ad-integration.php
r489381 r511077 4 4 Plugin Name: Active Directory Integration 5 5 Version: 1.1.3 6 Plugin URI: http:// blog.ecw.de/wp-ad-integration6 Plugin URI: http://www.steindorff.de/wp-ad-integration 7 7 Description: Allows WordPress to authenticate, authorize, create and update users through Active Directory 8 Author: Christoph Steindorff , ECW GmbH9 Author URI: http:// blog.ecw.de/8 Author: Christoph Steindorff 9 Author URI: http://www.steindorff.de/ 10 10 11 11 The work is derived from version 1.0.5 of the plugin Active Directory Authentication: … … 228 228 protected $_prevent_email_change = false; 229 229 230 // protected $_ auto_login= false; // TODO: for auto login/SSO feature, has to be added to _load_options(), admin.php etc.230 // protected $_sso_enabled = false; // TODO: for auto login/SSO feature, has to be added to _load_options(), admin.php etc. 231 231 232 232 … … 565 565 register_setting('ADI-auth-settings', 'AD_Integration_authorize_by_group', array(&$this, 'sanitize_bool')); 566 566 register_setting('ADI-auth-settings', 'AD_Integration_authorization_group'); 567 register_setting('ADI-auth-settings', 'AD_Integration_role_equivalent_groups' );567 register_setting('ADI-auth-settings', 'AD_Integration_role_equivalent_groups', array(&$this, 'sanitize_role_equivalent_groups')); 568 568 569 569 // Security … … 1626 1626 1627 1627 /** 1628 * Strips out wrong entries from role_equivalent_groups and converts the WP role to lowercase. 1629 * 1630 * @param string $text 1631 * @return string 1632 */ 1633 public function sanitize_role_equivalent_groups($text) 1634 { 1635 $groups = explode(";", $text); 1636 $sanitized_groups = array(); 1637 foreach ($groups AS $group) { 1638 $group = trim($group); 1639 $pos = strpos($group, '='); 1640 if ($pos != 0) { // yes != 0, since int 0 is also unwanted 1641 $ad_group = substr($group,0,$pos); 1642 $role = strtolower(substr($group,$pos+1)); // roles are always lowercase 1643 if ($role != '') { 1644 $sanitized_groups[] = $ad_group . '=' . $role; 1645 } 1646 } 1647 } 1648 return implode(";", $sanitized_groups); 1649 } 1650 1651 /** 1628 1652 * Sanitize Additional User Attributes 1629 1653 * trim, delete empty line, all to lowercase. … … 2543 2567 if ( $role != '' ) 2544 2568 { 2545 $return = wp_update_user(array("ID" => $user_id, "role" => $role)); 2569 $roles = new WP_Roles(); 2570 if ($roles->is_role($role)) { // Updates role only if role exists 2571 wp_update_user(array('ID' => $user_id, 'role' => $role)); 2572 } else { 2573 $this->_log(ADI_LOG_WARN, 'Role "' . $role . '" currently does not exist in WordPress. Role of "' . $username . '" is not set.'); 2574 } 2546 2575 } 2547 2576 … … 2658 2687 if ( $role != '' ) 2659 2688 { 2660 wp_update_user(array('ID' => $user_id, 'role' => $role)); 2689 $roles = new WP_Roles(); 2690 if ($roles->is_role($role)) { // Updates role only if role exists 2691 wp_update_user(array('ID' => $user_id, 'role' => $role)); 2692 } else { 2693 $this->_log(ADI_LOG_WARN, 'Role "' . $role . '" currently does not exist in WordPress. Role of "' . $username . '" is not set.'); 2694 } 2661 2695 } 2662 2696 -
active-directory-integration/trunk/readme.txt
r501703 r511077 3 3 Tags: authentication, active directory, ldap, authorization, security, windows 4 4 Requires at least: 3.0 5 Tested up to: 3.3 5 Tested up to: 3.3.1 6 6 Stable tag: 1.1.3 7 7 … … 53 53 54 54 = Known Issues = 55 There are some issues with MultiSite. This is tracked [here](http://bt. ecw.de/view.php?id=4) and [here](http://bt.ecw.de/view.php?id=11).55 There are some issues with MultiSite. This is tracked [here](http://bt.steindorff.de/view.php?id=4) and [here](http://bt.steindorff.de/view.php?id=11). 56 56 57 57 … … 73 73 74 74 = Is there an official bug tracker for ADI? = 75 Yes. You'll find the bug tracker at http://bt. ecw.de/. You can report issues anonymously but it is recommended to create an account. This is also the right place for feature requests.75 Yes. You'll find the bug tracker at http://bt.steindorff.de/. You can report issues anonymously but it is recommended to create an account. This is also the right place for feature requests. 76 76 77 77 = I'm missing some functionality. Where can I submit a feature request? = 78 Use the [bug tracker](http://bt. ecw.de/) (see above) at http://bt.ecw.de/.78 Use the [bug tracker](http://bt.steindorff.de/) (see above) at http://bt.steindorff.de/. 79 79 80 80 = Authentication is successfull but the user is not authorized by group membership. What is wrong? = … … 102 102 * Follow the development on [Twitter](http://twitter.com/#!/adintegration). 103 103 * Go to http://blog.ecw.de 104 * See the bug tracker on http://bt. ecw.de104 * See the bug tracker on http://bt.steindorff.de 105 105 106 106 == Screenshots == … … 127 127 128 128 == Changelog == 129 130 = 1.1.4 = 131 * CHANGE: Only set role of user if the role already exists in WordPress. (Issue #0051) 132 * CHANGE: Now using POST instead of GET in Test Tool, so user and password are not shown in server log files (Change Request by Aren Cambre. Issue #0054.) 133 * CHANGE: The roles in Role Equivalent Groups are now always stored in lower case. (Issue #0055) 129 134 130 135 = 1.1.3 =
Note: See TracChangeset
for help on using the changeset viewer.