Commit d4c760c1 authored by mcramer's avatar mcramer
Browse files

Implemented optional custom login name for mailboxes.

parent 03b74b91
...@@ -103,7 +103,7 @@ MYSQL_GID_FIELD 8 ...@@ -103,7 +103,7 @@ MYSQL_GID_FIELD 8
# SELECT MYSQL_UID_FIELD, MYSQL_GID_FIELD, ... WHERE id='loginid' # SELECT MYSQL_UID_FIELD, MYSQL_GID_FIELD, ... WHERE id='loginid'
# #
MYSQL_LOGIN_FIELD email MYSQL_LOGIN_FIELD login
##NAME: MYSQL_HOME_FIELD:0 ##NAME: MYSQL_HOME_FIELD:0
# #
......
...@@ -589,6 +589,7 @@ CREATE TABLE `mail_user` ( ...@@ -589,6 +589,7 @@ CREATE TABLE `mail_user` (
`sys_perm_other` varchar(5) NOT NULL default '', `sys_perm_other` varchar(5) NOT NULL default '',
`server_id` int(11) unsigned NOT NULL default '0', `server_id` int(11) unsigned NOT NULL default '0',
`email` varchar(255) NOT NULL default '', `email` varchar(255) NOT NULL default '',
`login` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL, `password` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL default '', `name` varchar(255) NOT NULL default '',
`uid` int(11) unsigned NOT NULL default '5000', `uid` int(11) unsigned NOT NULL default '5000',
......
...@@ -8,7 +8,7 @@ MYSQL_CRYPT_PWFIELD password ...@@ -8,7 +8,7 @@ MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password #MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD uid MYSQL_UID_FIELD uid
MYSQL_GID_FIELD gid MYSQL_GID_FIELD gid
MYSQL_LOGIN_FIELD email MYSQL_LOGIN_FIELD login
MYSQL_HOME_FIELD homedir MYSQL_HOME_FIELD homedir
MYSQL_MAILDIR_FIELD maildir MYSQL_MAILDIR_FIELD maildir
#MYSQL_NAME_FIELD #MYSQL_NAME_FIELD
......
...@@ -120,7 +120,7 @@ driver = mysql ...@@ -120,7 +120,7 @@ driver = mysql
connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password}
default_pass_scheme = CRYPT default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
#user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' #user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
user_query = SELECT email AS user, maildir AS home, CONCAT('*:storage=', quota , 'B') AS quota_rule FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' user_query = SELECT email AS user, maildir AS home, CONCAT('*:storage=', quota , 'B') AS quota_rule FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
...@@ -120,7 +120,7 @@ driver = mysql ...@@ -120,7 +120,7 @@ driver = mysql
connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password}
default_pass_scheme = CRYPT default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
...@@ -133,5 +133,5 @@ driver = mysql ...@@ -133,5 +133,5 @@ driver = mysql
connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password}
default_pass_scheme = CRYPT default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
...@@ -3,6 +3,6 @@ password = {mysql_server_ispconfig_password} ...@@ -3,6 +3,6 @@ password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database} dbname = {mysql_server_database}
table = mail_user table = mail_user
select_field = CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') select_field = CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
where_field = email where_field = login
additional_conditions = and postfix = 'y' and server_id = {server_id} additional_conditions = and postfix = 'y' and server_id = {server_id}
hosts = {mysql_server_ip} hosts = {mysql_server_ip}
\ No newline at end of file
...@@ -133,5 +133,5 @@ driver = mysql ...@@ -133,5 +133,5 @@ driver = mysql
connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password}
default_pass_scheme = CRYPT default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n' user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
auth required pam_mysql.so user={mysql_server_ispconfig_user} passwd={mysql_server_ispconfig_password} host={mysql_server_ip} db={mysql_server_database} table=mail_user usercolumn=email passwdcolumn=password crypt=1 auth required pam_mysql.so user={mysql_server_ispconfig_user} passwd={mysql_server_ispconfig_password} host={mysql_server_ip} db={mysql_server_database} table=mail_user usercolumn=login passwdcolumn=password crypt=1
account sufficient pam_mysql.so user={mysql_server_ispconfig_user} passwd={mysql_server_ispconfig_password} host={mysql_server_ip} db={mysql_server_database} table=mail_user usercolumn=email passwdcolumn=password crypt=1 account sufficient pam_mysql.so user={mysql_server_ispconfig_user} passwd={mysql_server_ispconfig_password} host={mysql_server_ip} db={mysql_server_database} table=mail_user usercolumn=login passwdcolumn=password crypt=1
\ No newline at end of file \ No newline at end of file
...@@ -6,4 +6,4 @@ sql_hostnames: {mysql_server_ip} ...@@ -6,4 +6,4 @@ sql_hostnames: {mysql_server_ip}
sql_user: {mysql_server_ispconfig_user} sql_user: {mysql_server_ispconfig_user}
sql_passwd: {mysql_server_ispconfig_password} sql_passwd: {mysql_server_ispconfig_password}
sql_database: {mysql_server_database} sql_database: {mysql_server_database}
sql_select: select password from mail_user where email = '%u' sql_select: select password from mail_user where login = '%u'
\ No newline at end of file
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
[dns] [dns]
[mail] [mail]
enable_custom_login=n
mailboxlist_webmail_link=y mailboxlist_webmail_link=y
webmail_url= webmail_url=
......
...@@ -162,6 +162,12 @@ $form["tabs"]['mail'] = array ( ...@@ -162,6 +162,12 @@ $form["tabs"]['mail'] = array (
################################## ##################################
# Begin Datatable fields # Begin Datatable fields
################################## ##################################
'enable_custom_login' => array(
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'mailboxlist_webmail_link' => array ( 'mailboxlist_webmail_link' => array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX', 'formtype' => 'CHECKBOX',
......
...@@ -19,4 +19,5 @@ $wb['use_domain_module_txt'] = 'Use the domain-module to add new domains'; ...@@ -19,4 +19,5 @@ $wb['use_domain_module_txt'] = 'Use the domain-module to add new domains';
$wb['use_domain_module_hint'] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They cannot free edit the domain-field.You have to re-login after changing this value, to make the changes visible.'; $wb['use_domain_module_hint'] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They cannot free edit the domain-field.You have to re-login after changing this value, to make the changes visible.';
$wb['new_domain_txt'] = 'HTML to create a new domain'; $wb['new_domain_txt'] = 'HTML to create a new domain';
$wb['webftp_url_txt'] = 'WebFTP URL'; $wb['webftp_url_txt'] = 'WebFTP URL';
$wb['enable_custom_login_txt'] = 'Abweichenden Login-Namen erlauben';
?> ?>
...@@ -12,6 +12,7 @@ $wb["ftpuser_prefix_error_regex"] = 'Char not allowed in ftp user prefix.'; ...@@ -12,6 +12,7 @@ $wb["ftpuser_prefix_error_regex"] = 'Char not allowed in ftp user prefix.';
$wb["shelluser_prefix_error_regex"] = 'Char not allowed in shell user prefix.'; $wb["shelluser_prefix_error_regex"] = 'Char not allowed in shell user prefix.';
$wb["webdavuser_prefix_error_regex"] = 'Char not allowed in webdav user prefix.'; $wb["webdavuser_prefix_error_regex"] = 'Char not allowed in webdav user prefix.';
$wb["dblist_phpmyadmin_link_txt"] = 'Link to phpmyadmin in DB list'; $wb["dblist_phpmyadmin_link_txt"] = 'Link to phpmyadmin in DB list';
$wb['enable_custom_login_txt'] = 'Allow custom login name';
$wb["mailboxlist_webmail_link_txt"] = 'Link to webmail in Mailbox list'; $wb["mailboxlist_webmail_link_txt"] = 'Link to webmail in Mailbox list';
$wb["webmail_url_txt"] = 'Webmail URL'; $wb["webmail_url_txt"] = 'Webmail URL';
$wb["mailmailinglist_link_txt"] = 'Link to mailing list in Mailing list list'; $wb["mailmailinglist_link_txt"] = 'Link to mailing list in Mailing list list';
...@@ -21,7 +22,7 @@ $wb["use_domain_module_txt"] = 'Use the domain-module to add new domains'; ...@@ -21,7 +22,7 @@ $wb["use_domain_module_txt"] = 'Use the domain-module to add new domains';
$wb["use_domain_module_hint"] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They cannot free edit the domain-field.You have to re-login after changing this value, to make the changes visible.'; $wb["use_domain_module_hint"] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They cannot free edit the domain-field.You have to re-login after changing this value, to make the changes visible.';
$wb["new_domain_txt"] = 'HTML to create a new domain'; $wb["new_domain_txt"] = 'HTML to create a new domain';
$wb["webftp_url_txt"] = 'WebFTP URL'; $wb["webftp_url_txt"] = 'WebFTP URL';
$wb['admin_mail_txt'] = 'Administrator\'s e-mail'; $wb['admin_mail_txt'] = 'Administrator\'s e-mail';
$wb["monitor_key_txt"] = 'Monitor keyword'; $wb["monitor_key_txt"] = 'Monitor keyword';
$wb['admin_name_txt'] = 'Administrator\'s name'; $wb['admin_name_txt'] = 'Administrator\'s name';
?> ?>
...@@ -68,9 +68,9 @@ ...@@ -68,9 +68,9 @@
<input name="mailbox_size_limit" id="mailbox_size_limit" value="{tmpl_var name='mailbox_size_limit'}" size="10" maxlength="15" type="text" class="textInput formLengthLimit" />&nbsp;MB <input name="mailbox_size_limit" id="mailbox_size_limit" value="{tmpl_var name='mailbox_size_limit'}" size="10" maxlength="15" type="text" class="textInput formLengthLimit" />&nbsp;MB
</div> </div>
<div class="ctrlHolder"> <div class="ctrlHolder">
<label for="message_size_limit">{tmpl_var name='message_size_limit_txt'}</label> <label for="message_size_limit">{tmpl_var name='message_size_limit_txt'}</label>
<input name="message_size_limit" id="message_size_limit" value="{tmpl_var name='message_size_limit'}" size="10" maxlength="15" type="text" class="textInput formLengthLimit" />&nbsp;MB <input name="message_size_limit" id="message_size_limit" value="{tmpl_var name='message_size_limit'}" size="10" maxlength="15" type="text" class="textInput formLengthLimit" />&nbsp;MB
</div> </div>
</fieldset> </fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}"> <input type="hidden" name="id" value="{tmpl_var name='id'}">
......
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
<div class="pnl_formsarea"> <div class="pnl_formsarea">
<fieldset class="inlineLabels"> <fieldset class="inlineLabels">
<div class="ctrlHolder">
<p class="label">{tmpl_var name='enable_custom_login_txt'}</p>
<div class="multiField">
{tmpl_var name='enable_custom_login'}
</div>
</div>
<div class="ctrlHolder"> <div class="ctrlHolder">
<p class="label">{tmpl_var name='mailboxlist_webmail_link_txt'}</p> <p class="label">{tmpl_var name='mailboxlist_webmail_link_txt'}</p>
<div class="multiField"> <div class="multiField">
......
...@@ -79,6 +79,21 @@ $form["tabs"]['mailuser'] = array ( ...@@ -79,6 +79,21 @@ $form["tabs"]['mailuser'] = array (
'width' => '30', 'width' => '30',
'maxlength' => '255' 'maxlength' => '255'
), ),
'login' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array (
0 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'login_error_unique'),
1 => array ( 'type' => 'REGEX',
'regex' => '/^[a-z][\w\.\-_\+@]{1,63}$/',
'errmsg'=> 'login_error_regex'),
),
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'password' => array ( 'password' => array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'PASSWORD', 'formtype' => 'PASSWORD',
......
...@@ -39,4 +39,8 @@ $wb['name_optional_txt'] = '(optional)'; ...@@ -39,4 +39,8 @@ $wb['name_optional_txt'] = '(optional)';
$wb['autoresponder_active'] = 'Enable the autoresponder'; $wb['autoresponder_active'] = 'Enable the autoresponder';
$wb['cc_txt'] = 'Send copy to'; $wb['cc_txt'] = 'Send copy to';
$wb['cc_error_isemail'] = 'The Send copy to field does not conatin a valid email address'; $wb['cc_error_isemail'] = 'The Send copy to field does not conatin a valid email address';
$wb['login_error_unique'] = 'Login wird bereits verwendet.';
$wb['login_error_regex'] = 'Zulässige Zeichen sind A-Z, a-z, 0-9, ., _ und -.';
$wb['login_txt'] = 'Login (optional)';
$wb['error_login_email_txt'] = 'Dieser Loginname ist nicht zulässig. Bitte verwenden Sie einen anderen Loginnamen oder die E-Mail-Adresse als Login.';
?> ?>
...@@ -4,4 +4,5 @@ $wb['email_txt'] = 'E-Mail-Adresse'; ...@@ -4,4 +4,5 @@ $wb['email_txt'] = 'E-Mail-Adresse';
$wb['autoresponder_txt'] = 'Autoresponder'; $wb['autoresponder_txt'] = 'Autoresponder';
$wb['add_new_record_txt'] = 'Neue Mailbox hinzufügen'; $wb['add_new_record_txt'] = 'Neue Mailbox hinzufügen';
$wb['name_txt'] = 'Realname'; $wb['name_txt'] = 'Realname';
$wb['login_txt'] = 'Login';
?> ?>
...@@ -41,4 +41,8 @@ $wb['cc_txt'] = 'Send copy to'; ...@@ -41,4 +41,8 @@ $wb['cc_txt'] = 'Send copy to';
$wb['cc_error_isemail'] = 'The -Send copy to- field does not conatin a valid email address'; $wb['cc_error_isemail'] = 'The -Send copy to- field does not conatin a valid email address';
$wb['domain_txt'] = 'Domain'; $wb['domain_txt'] = 'Domain';
$wb['now_txt']='Now'; $wb['now_txt']='Now';
$wb['login_error_unique'] = 'Login is already taken.';
$wb['login_error_regex'] = 'Valid characters are A-Z, a-z, 0-9, ., _ and -.';
$wb['login_txt'] = 'Login (optional)';
$wb['error_login_email_txt'] = 'This login is not allowed. Please enter a different login or use the mail address as login.';
?> ?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment