Howto use a drupal user base for Weave sync server

zaterdag, 30 januari 2010, 19:22

With 2 desktops, 2 laptops, an EEE and a phone it was always hard to keep my bookmarks, browser history and username/passwords in sync. Not anymore! Weave is an add-on for Firefox that keeps al your Firefox data in sync in a central database. And yes, it works great! Just install the add-on on every FF you have. You can use the central Mozilla database for syncing. It is safe to use; your data is stored encrypted with a key that only you know.

But then still.. wouldn’t it be nice to have it stored on your own servers. Storing passwords (even when they are encrypted) on a remote, not controlled-by-me host is not my first choice. Those guys @ mozilla understood that, and also released the sync server as open source. So you can have everything under your own control.. nice!

I added a script that integrates a Drupal install with the Weave Sync server. We use a Drupal install for our Intranet; every one who works for us has a Drupal account. I wanted to avoid a new user base for Weave, to simplify maintenance and reduce questions from users. Luckily the Weave Sync server is very modular en overall very well done!

Source code is found here: drupal.php

Here is how i did it:
Install the weave sync server (note there are different servers (full, registration, sync). In this case you just need the sync server, accounts can be created and updated in your drupal install)
I followed these instructions:
https://wiki.mozilla.org/Labs/Weave/Sync/1.0/Setup

After successful installation of the sync server, you need to add your drupal user base
1. edit this line in your {hostname}_constants.php
if (!defined('WEAVE_AUTH_ENGINE')) { define('WEAVE_AUTH_ENGINE', 'drupal'); }

2. Add and edit these lines in your {hostname}_constants.php
the mysql user has to have read access to your users table in the drupal install
if (WEAVE_AUTH_ENGINE == 'drupal')
{
#host, db name, username, password and prefix for the drupal auth store
if (!defined('WEAVE_DRUPAL_MYSQL_AUTH_HOST')) { define('WEAVE_DRUPAL_MYSQL_AUTH_HOST', 'localhost'); }
if (!defined('WEAVE_DRUPAL_MYSQL_AUTH_DB')) { define('WEAVE_DRUPAL_MYSQL_AUTH_DB', 'drupal'); }
if (!defined('WEAVE_DRUPAL_MYSQL_AUTH_USER')) { define('WEAVE_DRUPAL_MYSQL_AUTH_USER', 'drupal'); }
if (!defined('WEAVE_DRUPAL_MYSQL_AUTH_PASS')) { define('WEAVE_DRUPAL_MYSQL_AUTH_PASS', 'drupal'); }
if (!defined('WEAVE_DRUPAL_MYSQL_AUTH_PREFIX')) { define('WEAVE_DRUPAL_MYSQL_AUTH_PREFIX', ''); }
}

3. save the drupal.php file in the folder 1.0/weave_user

Now install the firefox add-on and start syncing with your drupal login/pass combo

bookmark, share, socialize
  • LinkedIn
  • Digg
  • Hyves
  • Slashdot
  • Sphinn
  • Netvibes
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogosphere News
  • eKudos
  • Live
  • NuJIJ
  • StumbleUpon
  • Technorati
  • Fleck
  • PDF
  • Print
  • email

Geef een reactie