| | |
| | | */ |
| | | |
| | | // instantiate a contacts object according to the given source |
| | | if (($source = get_input_value('_source', RCUBE_INPUT_GPC)) && isset($CONFIG['ldap_public'][$source])) |
| | | $CONTACTS = new rcube_ldap($CONFIG['ldap_public'][$source]); |
| | | else if (strtolower($CONFIG['address_book_type']) == 'ldap') { |
| | | // Get the first LDAP address book. |
| | | $source = key((array)$CONFIG['ldap_public']); |
| | | $prop = current((array)$CONFIG['ldap_public']); |
| | | $CONTACTS = new rcube_ldap($prop); |
| | | } else { |
| | | $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']); |
| | | } // end else |
| | | $CONTACTS = $RCMAIL->get_address_book(($source = get_input_value('_source', RCUBE_INPUT_GPC))); |
| | | |
| | | $CONTACTS->set_pagesize($CONFIG['pagesize']); |
| | | |
| | |
| | | // We are using the DB address book, add it. |
| | | $js_list = array("0" => array('id' => 0, 'readonly' => false)); |
| | | } // end if |
| | | foreach ((array)$CONFIG['ldap_public'] as $id => $prop) |
| | | $js_list[$id] = array('id' => $id, 'readonly' => !$prop['writable']); |
| | | else if (!empty($CONFIG['ldap_public'])) { |
| | | foreach ($CONFIG['ldap_public'] as $id => $prop) |
| | | $js_list[$id] = array('id' => $id, 'readonly' => !$prop['writable']); |
| | | } |
| | | $OUTPUT->set_env('address_sources', $js_list); |
| | | |
| | | |
| | |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | |
| | | $OUTPUT->set_pagetitle(rcube_label('addressbook')); |
| | | |
| | | // register UI objects |
| | | $OUTPUT->add_handlers(array( |