Hi,

Normal statusnet sites have a sort of adhoc user base whereas a site
that uses the ldap plugin (with 'authoritative'=>true and
'autoregistration'=>true) already has a defined user base. This setup
probably corresponds to a company or an institution installation
(which is my case). In this scenario it's likely that the jabber
server also uses ldap to validate users.

The ldap plugin can take the user's email attribute from the ldap
server and set it in the database plus email_confirmed=true;
Our users will use statusnet primarily via xmpp, so we'd like to
automate the jabber account too.

We know the users' jabber accounts.
ejabberd.cfg
{auth_method, ldap}.
{ldap_base, "ou=people,dc=example,dc=com"}.
{ldap_uids, [{"uid", "%u"}]}.

'uid' is also used by the ldap plugin

config.php
addPlugin('ldapAuthentication', array(
    'attributes'=>array(
        'username'=>'uid',
        'nickname'=>'uid',
....

So we can set them in the statusnet databse.

plugins/LdapAuthentication/LdapAuthenticationPlugin.php
function autoRegister($username)
{
...
            if (common_config('xmpp', 'server')){
                $jabber_server = common_config('xmpp', 'server');
                $jabber_id=$username.'@'.$jabber_server;
                $registration_data['jabber']=$jabber_id;
            }
...

classes/User.php
static function register($fields) {
...
        if(isset($jabber) && $jabber) {
            $user->jabber = $jabber;
        }
...

It's rudimentary and I'm not sure if it would be practical to build
something like this into the default instalation, but you get the
picture.

Thanks,
Chris.
_______________________________________________
StatusNet-dev mailing list
StatusNet-dev@lists.status.net
http://lists.status.net/mailman/listinfo/statusnet-dev

Reply via email to