| | |
| | | * |
| | | * @param string Bind DN |
| | | * @param string Bind password |
| | | * |
| | | * @return boolean True on success, False on error |
| | | */ |
| | | private function _bind($dn, $pass) |
| | |
| | | |
| | | |
| | | /** |
| | | * Returns address book name |
| | | * |
| | | * @return string Address book name |
| | | */ |
| | | function get_name() |
| | | { |
| | | return $this->prop['name']; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Set internal list page |
| | | * |
| | | * @param number Page number to list |
| | | * @access public |
| | | * @param number $page Page number to list |
| | | */ |
| | | function set_page($page) |
| | | { |
| | |
| | | /** |
| | | * Set internal page size |
| | | * |
| | | * @param number Number of messages to display on one page |
| | | * @access public |
| | | * @param number $size Number of messages to display on one page |
| | | */ |
| | | function set_pagesize($size) |
| | | { |
| | |
| | | /** |
| | | * Save a search string for future listings |
| | | * |
| | | * @param string Filter string |
| | | * @param string $filter Filter string |
| | | */ |
| | | function set_search_set($filter) |
| | | { |
| | |
| | | * |
| | | * @param array List of cols to show |
| | | * @param int Only return this number of records |
| | | * |
| | | * @return array Indexed list of contact records, each a hash array |
| | | */ |
| | | function list_records($cols=null, $subset=0) |
| | |
| | | * |
| | | * @param mixed Record identifier |
| | | * @param boolean Return as associative array |
| | | * |
| | | * @return mixed Hash array or rcube_result_set with all record fields |
| | | */ |
| | | function get_record($dn, $assoc=false) |
| | |
| | | * If input not valid, the message to display can be fetched using get_error() |
| | | * |
| | | * @param array Assoziative array with data to save |
| | | * |
| | | * @return boolean True if input is valid, False if not. |
| | | */ |
| | | public function validate($save_data) |
| | |
| | | * Create a new contact record |
| | | * |
| | | * @param array Hash array with save data |
| | | * |
| | | * @return encoded record ID on success, False on error |
| | | */ |
| | | function insert($save_cols) |
| | |
| | | * |
| | | * @param mixed Record identifier |
| | | * @param array Hash array with save data |
| | | * |
| | | * @return boolean True on success, False on error |
| | | */ |
| | | function update($id, $save_cols) |
| | |
| | | $newdata = array(); |
| | | $replacedata = array(); |
| | | $deletedata = array(); |
| | | |
| | | foreach ($this->fieldmap as $col => $fld) { |
| | | $val = $save_cols[$col]; |
| | | if ($fld) { |
| | |
| | | * Mark one or more contact records as deleted |
| | | * |
| | | * @param array Record identifiers |
| | | * |
| | | * @return boolean True on success, False on error |
| | | */ |
| | | function delete($ids) |
| | |
| | | |
| | | /** |
| | | * Execute the LDAP search based on the stored credentials |
| | | * |
| | | * @access private |
| | | */ |
| | | private function _exec_search($count = false) |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * @access private |
| | | * Converts LDAP entry into an array |
| | | */ |
| | | private function _ldap2result($rec) |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * @access private |
| | | * Return real field name (from fields map) |
| | | */ |
| | | private function _map_field($field) |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * @access private |
| | | * Returns unified attribute name (resolving aliases) |
| | | */ |
| | | private function _attr_name($name) |
| | | private static function _attr_name($name) |
| | | { |
| | | // list of known attribute aliases |
| | | $aliases = array( |
| | |
| | | |
| | | |
| | | /** |
| | | * @access private |
| | | * Prints debug info to the log |
| | | */ |
| | | private function _debug($str) |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * @static |
| | | * Quotes attribute value string |
| | | * |
| | | * @param string $str Attribute value |
| | | * @param bool $dn True if the attribute is a DN |
| | | * |
| | | * @return string Quoted string |
| | | */ |
| | | private function _quote_string($str, $dn=false) |
| | | private static function _quote_string($str, $dn=false) |
| | | { |
| | | // take firt entry if array given |
| | | if (is_array($str)) |