alecpl
2011-06-16 cc90ed1f84174a89039feb6906775778e0c4eb18
program/include/rcube_ldap.php
@@ -296,6 +296,7 @@
    *
    * @param string Bind DN
    * @param string Bind password
     *
    * @return boolean True on success, False on error
    */
    private function _bind($dn, $pass)
@@ -338,10 +339,20 @@
    /**
     * 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)
    {
@@ -352,8 +363,7 @@
    /**
    * 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)
    {
@@ -364,7 +374,7 @@
    /**
    * Save a search string for future listings
    *
    * @param string Filter string
     * @param string $filter Filter string
    */
    function set_search_set($filter)
    {
@@ -399,6 +409,7 @@
    *
    * @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)
@@ -585,6 +596,7 @@
    *
    * @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)
@@ -624,6 +636,7 @@
     * 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)
@@ -643,6 +656,7 @@
    * 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)
@@ -702,6 +716,7 @@
    *
    * @param mixed Record identifier
    * @param array Hash array with save data
     *
    * @return boolean True on success, False on error
    */
    function update($id, $save_cols)
@@ -713,6 +728,7 @@
        $newdata = array();
        $replacedata = array();
        $deletedata = array();
        foreach ($this->fieldmap as $col => $fld) {
            $val = $save_cols[$col];
            if ($fld) {
@@ -819,6 +835,7 @@
    * Mark one or more contact records as deleted
    *
    * @param array  Record identifiers
     *
    * @return boolean True on success, False on error
    */
    function delete($ids)
@@ -857,8 +874,6 @@
    /**
    * Execute the LDAP search based on the stored credentials
    *
    * @access private
    */
    private function _exec_search($count = false)
    {
@@ -917,7 +932,7 @@
    /**
    * @access private
     * Converts LDAP entry into an array
    */
    private function _ldap2result($rec)
    {
@@ -947,7 +962,7 @@
    /**
    * @access private
     * Return real field name (from fields map)
    */
    private function _map_field($field)
    {
@@ -956,9 +971,9 @@
    /**
    * @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(
@@ -973,7 +988,7 @@
    /**
    * @access private
     * Prints debug info to the log
    */
    private function _debug($str)
    {
@@ -983,9 +998,14 @@
    /**
    * @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))