Changeset 665236
- Timestamp:
- 02/08/2013 03:00:08 PM (13 years ago)
- Location:
- active-directory-integration/trunk
- Files:
-
- 3 edited
-
ad-integration.php (modified) (10 diffs)
-
admin.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
active-directory-integration/trunk/ad-integration.php
r622590 r665236 196 196 // Update password on every successfull login 197 197 protected $_auto_update_password = false; 198 199 // Enable lost password recovery 200 protected $_enable_lost_password_recovery = false; 198 201 199 202 … … 266 269 // Security 267 270 array('name' => 'AD_Integration_fallback_to_local_password', 'type' => 'bool'), 271 array('name' => 'AD_Integration_enable_lost_password_recovery', 'type' => 'bool'), 268 272 array('name' => 'AD_Integration_max_login_attempts', 'type' => 'int'), 269 273 array('name' => 'AD_Integration_block_time', 'type' => 'int'), … … 338 342 add_filter('authenticate', array(&$this, 'authenticate'), 10, 3); 339 343 340 add_action('lost_password', array(&$this, 'disable_function')); 344 if (!$this->_enable_lost_password_recovery) { 345 add_action('lost_password', array(&$this, 'disable_function')); 346 } 341 347 add_action('retrieve_password', array(&$this, 'disable_function')); 342 348 add_action('password_reset', array(&$this, 'disable_function')); … … 468 474 add_site_option('AD_Integration_disable_users', false); 469 475 add_site_option('AD_Integration_fallback_to_local_password', false); 476 add_site_option('AD_Integration_enable_lost_password_recovery', false); 470 477 471 478 add_site_option('AD_Integration_syncback', false); … … 512 519 add_option('AD_Integration_auto_update_password', false); 513 520 521 514 522 add_option('AD_Integration_max_login_attempts', '3'); 515 523 add_option('AD_Integration_block_time', '30'); … … 519 527 add_option('AD_Integration_disable_users', false); 520 528 add_option('AD_Integration_fallback_to_local_password', false); 529 add_option('AD_Integration_enable_lost_password_recovery', false); 530 521 531 522 532 add_option('AD_Integration_syncback', false); … … 569 579 // Security 570 580 register_setting('ADI-security-settings', 'AD_Integration_fallback_to_local_password', array(&$this, 'sanitize_bool')); 581 register_setting('ADI-security-settings', 'AD_Integration_enable_lost_password_recovery', array(&$this, 'sanitize_bool')); 571 582 register_setting('ADI-security-settings', 'AD_Integration_max_login_attempts', array(&$this, 'sanitize_max_login_attempts')); 572 583 register_setting('ADI-security-settings', 'AD_Integration_block_time', array(&$this, 'sanitize_block_time')); … … 1860 1871 $this->_role_equivalent_groups = get_site_option('AD_Integration_role_equivalent_groups'); 1861 1872 1862 // Security ( 6)1873 // Security (7) 1863 1874 $this->_fallback_to_local_password = get_site_option('AD_Integration_fallback_to_local_password'); 1875 $this->_enable_lost_password_recovery = (bool)get_site_option('AD_Integration_enable_lost_password_recovery'); 1864 1876 $this->_max_login_attempts = (int)get_site_option('AD_Integration_max_login_attempts'); 1865 1877 $this->_block_time = (int)get_site_option('AD_Integration_block_time'); … … 1919 1931 // Security (6) 1920 1932 $this->_fallback_to_local_password = get_option('AD_Integration_fallback_to_local_password'); 1933 $this->_enable_lost_password_recovery = (bool)get_option('AD_Integration_enable_lost_password_recovery'); 1921 1934 $this->_max_login_attempts = (int)get_option('AD_Integration_max_login_attempts'); 1922 1935 $this->_block_time = (int)get_option('AD_Integration_block_time'); … … 2296 2309 if ( !empty( $arrPost['AD_Integration_enable_password_change'] ) ) 2297 2310 update_site_option('AD_Integration_enable_password_change', $arrPost['AD_Integration_enable_password_change']); 2311 2312 if ( !empty( $arrPost['AD_Integration_enable_lost_password_recovery'] ) ) 2313 update_site_option('AD_Integration_enable_lost_password_recovery', $arrPost['AD_Integration_enable_lost_password_recovery']); 2298 2314 2299 2315 if ( !empty( $arrPost['AD_Integration_show_attributes'] ) ) -
active-directory-integration/trunk/admin.php
r622590 r665236 53 53 }); 54 54 55 56 function submitTestForm() { 57 openTestWindow(); 58 return false; // so the form is not submitted 59 } 60 61 function openTestWindow() { 62 63 var user = encodeURIComponent(document.getElementById('AD_Integration_test_user').value); 64 var password = encodeURIComponent(document.getElementById('AD_Integration_test_password').value); 65 66 TestWindow = window.open("<?php echo ( (IS_WPMU) ? WPMU_PLUGIN_URL : WP_PLUGIN_URL ).'/'.ADINTEGRATION_FOLDER;?>/test.php?user=" + user + "&password=" + password, "Test", "width=450,height=500,left=100,top=200"); 67 TestWindow.focus(); 68 } 55 69 </script> 56 70 … … 389 403 <input type="checkbox" name="AD_Integration_fallback_to_local_password" id="AD_Integration_fallback_to_local_password"<?php if ($this->_fallback_to_local_password) echo ' checked="checked"' ?> value="1" /> 390 404 <?php _e('Fallback to local (WordPress) password check if authentication against AD fails.</br>If turned on users can logon even if Active Directory server is unreachable. But this might be a security risk (for example, if the local password is outdated). <b>It\'s recommended to turn this off.</b>', 'ad-integration'); ?> 405 </td> 406 </tr> 407 408 <tr valign="top"> 409 <th scope="row"><label for="AD_Integration_enable_lost_password_recovery"><?php _e('Enable lost password revcovery', 'ad-integration'); ?></label></th> 410 <td> 411 <input type="checkbox" name="AD_Integration_enable_lost_password_recovery" id="AD_Integration_enable_lost_password_recovery"<?php if ($this->_enable_lost_password_recovery) echo ' checked="checked"' ?> value="1" /> 391 412 </td> 392 413 </tr> … … 693 714 <!-- TAB: Test --> 694 715 <div id="test"> 716 <!-- <form onsubmit="return submitTestForm();"> --> 695 717 <form onsubmit="window.open('','Test','width=450,height=500,left=100,top=200')" action="<?php echo ( (IS_WPMU) ? WPMU_PLUGIN_URL : WP_PLUGIN_URL ).'/'.ADINTEGRATION_FOLDER;?>/test.php" method="post" target="Test"> 696 718 <table class="form-table"> -
active-directory-integration/trunk/readme.txt
r622590 r665236 129 129 130 130 = 1.1.4 = 131 * ADD: Option to (re-)enable lost password recovery. (Issue #????) 131 132 * CHANGE: Only set role of user if the role already exists in WordPress. (Issue #0051) 132 133 * 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.)
Note: See TracChangeset
for help on using the changeset viewer.