mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-02 19:39:26 +01:00
check if the selected Method (if one is selected by function parameter) of Authentication is valid (suppoted by the Server), if not try BestMethod supported by server
This commit is contained in:
parent
2188402b1c
commit
c7747b4d11
@ -721,6 +721,16 @@ class Net_IMAPProtocol {
|
||||
}
|
||||
$serverMethods=implode(',' ,$this->_serverAuthMethods);
|
||||
$myMethods=implode(',' ,$this->supportedAuthMethods);
|
||||
if (!empty($userMethod) && !in_array($userMethod,$this->_serverAuthMethods))
|
||||
{
|
||||
foreach ( $this->supportedAuthMethods as $method ) {
|
||||
if ( in_array( $method , $this->_serverAuthMethods ) ) {
|
||||
error_log(__METHOD__." UserMethod $userMethod not supported by server; trying best ServerMethod $method");
|
||||
return $method;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new PEAR_Error("$method NOT supported authentication method!. This IMAP server " .
|
||||
"supports these methods: $serverMethods, but I support $myMethods");
|
||||
}else{
|
||||
|
Loading…
Reference in New Issue
Block a user