> Login

Creating system users

With Group-Office it's possible to create system users automatically when you create a user. You can use this together with IMAP authentication or you might only want email accounts to be created automatically.

First set up IMAP authentication as described here if you need this:

http://docs.group-office.com/index.php?folder_id=51&file_id=174

When IMAP authentication works you can proceed to make Group-Office create system users for you. You must allow apache with sudo to execute the commands userdel, useradd and chpasswd.

Example entries in the sudoers file (edit with the visudo command):

apache  ALL=NOPASSWD:/usr/sbin/chpasswd
apache  ALL=NOPASSWD:/usr/sbin/useradd
apache  ALL=NOPASSWD:/usr/sbin/userdel

Then change the 'user_manager' property in the auth_sources.inc file to 'passwd'.

A sample configuration file which will use IMAP authentication with system users. The first auth source is only for the admin to create new users:

 

$auth_sources[] =
        array(
        'type' => 'sql',
        'name' => 'Group-Office database',
        'user_manager' => 'passwd',
        'add_go_id_to_username'=> false,
        'create_email_account' => true,
        'proto' => 'imap',
        'domain' => 'intermesh.nl',
        'host' => 'localhost',
        'port' => '143',
        'ssl' => false,
        'novalidate_cert' => true,
        'mbroot' => '',
        'add_domain_to_username' => false,
        'go_username_without_domain' => true,
        'create_email_account' => true,
        'auto_check_email' => true
        );
       


$auth_sources[] =
    array(
    'type' => 'email',                           
    'name' => 'intermesh.nl',
    'user_manager' => 'passwd',
    'add_go_id_to_username'=> false,
    'proto' => 'imap',
    'domain' => 'intermesh.nl',
    'host' => 'localhost',
    'port' => '143',
    'ssl' => false,
    'novalidate_cert' => true,
    'mbroot' => '',
    'add_domain_to_username' => false,
    'go_username_without_domain' => true,
    'create_email_account' => true,
    'auto_check_email' => true,
    'groups' => array(),
    'visible_groups' => array('Everyone'),
    'modules_read' => array('email', 'filesystem', 'addressbook', 'calendar', 'bookmarks', 'notes', 'summary'),
    'modules_write' => array()
    );

 

When you create a user john Group-Office will create a system user groupoffice_john. The prefix groupoffice can be changed in the config.php file: 

$config['id']='groupoffice';

 You might want to avoid this when using IMAP authentication. Because it are not very friendly usernames. YOu can add 'add_go_id_to_username'=> false to the auth_sources.inc file. This only works in 2.18 and higher.