| | |
| | | $auth_methods = $auth_caps; |
| | | } |
| | | // RFC 2595 (LOGINDISABLED) LOGIN disabled when connection is not secure |
| | | if (($key = array_search('LOGIN', $auth_methods)) !== false |
| | | && $this->getCapability('LOGINDISABLED') |
| | | ) { |
| | | $login_disabled = $this->getCapability('LOGINDISABLED'); |
| | | if (($key = array_search('LOGIN', $auth_methods)) !== false) { |
| | | if ($login_disabled) { |
| | | unset($auth_methods[$key]); |
| | | } |
| | | } |
| | | else if (!$login_disabled) { |
| | | $auth_methods[] = 'LOGIN'; |
| | | } |
| | | } |
| | | else { |
| | | // Prevent from sending credentials in plain text when connection is not secure |
| | | if ($auth_method == 'LOGIN' && $this->getCapability('LOGINDISABLED')) { |