| 
 | 
 | 
 <?php
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 /**
 | 
| 
 | 
 | 
  +-----------------------------------------------------------------------+
 | 
| 
 | 
 | 
  | This file is part of the Roundcube Webmail client                     |
 | 
| 
 | 
 | 
  |                                                                       |
 | 
| 
 | 
 | 
  | Copyright (C) The Roundcube Dev Team                                  |
 | 
| 
 | 
 | 
  | Copyright (C) Kolab Systems AG                                        |
 | 
| 
 | 
 | 
  |                                                                       |
 | 
| 
 | 
 | 
  | Licensed under the GNU General Public License version 3 or            |
 | 
| 
 | 
 | 
  | any later version with exceptions for skins & plugins.                |
 | 
| 
 | 
 | 
  | See the README file for a full license statement.                     |
 | 
| 
 | 
 | 
  |                                                                       |
 | 
| 
 | 
 | 
  | PURPOSE:                                                              |
 | 
| 
 | 
 | 
  |   Application class providing core functions and holding              |
 | 
| 
 | 
 | 
  |   instances of all 'global' objects like db- and imap-connections     |
 | 
| 
 | 
 | 
  +-----------------------------------------------------------------------+
 | 
| 
 | 
 | 
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
 | 
| 
 | 
 | 
  | Author: Aleksander Machniak <alec@alec.pl>                            |
 | 
| 
 | 
 | 
  +-----------------------------------------------------------------------+
 | 
| 
 | 
 | 
 */
 | 
| 
 | 
 | 
 +-----------------------------------------------------------------------+
 | 
| 
 | 
 | 
 | This file is part of the Roundcube Webmail client                     |
 | 
| 
 | 
 | 
 |                                                                       |
 | 
| 
 | 
 | 
 | Copyright (C) The Roundcube Dev Team                                  |
 | 
| 
 | 
 | 
 | Copyright (C) Kolab Systems AG                                        |
 | 
| 
 | 
 | 
 |                                                                       |
 | 
| 
 | 
 | 
 | Licensed under the GNU General Public License version 3 or            |
 | 
| 
 | 
 | 
 | any later version with exceptions for skins & plugins.                |
 | 
| 
 | 
 | 
 | See the README file for a full license statement.                     |
 | 
| 
 | 
 | 
 |                                                                       |
 | 
| 
 | 
 | 
 | PURPOSE:                                                              |
 | 
| 
 | 
 | 
 |   Application class providing core functions and holding              |
 | 
| 
 | 
 | 
 |   instances of all 'global' objects like db- and imap-connections     |
 | 
| 
 | 
 | 
 +-----------------------------------------------------------------------+
 | 
| 
 | 
 | 
 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
 | 
| 
 | 
 | 
 | Author: Aleksander Machniak <alec@alec.pl>                            |
 | 
| 
 | 
 | 
 +-----------------------------------------------------------------------+
 | 
