Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global addressbook (per domain) #608

Closed
rcubetrac opened this Issue Mar 3, 2006 · 17 comments

Comments

Projects
None yet
1 participant
@rcubetrac
Copy link

rcubetrac commented Mar 3, 2006

Reported by nobody on 3 Mar 2006 21:30 UTC as Trac ticket #1442732

Although I have already hacked it into .1 beta...

One of the biggest reasons I was unhappy with
SquirrelMail was their lack of a globally available, on
a per domain basis level, address book.

I was easily able to integrate this into the beta
release of RoundCube and would hope to see it in the
future.

Great program thus far though.

Keywords: addressbook
Migrated-From: http://trac.roundcube.net/ticket/1442732

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Mar 12, 2006

Comment by smueller72 on 12 Mar 2006 18:49 UTC

Logged In: YES 
user_id=1158189

I am looking for this same type of functionality.  Care to
share your hack?  

Is this something that is planned to be included in an
upcoming release?  I would prefer to wait for the 'official'
release rather than hack.  
@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Mar 19, 2006

Comment by nobody on 19 Mar 2006 11:11 UTC

Logged In: NO 

Supply a patch for your hack?
@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Mar 27, 2006

Comment by nobody on 27 Mar 2006 15:35 UTC

Logged In: NO 

First off, added a column to the contacts table, user_domain
varchar(255).
Then, when someone logs in, I use pregs to strip off the
domain name from the email address and add that to a
$_SESSION[files I had to change were:
index.php
program/steps/addressbook/func.inc
program/steps/addressbook/list.inc
program/steps/addressbook/show.inc
program/steps/mail/compose.inc

***index.php around line 191:***
//see the else clause:
// log in to imap server
if (!empty($_SESSION['user_id']("user_domain"]
The)) && $_task=='mail')
  {
  $conn = $IMAP->connect($_SESSION[$_SESSION['imap_port
  if (!$conn)
    {
    show_message('imaperror', 'error');
    $_SESSION['user_id']('imap_host'],
$_SESSION['username'],
decrypt_passwd($_SESSION['password']),) = '';
    }
  else {
    //  20060303 PS - Get the user's domain they typed in. 
For use with address book functionality.
    $parts = explode("@", $_SESSION[   $_SESSION['user_domain']('username']);
) = $parts[   rcmail_set_imap_prop();
    }
  }

Then in the 3 address book folder's files I changed the
query that was called.  This query is called once or twice
in each of these 3 files.  My query is only slightly
different, it searches the user_domain col. I made in the
contacts table.
My query:
 $DB->query("SELECT * FROM ".get_table_name('contacts')."
              WHERE  contact_id=?
              AND    ( user_id=? OR
user_domain='{$_SESSION["user_domain"](1];
)}' )
              AND    del<>1",
              $cid,
              $_SESSION['user_id']);

The same query is made in the program/steps/mail/compose.inc
Basically whenever you see the userid=?, just add the OR
clause I put in there.  Pretty basic really.

Sorry I didnt post it sooner.
@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Mar 27, 2006

Comment by mrsticks1982 on 27 Mar 2006 15:46 UTC

Logged In: YES 
user_id=540609

OK, Ive logged in now.  I created this thread, and it's my
hack Ive posted.  

I neglected to go into a little more detail.

At the moment, since I havent started using roundcube
exclusively, I never actually coded the process whereby the
user's domain ACTUALLY gets inserted into the DB.  I just
logged in once, manually updated that user's DB entry to
include his domain in the user_domain col.

And at this point, the code of roundcube is written so that
you cant delete these domain global addresses.  This has to
do with the user_id being set to 0 in the contacts table and
the user_domain field filled in.

I think thats about it.

-peter
@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Jul 7, 2006

Comment by @thomascube on 7 Jul 2006 10:22 UTC

Later...

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Jul 7, 2006

Severity changed by @thomascube on 7 Jul 2006 10:22 UTC

critical => minor

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Jul 7, 2006

Milestone changed by @thomascube on 7 Jul 2006 10:22 UTC

0.1-beta2 => none

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Jul 7, 2006

Milestone changed by @thomascube on 7 Jul 2006 10:29 UTC

=> later

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Feb 16, 2008

Comment by seansan on 16 Feb 2008 21:14 UTC

Review as part of update to AB in Milestone: 0.2-beta

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Feb 16, 2008

Keywords changed by seansan on 16 Feb 2008 21:14 UTC

addressbook

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Feb 16, 2008

Milestone changed by seansan on 16 Feb 2008 21:14 UTC

later => 0.2-beta

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Feb 16, 2008

Summary changed by seansan on 16 Feb 2008 21:14 UTC

Per Domain Global Contacts/Address Book

Global addressbook (per domain)

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Sep 5, 2008

Milestone changed by @thomascube on 5 Sep 2008 06:57 UTC

0.2-beta => 0.5-beta

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Oct 17, 2008

Comment by mdasberg on 17 Oct 2008 11:08 UTC

Fixed it for version 0.2-beta.

First off, added a column to the contacts table, user_domain varchar(255).

next we need to change some things.

Open program/include/rcube_contacts.php:

  • find the following:
    function list_records($cols=null, $subset=0)
    {
  • add:
    global $RCMAIL;
    $domain = $RCMAIL->user->get_user_domain();
  • find the following:
    AND (user_id=? OR global_contact = 1)".
  • replace with:
    AND (user_id=? OR (global_contact = 1 AND user_domain = '$domain'))".

Open program/include/rcube_user.php:

  • add:
    /**
    • Extracts the domain name from the user login.
      *
    • @return string Domain
      */
      function get_user_domain()
      {
      return substr($this->data[strpos($this->data'username', '@') + 1);
      }

thats about it.

Kind regards,

Mischa

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Oct 9, 2009

Comment by @alecpl on 9 Oct 2009 10:04 UTC

Plugin exists http://www.tehinterweb.co.uk/roundcube/#piglobaladdressbook

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Oct 9, 2009

Status changed by @alecpl on 9 Oct 2009 10:04 UTC

assigned => closed

@rcubetrac

This comment has been minimized.

Copy link
Author

rcubetrac commented Oct 9, 2009

Milestone changed by @alecpl on 9 Oct 2009 10:04 UTC

0.5-beta => later

@rcubetrac rcubetrac closed this Oct 9, 2009

@rcubetrac rcubetrac added this to the later milestone Mar 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.