alecpl
2011-07-27 5ed119e5341a9c1225bbb40c6e3d6ea787ca17ed
- Don't use default source if source id is specified in get_address_source()


1 files modified
12 ■■■■■ changed files
program/include/rcmail.php 12 ●●●●● patch | view | raw | blame | history
program/include/rcmail.php
@@ -403,7 +403,8 @@
      if ($plugin['instance'] instanceof rcube_addressbook) {
        $contacts = $plugin['instance'];
      }
      else if ($abook_type == 'ldap') {
      else if (!$id) {
        if ($abook_type == 'ldap') {
        // Use the first writable LDAP address book.
        foreach ($ldap_config as $id => $prop) {
          if (!$writeable || $prop['writable']) {
@@ -416,6 +417,15 @@
        $contacts = new rcube_contacts($this->db, $this->user->ID);
      }
    }
    }
    if (!$contacts) {
      raise_error(array(
        'code' => 600, 'type' => 'php',
        'file' => __FILE__, 'line' => __LINE__,
        'message' => "Addressbook source ($id) not found!"),
        true, true);
    }
    // add to the 'books' array for shutdown function
    if (!isset($this->address_books[$id]))