Kolab 3 some questions
Blessing Chisvo
blessing at randalli.com
Tue May 28 13:01:52 CEST 2013
Hi Christian,
The answer to your 4th question is that you will need to modify the
function "generate_uid"
in /usr/share/kolab-webadmin/lib/api/kolab_api_service_form_value.php.
In my case I wanted it to be surname+intial where intial will be the
first letters in the first name that makes
the UID unique e.g Mark Jones, Marjie Jones and Mary Jones become
jonesm, jonesma, jonesmar respectively.
Below is the modified function:
8<--------------------------------------------------
private function generate_uid($postdata, $attribs = array())
{
if (isset($attribs['auto_form_fields']) &&
isset($attribs['auto_form_fields']['uid'])) {
// Use Data Please
foreach ($attribs['auto_form_fields']['uid']['data'] as $key) {
if (!isset($postdata[$key])) {
throw new Exception("Key not set: " . $key, 12356);
}
}
// TODO: Use preferredlanguage
if (isset($postdata['preferredlanguage'])) {
//console("Using locale for " . $postdata['preferredlanguage']);
setlocale(LC_ALL, $postdata['preferredlanguage']);
}
/* else {
//console("No locale specified...!");
}
*/
$firstname = iconv('UTF-8', 'ASCII//TRANSLIT',
$postdata['givenname']);
$firstname = strtolower($firstname);
$firstname = preg_replace('/[^a-z-_]/i', '', $firstname);
$sirname = iconv('UTF-8', 'ASCII//TRANSLIT', $postdata['sn']);
$sirname = strtolower($sirname);
$sirname = preg_replace('/[^a-z-_]/i', '', $sirname);
$x = 1;
$uid = $sirname . substr($firstname, 0, $x);
$auth = Auth::get_instance($_SESSION['user']->get_domain());
$unique_attr = $this->unique_attribute();
while (($user_found = $auth->user_find_by_attribute(array('uid'
=> $uid)))) {
if (!empty($postdata['id'])) {
$user_found_dn = key($user_found);
$user_found_unique_attr =
$auth->get_entry_attribute($user_found_dn, $unique_attr);
//console("user with uid $uid found",
$user_found_unique_attr);
if ($user_found_unique_attr == $postdata['id']) {
//console("that's us.");
break;
}
}
$x++;
$uid = $sirname . substr($firstname, 0, $x);
}
return $uid;
}
}
8<-----------------------------------------------
I hope it helps.
Regards,
Blessing
Greetings to all,
first of all a huge thank you for this awesome software. We are testing
a kolab 3 installation with the goal to migrate our
Postfix/Postfixadmin/Roundcubemail/Dovecot/Dspam/MySQL solution to
kolab.
We are using about 100 mailboxes with 10 different domains. I have a few
question though:
1. How can I import existing Mailboxes/Users (about 20GB data) in kolab
3? Kolab 3 uses Cyrus-IMAP which has, as far as I know, a different
format to dovecot.
2. There´s already postfix and mysql running on our server. How good or,
lets say easy does kolab 3 integrate into a installation with existing
components like postfix/mysql/ldap etc.
3. While testing i´ve notice that all created domains (besides the
primary domain) cannot be deleted anymore. Is this a bug?
4. The UID is not unique. It uses always the given name as UID. We have
a couple of users with the same given name so this leads to a problem.
Sure, you can edit the UID field and make it writeable but why not use
the givenname and a part of the surname as UID?
It took me some time to understand that created domains through the
webgui aren´t multi-domains as I would expect. There are only domain
aliases to the primary domain.
The feature of multi-domains ca only be configured through CLI
--
Blessing Chisvo (Managing Member)
Randalli Investments cc
Cell: +27 74 569 0227
+27 78 051 2006
Fax: +27 86 552 5484
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kolab.org/pipermail/users/attachments/20130528/e85bcde1/attachment.html>
More information about the users
mailing list