Viewing 2 replies - 1 through 2 (of 2 total)
  • Replace the function user_profile_prevent_email_change($user) in
    plugins\active-directory-integration\ad-integration.php with;

    /**
    	 * Disable email field in user profile if needed (actions edit_user_profile and show_user_profile)
    	 * This is not safe and only for cosmetic reasons, but we also have the method prevent_email_change() (see below).
    	 *
    	 * @param object $user
    	 */
    	public function user_profile_prevent_email_change($user)
    	{
    		// disable email field if needed (dirty hack)
    		if ($this->_prevent_email_change && $this->_is_adi_user($user->ID) && (!current_user_can('level_10'))) {
    			?>
    			<script type="text/javascript">
    				var email = document.getElementById('email');
    				if (email) {
    					email.setAttribute('disabled','disabled');
    					email.name = 'email_disabled';
    					document.getElementById('your-profile').innerHTML = document.getElementById('your-profile').innerHTML + '<input type="hidden" name="email" value="' + email.value + '"/>';
    				}
    			</script>
    			<?php
    		}
    	}
    Thread Starter verdonv

    (@verdonv)

    Thank you. Seems to work!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Edit Profile Bug when Prevent Email Change enabled’ is closed to new replies.