From ab0b51a1fef87bcc643c3aaf2e635c811b28ccd8 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Tue, 15 Feb 2011 06:10:59 -0500
Subject: [PATCH] - Use only one from IMAP authentication methods to prevent login delays (1487784)

---
 program/steps/settings/func.inc |   63 ++++++++++++++++++++++++++-----
 1 files changed, 53 insertions(+), 10 deletions(-)

diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index b039478..271ee40 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -5,7 +5,7 @@
  | program/steps/settings/func.inc                                       |
  |                                                                       |
  | This file is part of the Roundcube Webmail client                     |
- | Copyright (C) 2005-2007, Roundcube Dev. - Switzerland                 |
+ | Copyright (C) 2005-2007, The Roundcube Dev Team                       |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -72,7 +72,7 @@
   // get identities list and define 'mail' column
   $list = $USER->list_identities();
   foreach ($list as $idx => $row)
-    $list[$idx]['mail'] = trim($row['name'] . ' <' . idn_to_utf8($row['email']) .'>');
+    $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_idn_to_utf8($row['email']) .'>');
 
   // get all identites from DB and define list of cols to be displayed
   $plugin = $RCMAIL->plugins->exec_hook('identities_list', array(
@@ -323,6 +323,8 @@
       $select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id));
       $select_mdn_requests->add(rcube_label('askuser'), 0);
       $select_mdn_requests->add(rcube_label('autosend'), 1);
+      $select_mdn_requests->add(rcube_label('autosendknown'), 3);
+      $select_mdn_requests->add(rcube_label('autosendknownignore'), 4);
       $select_mdn_requests->add(rcube_label('ignore'), 2);
 
       $blocks['main']['options']['mdn_requests'] = array(
@@ -332,9 +334,7 @@
     }
 
     $RCMAIL->imap_connect();
-    $threading_supported = $RCMAIL->imap->get_capability('thread=references')
-      || $RCMAIL->imap->get_capability('thread=orderedsubject')
-      || $RCMAIL->imap->get_capability('thread=refs');
+    $threading_supported = $RCMAIL->imap->get_capability('THREAD');
 
     if (!isset($no_override['autoexpand_threads']) && $threading_supported) {
       $field_id = 'rcmfd_autoexpand_threads';
@@ -344,8 +344,8 @@
       $select_autoexpand_threads->add(rcube_label('expand_only_unread'), 2);
 
       $blocks['main']['options']['autoexpand_threads'] = array(
-	'title' => html::label($field_id, Q(rcube_label('autoexpand_threads'))),
-	'content' => $select_autoexpand_threads->show($config['autoexpand_threads']),
+        'title' => html::label($field_id, Q(rcube_label('autoexpand_threads'))),
+        'content' => $select_autoexpand_threads->show($config['autoexpand_threads']),
       );
     }
 
@@ -464,11 +464,14 @@
     // Show checkbox for HTML Editor
     if (!isset($no_override['htmleditor'])) {
       $field_id = 'rcmfd_htmleditor';
-      $input_htmleditor = new html_checkbox(array('name' => '_htmleditor', 'id' => $field_id, 'value' => 1));
+      $select_htmleditor = new html_select(array('name' => '_htmleditor', 'id' => $field_id));
+      $select_htmleditor->add(rcube_label('never'), 0);
+      $select_htmleditor->add(rcube_label('always'), 1);
+      $select_htmleditor->add(rcube_label('htmlonreply'), 2);
 
       $blocks['main']['options']['htmleditor'] = array(
         'title' => html::label($field_id, Q(rcube_label('htmleditor'))),
-        'content' => $input_htmleditor->show($config['htmleditor']?1:0),
+        'content' => $select_htmleditor->show(intval($config['htmleditor'])),
       );
     }
 
@@ -506,6 +509,36 @@
       $blocks['main']['options']['force_7bit'] = array(
         'title' => html::label($field_id, Q(rcube_label('force7bit'))),
         'content' => $input_7bit->show($config['force_7bit']?1:0),
+      );
+    }
+
+    if (!isset($no_override['mdn_default'])) {
+      $field_id = 'rcmfd_mdn_default';
+      $input_mdn = new html_checkbox(array('name' => '_mdn_default', 'id' => $field_id, 'value' => 1));
+
+      $blocks['main']['options']['mdn_default'] = array(
+        'title' => html::label($field_id, Q(rcube_label('reqmdn'))),
+        'content' => $input_mdn->show($config['mdn_default']?1:0),
+      );
+    }
+
+    if (!isset($no_override['dsn_default'])) {
+      $field_id = 'rcmfd_dsn_default';
+      $input_dsn = new html_checkbox(array('name' => '_dsn_default', 'id' => $field_id, 'value' => 1));
+
+      $blocks['main']['options']['dsn_default'] = array(
+        'title' => html::label($field_id, Q(rcube_label('reqdsn'))),
+        'content' => $input_dsn->show($config['dsn_default']?1:0),
+      );
+    }
+
+    if (!isset($no_override['reply_same_folder'])) {
+      $field_id = 'rcmfd_reply_same_folder';
+      $input_reply_same_folder = new html_checkbox(array('name' => '_reply_same_folder', 'id' => $field_id, 'value' => 1));
+
+      $blocks['main']['options']['reply_same_folder'] = array(
+        'title' => html::label($field_id, Q(rcube_label('replysamefolder'))),
+        'content' => $input_reply_same_folder->show($config['reply_same_folder']?1:0),
       );
     }
 
@@ -723,7 +756,6 @@
   return $skins;
 }
 
-
 // register UI objects
 $OUTPUT->add_handlers(array(
   'prefsframe' => 'rcmail_preferences_frame',
@@ -731,3 +763,14 @@
   'identitieslist' => 'rcmail_identities_list',
 ));
 
+// register action aliases
+$RCMAIL->register_action_map(array(
+    'folders'       => 'folders.inc',
+    'rename-folder' => 'folders.inc',
+    'delete-folder' => 'folders.inc',
+    'subscribe'     => 'folders.inc',
+    'unsubscribe'   => 'folders.inc',
+    'purge'         => 'folders.inc',
+    'folder-size'   => 'folders.inc',
+    'add-identity'  => 'edit_identity.inc',
+));

--
Gitblit v1.9.1