Changeset 5c9d1ff in github


Ignore:
Timestamp:
Aug 16, 2011 9:41:52 AM (21 months ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
5c2ac5f
Parents:
fe0cb65
Message:
  • Add option to hide selected LDAP addressbook on the list
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    rfe0cb65 r5c9d1ff  
    22=========================== 
    33 
     4- Add option to hide selected LDAP addressbook on the list 
    45- Add client-side checking of uploaded files size 
    56- Add newlines between organization, department, jobtitle (#1488028) 
  • config/main.inc.php.dist

    rfcc7f86 r5c9d1ff  
    514514  // SASL authentication method (for proxy auth), e.g. DIGEST-MD5 
    515515  'auth_method'    => '', 
     516  // Indicates if the addressbook shall be displayed on the list. 
     517  // With this option enabled you can still search/view contacts. 
     518  'hidden'        => false, 
    516519  // Indicates if we can write to the LDAP directory or not. 
    517520  // If writable is true then these fields need to be populated: 
  • program/include/rcmail.php

    r782d859 r5c9d1ff  
    440440   * 
    441441   * @param boolean True if the address book needs to be writeable 
     442   * 
    442443   * @return array  Address books array 
    443444   */ 
     
    454455        $this->address_books['0'] = new rcube_contacts($this->db, $this->user->ID); 
    455456      $list['0'] = array( 
    456         'id' => '0', 
    457         'name' => rcube_label('personaladrbook'), 
    458         'groups' => $this->address_books['0']->groups, 
     457        'id'       => '0', 
     458        'name'     => rcube_label('personaladrbook'), 
     459        'groups'   => $this->address_books['0']->groups, 
    459460        'readonly' => $this->address_books['0']->readonly, 
    460461        'autocomplete' => in_array('sql', $autocomplete) 
     
    466467      foreach ($ldap_config as $id => $prop) 
    467468        $list[$id] = array( 
    468           'id' => $id, 
    469           'name' => $prop['name'], 
    470           'groups' => is_array($prop['groups']), 
     469          'id'       => $id, 
     470          'name'     => $prop['name'], 
     471          'groups'   => is_array($prop['groups']), 
    471472          'readonly' => !$prop['writable'], 
    472           'autocomplete' => in_array('sql', $autocomplete) 
     473          'hidden'   => $prop['hidden'], 
     474          'autocomplete' => in_array($id, $autocomplete) 
    473475        ); 
    474476    } 
  • program/steps/addressbook/func.inc

    r57ce504 r5c9d1ff  
    6969        $source = $js_list[key($js_list)]['id']; 
    7070 
    71     // count writeable sources 
     71    // count all/writeable sources 
    7272    $writeable = 0; 
    73     foreach ($js_list as $s) { 
     73    $count = 0; 
     74    foreach ($js_list as $sid => $s) { 
     75        $count++; 
    7476        if (!$s['readonly']) { 
    7577            $writeable++; 
     78        } 
     79        // unset hidden sources 
     80        if ($s['hidden']) { 
     81            unset($js_list[$sid]); 
    7682        } 
    7783    } 
     
    8389 
    8490    $OUTPUT->set_pagetitle(rcube_label('addressbook')); 
    85     $_SESSION['addressbooks_count'] = count($js_list); 
     91    $_SESSION['addressbooks_count'] = $count; 
    8692    $_SESSION['addressbooks_count_writeable'] = $writeable; 
    87      
     93 
    8894    if (!strlen($source)) 
    8995      $source = strval(key($js_list)); 
Note: See TracChangeset for help on using the changeset viewer.