#1701 File base Global address book doesn't work in 1.44RC1

closed-fixed
5
2005-02-03
2005-01-20
Anonymous
No

1.44RC1 Apache 2.050, PHP 4.34, Cyrus 2.28
Using a file based global address book in 1.44 RC1
results in "unable to initialize globall address book"
This happnes whether specifying the full path to global
address book or not on conf.php

I fixed it by adding an extra line just before the
add_backend for the global address book in addressbook.php:

$abook_global_filename = getHashedFile("global",
$data_dir, $abook_global_file);

This of course means that the global addressbook MUST
be in the data dir.

/* if (!
preg_match("/[\/\\\]/",$abook_global_file)) {
// no path chars
$abook_global_filename=$data_dir .
$abook_global_file;
} elseif
(preg_match("/^\/|\w:/",$abook_global_file)) {
// full path is set in options (starts with
slash or x:)
$abook_global_filename=$abook_global_file;
} else {
$abook_global_filename=SM_PATH .
$abook_global_file;
}
*/
$abook_global_filename =
getHashedFile("global", $data_dir, $abook_global_file);
$r =
$abook->add_backend('local_file',Array('filename'=>$abook_global_filename,

'name' => _("Global address book"),

'detect_writeable' => false,

'writeable'=> $abook_global_file_writeable));

Neil Price
nprice at gibb.co.za

Discussion

  • Tomas Kuliavas
    Tomas Kuliavas
    2005-01-21

    Logged In: YES
    user_id=225877

    You have disabled tests that make sure that address book is
    defined in three possible ways and forced storing it in some
    place which depends on $username. Why?

    Same message send in email.

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-01-21

    • assigned_to: nobody --> tokul
     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-02-03

    Logged In: YES
    user_id=225877

    Adding personal communications.
    -----------------
    >>> Can you explain what is not working? Can you provide
    >>> some hints to reproduce it.
    >>
    >> I can reproduce it at will with the unmodified standard
    >> code. Leave out any
    >> DSN's so Sql is not used. Specify a name for a filename in
    >> config.php
    >>
    >> $addr_book_global_file = 'global.abook'
    >> or
    >> $addr_book_global_file = '/var/lib/squirrelmail/global.abook'
    >>
    >> There are two problems here
    >> 1. regardless of which form you need, you get "unable to
    >> initialize global
    >> address book"
    >> 2. When using the first form, it fails to insert the last
    >> "/". ie you end
    > So you have two issues.
    > 1. short address book name does not work when data directory
    > does not have trailing slash. It is hard to reproduce in
    > recommended installation procedure, because by default
    > configuration script (conf.pl) adds trailing
    > slash automatically. Will fix it.

    Possibly that was caused by inheriting the config.php from
    an earlier version (1.42). However I had no problem with the
    personal address book, which uses the same $data_dir.

    > 2. some webserver limitations (apache chroot, php
    > open_basedir or safe_mode) or address book file permisions
    > don't allow using address book
    > stored in /var/lib/squirrelmail/global.abook. Can't fix it,
    > because limit is set in your server.

    That was just a typo, I had meant to write
    /var/lib/squirrelmail/prefs/global.abook. Adding the line with
    GetHashedFile() fixes the problem without moving or renaming
    the global.abook so permissions are not the issue.

     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-02-03

    • status: open --> closed
     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-02-03

    • status: closed --> closed-fixed
     
  • Tomas Kuliavas
    Tomas Kuliavas
    2005-02-03

    Logged In: YES
    user_id=225877

    Issue is fixed in 1.5.1cvs (functions/addressbook.php
    v.1.69) and 1.4.5cvs (functions/addressbook.php v.1.47.2.11)

     
  • Logged In: NO

    7@4uhelth.com