| 
 | 
 | 
  */
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
 /**
 | 
| 
 | 
 | 
  * Application class of Roundcube Webmail
 | 
| 
...
 | 
...
 | 
@@ -384,11 +384,11 @@ class rcmail extends rcube | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             self::raise_error([
 | 
| 
 | 
 | 
                     'code'    => 700,
 | 
| 
 | 
 | 
                     'file'    => __FILE__,
 | 
| 
 | 
 | 
                     'line'    => __LINE__,
 | 
| 
 | 
 | 
                     'message' => "Addressbook source ($id) not found!"
 | 
| 
 | 
 | 
                 ],
 | 
| 
 | 
 | 
                 'code'    => 700,
 | 
| 
 | 
 | 
                 'file'    => __FILE__,
 | 
| 
 | 
 | 
                 'line'    => __LINE__,
 | 
| 
 | 
 | 
                 'message' => "Addressbook source ($id) not found!"
 | 
| 
 | 
 | 
             ],
 | 
| 
 | 
 | 
                 true, true);
 | 
| 
 | 
 | 
         }
 | 
| 
 | 
 | 
 
 | 
| 
...
 | 
...
 | 
@@ -553,9 +553,9 @@ class rcmail extends rcube | 
| 
 | 
 | 
         $responses = array_values($responses);
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         $hook = $this->plugins->exec_hook('get_compose_responses', [
 | 
| 
 | 
 | 
                 'list'      => $responses,
 | 
| 
 | 
 | 
                 'sorted'    => $sorted,
 | 
| 
 | 
 | 
                 'user_only' => $user_only,
 | 
| 
 | 
 | 
             'list'      => $responses,
 | 
| 
 | 
 | 
             'sorted'    => $sorted,
 | 
| 
 | 
 | 
             'user_only' => $user_only,
 | 
| 
 | 
 | 
         ]);
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         return $hook['list'];
 | 
| 
...
 | 
...
 | 
@@ -807,22 +807,22 @@ class rcmail extends rcube | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             if (!$user) {
 | 
| 
 | 
 | 
                 self::raise_error([
 | 
| 
 | 
 | 
                         'code'    => 620,
 | 
| 
 | 
 | 
                         'file'    => __FILE__,
 | 
| 
 | 
 | 
                         'line'    => __LINE__,
 | 
| 
 | 
 | 
                         'message' => "Failed to create a user record. Maybe aborted by a plugin?"
 | 
| 
 | 
 | 
                     ],
 | 
| 
 | 
 | 
                     'code'    => 620,
 | 
| 
 | 
 | 
                     'file'    => __FILE__,
 | 
| 
 | 
 | 
                     'line'    => __LINE__,
 | 
| 
 | 
 | 
                     'message' => "Failed to create a user record. Maybe aborted by a plugin?"
 | 
| 
 | 
 | 
                 ],
 | 
| 
 | 
 | 
                     true, false
 | 
| 
 | 
 | 
                 );
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
         }
 | 
| 
 | 
 | 
         else {
 | 
| 
 | 
 | 
             self::raise_error([
 | 
| 
 | 
 | 
                     'code'    => 621,
 | 
| 
 | 
 | 
                     'file'    => __FILE__,
 | 
| 
 | 
 | 
                     'line'    => __LINE__,
 | 
| 
 | 
 | 
                     'message' => "Access denied for new user $username. 'auto_create_user' is disabled"
 | 
| 
 | 
 | 
                 ],
 | 
| 
 | 
 | 
                 'code'    => 621,
 | 
| 
 | 
 | 
                 'file'    => __FILE__,
 | 
| 
 | 
 | 
                 'line'    => __LINE__,
 | 
| 
 | 
 | 
                 'message' => "Access denied for new user $username. 'auto_create_user' is disabled"
 | 
| 
 | 
 | 
             ],
 | 
| 
 | 
 | 
                 true, false
 | 
| 
 | 
 | 
             );
 | 
| 
 | 
 | 
         }
 | 
| 
...
 | 
...
 | 
@@ -989,6 +989,16 @@ class rcmail extends rcube | 
| 
 | 
 | 
                 $key  = key($default_host);
 | 
| 
 | 
 | 
                 $host = is_numeric($key) ? $default_host[$key] : $key;
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
             // host再次为空,说明数据库里面没有这个服务器信息
 | 
| 
 | 
 | 
             if(empty($host)){
 | 
| 
 | 
 | 
                 $post_host = parse_url($post_host);
 | 
| 
 | 
 | 
                 $host = 'ssl://'.($post_host['host']??$post_host['path']??'');
 | 
| 
 | 
 | 
                 // 手动填写的imap服务器
 | 
| 
 | 
 | 
                 $default_host[$host] = $host;
 | 
| 
 | 
 | 
                 $this->config->set('default_host',$default_host);
 | 
| 
 | 
 | 
             }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         }
 | 
| 
 | 
 | 
         else if (empty($default_host)) {
 | 
| 
 | 
 | 
             $host = rcube_utils::get_input_value('_host', rcube_utils::INPUT_POST);
 | 
| 
...
 | 
...
 | 
@@ -1340,8 +1350,8 @@ class rcmail extends rcube | 
| 
 | 
 | 
         }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         $plugin = $this->plugins->exec_hook('contact_create', [
 | 
| 
 | 
 | 
                 'record' => $contact,
 | 
| 
 | 
 | 
                 'source' => $this->get_address_book_id($source),
 | 
| 
 | 
 | 
             'record' => $contact,
 | 
| 
 | 
 | 
             'source' => $this->get_address_book_id($source),
 | 
| 
 | 
 | 
         ]);
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         $contact = $plugin['record'];
 | 
| 
...
 | 
...
 | 
@@ -1404,9 +1414,9 @@ class rcmail extends rcube | 
| 
 | 
 | 
         }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         $plugin = $this->plugins->exec_hook('contact_exists', [
 | 
| 
 | 
 | 
                 'email'   => $email,
 | 
| 
 | 
 | 
                 'type'    => $type,
 | 
| 
 | 
 | 
                 'sources' => $sources,
 | 
| 
 | 
 | 
             'email'   => $email,
 | 
| 
 | 
 | 
             'type'    => $type,
 | 
| 
 | 
 | 
             'sources' => $sources,
 | 
| 
 | 
 | 
         ]);
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
         if (!empty($plugin['abort'])) {
 | 
...
 | 
...
 | 
 |