summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-22 19:25:00 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-22 19:25:00 +0000
commitc35b15f606ac7303552848cbaaa8e8c82501e395 (patch)
treee75d4579854e3f8666f18268405e447f74737872 /roundcubemail/program/include
parent947ec4661f32577c30d28879b965eef85e4aee03 (diff)
- Add support for IMAP proxy authentication (#1486690)
git-svn-id: https://svn.roundcube.net/trunk@4124 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcmail.php2
-rw-r--r--roundcubemail/program/include/rcube_imap_generic.php11
2 files changed, 12 insertions, 1 deletions
diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php
index a26ad809c..c7ba41935 100644
--- a/roundcubemail/program/include/rcmail.php
+++ b/roundcubemail/program/include/rcmail.php
@@ -501,6 +501,8 @@ class rcmail
// can save time detecting them using NAMESPACE and LIST
$options = array(
'auth_method' => $this->config->get('imap_auth_type', 'check'),
+ 'auth_cid' => $this->config->get('imap_auth_cid'),
+ 'auth_pw' => $this->config->get('imap_auth_pw'),
'delimiter' => isset($_SESSION['imap_delimiter']) ? $_SESSION['imap_delimiter'] : $this->config->get('imap_delimiter'),
'rootdir' => isset($_SESSION['imap_root']) ? $_SESSION['imap_root'] : $this->config->get('imap_root'),
'debug_mode' => (bool) $this->config->get('imap_debug', 0),
diff --git a/roundcubemail/program/include/rcube_imap_generic.php b/roundcubemail/program/include/rcube_imap_generic.php
index 67d71f619..4211cca44 100644
--- a/roundcubemail/program/include/rcube_imap_generic.php
+++ b/roundcubemail/program/include/rcube_imap_generic.php
@@ -420,7 +420,16 @@ class rcube_imap_generic
}
}
else { // PLAIN
- $reply = base64_encode($user . chr(0) . $user . chr(0) . $pass);
+ // proxy authentication
+ if (!empty($this->prefs['auth_cid'])) {
+ $authc = $this->prefs['auth_cid'];
+ $pass = $this->prefs['auth_pw'];
+ }
+ else {
+ $authc = $user;
+ }
+
+ $reply = base64_encode($user . chr(0) . $authc . chr(0) . $pass);
// RFC 4959 (SASL-IR): save one round trip
if ($this->getCapability('SASL-IR')) {