mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-18 11:21:23 +01:00
function to create email addresses after a configurable policy
This commit is contained in:
parent
515a22be1a
commit
703f049b09
@ -307,6 +307,10 @@
|
|||||||
|
|
||||||
if ($_POST['submit'])
|
if ($_POST['submit'])
|
||||||
{
|
{
|
||||||
|
if (!($email = $_POST['account_email']))
|
||||||
|
{
|
||||||
|
$email = $GLOBALS['egw']->common->email_address($_POST['account_firstname'],$_POST['account_lastname'],$_POST['account_lid']);
|
||||||
|
}
|
||||||
$userData = array(
|
$userData = array(
|
||||||
'account_type' => 'u',
|
'account_type' => 'u',
|
||||||
'account_lid' => $accountPrefix.$_POST['account_lid'],
|
'account_lid' => $accountPrefix.$_POST['account_lid'],
|
||||||
@ -326,7 +330,7 @@
|
|||||||
'homedirectory' => $_POST['homedirectory'],
|
'homedirectory' => $_POST['homedirectory'],
|
||||||
'loginshell' => $_POST['loginshell'],
|
'loginshell' => $_POST['loginshell'],
|
||||||
'account_expires_never' => $_POST['never_expires'],
|
'account_expires_never' => $_POST['never_expires'],
|
||||||
'account_email' => $_POST['account_email'],
|
'account_email' => $email,
|
||||||
/* 'file_space' => $_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
|
/* 'file_space' => $_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -517,6 +521,10 @@
|
|||||||
|
|
||||||
if ($_POST['submit'])
|
if ($_POST['submit'])
|
||||||
{
|
{
|
||||||
|
if (!($email = $_POST['account_email']))
|
||||||
|
{
|
||||||
|
$email = $GLOBALS['egw']->common->email_address($_POST['account_firstname'],$_POST['account_lastname'],$_POST['account_lid']);
|
||||||
|
}
|
||||||
$userData = array(
|
$userData = array(
|
||||||
'account_lid' => $accountPrefix.$_POST['account_lid'],
|
'account_lid' => $accountPrefix.$_POST['account_lid'],
|
||||||
'firstname' => $_POST['account_firstname'],
|
'firstname' => $_POST['account_firstname'],
|
||||||
@ -535,7 +543,7 @@
|
|||||||
'homedirectory' => $_POST['homedirectory'],
|
'homedirectory' => $_POST['homedirectory'],
|
||||||
'loginshell' => $_POST['loginshell'],
|
'loginshell' => $_POST['loginshell'],
|
||||||
'account_expires_never' => $_POST['never_expires'],
|
'account_expires_never' => $_POST['never_expires'],
|
||||||
'email' => $_POST['account_email'],
|
'email' => $email,
|
||||||
/* 'file_space' => $_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
|
/* 'file_space' => $_POST['account_file_space_number'] . "-" . $_POST['account_file_space_type'] */
|
||||||
);
|
);
|
||||||
if ($userData['account_primary_group'] && (!isset($userData['account_groups']) || !in_array($userData['account_primary_group'],$userData['account_groups'])))
|
if ($userData['account_primary_group'] && (!isset($userData['account_groups']) || !in_array($userData['account_primary_group'],$userData['account_groups'])))
|
||||||
|
@ -1029,6 +1029,8 @@
|
|||||||
|
|
||||||
function create_edit_user($_account_id,$_userData='',$_errors='')
|
function create_edit_user($_account_id,$_userData='',$_errors='')
|
||||||
{
|
{
|
||||||
|
$GLOBALS['egw_info']['flags']['include_xajax'] = true;
|
||||||
|
|
||||||
$sbox =& CreateObject('phpgwapi.sbox');
|
$sbox =& CreateObject('phpgwapi.sbox');
|
||||||
$jscal =& CreateObject('phpgwapi.jscalendar');
|
$jscal =& CreateObject('phpgwapi.jscalendar');
|
||||||
|
|
||||||
@ -1127,7 +1129,8 @@
|
|||||||
'lang_firstname' => lang('First Name'),
|
'lang_firstname' => lang('First Name'),
|
||||||
'lang_anonymous' => lang('Anonymous User (not shown in list sessions)'),
|
'lang_anonymous' => lang('Anonymous User (not shown in list sessions)'),
|
||||||
'lang_changepassword' => lang('Can change password'),
|
'lang_changepassword' => lang('Can change password'),
|
||||||
'lang_button' => ($_account_id?lang('Save'):lang('Add'))
|
'lang_button' => ($_account_id?lang('Save'):lang('Add')),
|
||||||
|
'lang_passwds_unequal' => lang('The two passwords are not the same'),
|
||||||
/* 'lang_file_space' => lang('File Space') */
|
/* 'lang_file_space' => lang('File Space') */
|
||||||
);
|
);
|
||||||
$t->set_var($var);
|
$t->set_var($var);
|
||||||
@ -1187,7 +1190,7 @@
|
|||||||
$var = Array(
|
$var = Array(
|
||||||
'input_expires' => $jscal->input('expires',$userData['expires']<0?'':($userData['expires']?$userData['expires']:time()+(60*60*24*7))),
|
'input_expires' => $jscal->input('expires',$userData['expires']<0?'':($userData['expires']?$userData['expires']:time()+(60*60*24*7))),
|
||||||
'lang_never' => lang('Never'),
|
'lang_never' => lang('Never'),
|
||||||
'account_lid' => $accountPrefix.'<input name="account_lid" value="' . $userData['account_lid'] . '">',
|
'account_lid' => $accountPrefix.'<input id="account" onchange="check_account_email(this.id);" name="account_lid" value="' . $userData['account_lid'] . '">',
|
||||||
'lang_homedir' => $lang_homedir,
|
'lang_homedir' => $lang_homedir,
|
||||||
'lang_shell' => $lang_shell,
|
'lang_shell' => $lang_shell,
|
||||||
'homedirectory' => $homedirectory,
|
'homedirectory' => $homedirectory,
|
||||||
@ -1195,12 +1198,13 @@
|
|||||||
'anonymous' => '<input type="checkbox" name="anonymous" value="1"'.($userData['anonymous'] ? ' checked' : '').'>',
|
'anonymous' => '<input type="checkbox" name="anonymous" value="1"'.($userData['anonymous'] ? ' checked' : '').'>',
|
||||||
'changepassword' => '<input type="checkbox" name="changepassword" value="1"'.($userData['changepassword'] ? ' checked' : '').'>',
|
'changepassword' => '<input type="checkbox" name="changepassword" value="1"'.($userData['changepassword'] ? ' checked' : '').'>',
|
||||||
'account_status' => '<input type="checkbox" name="account_status" value="A"'.($userData['status']?' checked':'').'>',
|
'account_status' => '<input type="checkbox" name="account_status" value="A"'.($userData['status']?' checked':'').'>',
|
||||||
'account_firstname' => '<input name="account_firstname" value="' . $userData['firstname'] . '">',
|
'account_firstname' => '<input id="firstname" onchange="check_account_email(this.id);" name="account_firstname" value="' . $userData['firstname'] . '">',
|
||||||
'account_lastname' => '<input name="account_lastname" value="' . $userData['lastname'] . '">',
|
'account_lastname' => '<input id="lastname" onchange="check_account_email(this.id);" name="account_lastname" value="' . $userData['lastname'] . '">',
|
||||||
'account_email' => '<input name="account_email" size="32" value="' . $userData['email'] . '">',
|
'account_email' => '<input id="email" onchange="check_account_email(this.id);" name="account_email" size="32" value="' . $userData['email'] . '">',
|
||||||
'account_passwd' => $userData['account_passwd'],
|
'account_passwd' => $userData['account_passwd'],
|
||||||
'account_passwd_2' => $userData['account_passwd_2'],
|
'account_passwd_2' => $userData['account_passwd_2'],
|
||||||
'account_file_space' => $account_file_space
|
'account_file_space' => $account_file_space,
|
||||||
|
'account_id' => (int) $userData['account_id'],
|
||||||
);
|
);
|
||||||
|
|
||||||
if($userData['expires'] == -1)
|
if($userData['expires'] == -1)
|
||||||
@ -1325,6 +1329,22 @@
|
|||||||
echo $t->fp('out','form');
|
echo $t->fp('out','form');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ajax_check_account_email($first,$last,$account_lid,$account_id,$email,$id)
|
||||||
|
{
|
||||||
|
$response =& new xajaxResponse();
|
||||||
|
if (!$email)
|
||||||
|
{
|
||||||
|
$response->addAssign('email','value',$GLOBALS['egw']->common->email_address($first,$last,$account_lid));
|
||||||
|
}
|
||||||
|
$id_account_lid = (int) $GLOBALS['egw']->accounts->name2id($account_lid);
|
||||||
|
if ($id == 'account' && $id_account_lid && $id_account_lid != (int) $account_id)
|
||||||
|
{
|
||||||
|
$response->addScript("alert('".addslashes(lang('That loginid has already been taken').': '.$account_lid)."'); document.getElementById('account').value='".
|
||||||
|
($account_id ? $GLOBALS['egw']->accounts->id2name($account_id) : '')."'; document.getElementById('account').focus();");
|
||||||
|
}
|
||||||
|
return $response->getXML();
|
||||||
|
}
|
||||||
|
|
||||||
function edit_group_managers($group_info,$_errors='')
|
function edit_group_managers($group_info,$_errors='')
|
||||||
{
|
{
|
||||||
if ($GLOBALS['egw']->acl->check('group_access',16,'admin'))
|
if ($GLOBALS['egw']->acl->check('group_access',16,'admin'))
|
||||||
|
@ -221,12 +221,14 @@ host information admin de Host-Information
|
|||||||
hour<br>(0-23) admin de Stunde<br>(0-23)
|
hour<br>(0-23) admin de Stunde<br>(0-23)
|
||||||
how many days should entries stay in the access log, before they get deleted (default 90) ? admin de Wie viele Tage sollen Einträge im Zugangsprotokoll bleiben, bevor sie gelöscht werden (Vorgabe 90)?
|
how many days should entries stay in the access log, before they get deleted (default 90) ? admin de Wie viele Tage sollen Einträge im Zugangsprotokoll bleiben, bevor sie gelöscht werden (Vorgabe 90)?
|
||||||
how many minutes should an account or ip be blocked (default 30) ? admin de Wie viele Minuten soll ein Benutzerkonto oder eine IP gesperrt werden (Vorgabe 30)?
|
how many minutes should an account or ip be blocked (default 30) ? admin de Wie viele Minuten soll ein Benutzerkonto oder eine IP gesperrt werden (Vorgabe 30)?
|
||||||
|
how should email addresses for new users be constructed? admin de In welchem Format sollen EMail Adressen von neuen Benutzern erzeugt werden?
|
||||||
icon admin de Icon
|
icon admin de Icon
|
||||||
idle admin de im Leerlauf
|
idle admin de im Leerlauf
|
||||||
if no acl records for user or any group the user is a member of admin de Wenn es keinen ACL-Eintrag für einen Benutzer oder oder eine Gruppe der er angehört gibt
|
if no acl records for user or any group the user is a member of admin de Wenn es keinen ACL-Eintrag für einen Benutzer oder oder eine Gruppe der er angehört gibt
|
||||||
if using ldap, do you want to manage homedirectory and loginshell attributes? admin de Wenn Sie LDAP verwenden, wollen Sie Benutzerverzeichnisse und Komandointerpreter verwalten ?
|
if using ldap, do you want to manage homedirectory and loginshell attributes? admin de Wenn Sie LDAP verwenden, wollen Sie Benutzerverzeichnisse und Komandointerpreter verwalten ?
|
||||||
in mbyte admin de in MByte
|
in mbyte admin de in MByte
|
||||||
inbound admin de eingehend
|
inbound admin de eingehend
|
||||||
|
initial admin de Anfangsbuchstabe
|
||||||
install crontab admin de Crontab installieren
|
install crontab admin de Crontab installieren
|
||||||
installed applications common de Installierte Anwendungen
|
installed applications common de Installierte Anwendungen
|
||||||
installed crontab admin de Installierte Crontab
|
installed crontab admin de Installierte Crontab
|
||||||
@ -406,7 +408,7 @@ use cookies to pass sessionid admin de SitzungsId in einem Cookie speichern
|
|||||||
use pure html compliant code (not fully working yet) admin de Vollständig HTML kompatiblen Code verwenden (nicht vollständig implementiert)
|
use pure html compliant code (not fully working yet) admin de Vollständig HTML kompatiblen Code verwenden (nicht vollständig implementiert)
|
||||||
use theme admin de Benutztes Farbschema
|
use theme admin de Benutztes Farbschema
|
||||||
user accounts admin de Benutzerkonten
|
user accounts admin de Benutzerkonten
|
||||||
user data admin de Benutzerdaten
|
user data common de Benutzerdaten
|
||||||
user for smtp-authentication (leave it empty if no auth required) admin de Benutzer für SMTP Authentifizierung (leer lassen falls keine Authentifizierung nötig)
|
user for smtp-authentication (leave it empty if no auth required) admin de Benutzer für SMTP Authentifizierung (leer lassen falls keine Authentifizierung nötig)
|
||||||
user groups admin de Benutzergruppen
|
user groups admin de Benutzergruppen
|
||||||
userdata admin de Benutzerkonto
|
userdata admin de Benutzerkonto
|
||||||
|
@ -221,12 +221,14 @@ host information admin en Host information
|
|||||||
hour<br>(0-23) admin en Hour<br>(0-23)
|
hour<br>(0-23) admin en Hour<br>(0-23)
|
||||||
how many days should entries stay in the access log, before they get deleted (default 90) ? admin en How many days should entries stay in the access log, before they get deleted (default 90) ?
|
how many days should entries stay in the access log, before they get deleted (default 90) ? admin en How many days should entries stay in the access log, before they get deleted (default 90) ?
|
||||||
how many minutes should an account or ip be blocked (default 30) ? admin en How many minutes should an account or IP be blocked (default 30) ?
|
how many minutes should an account or ip be blocked (default 30) ? admin en How many minutes should an account or IP be blocked (default 30) ?
|
||||||
|
how should email addresses for new users be constructed? admin en How should EMail addresses for new users be constructed?
|
||||||
icon admin en Icon
|
icon admin en Icon
|
||||||
idle admin en idle
|
idle admin en idle
|
||||||
if no acl records for user or any group the user is a member of admin en If no ACL records for user or any group the user is a member of
|
if no acl records for user or any group the user is a member of admin en If no ACL records for user or any group the user is a member of
|
||||||
if using ldap, do you want to manage homedirectory and loginshell attributes? admin en If using LDAP, do you want to manage homedirectory and loginshell attributes?
|
if using ldap, do you want to manage homedirectory and loginshell attributes? admin en If using LDAP, do you want to manage homedirectory and loginshell attributes?
|
||||||
in mbyte admin en in MByte
|
in mbyte admin en in MByte
|
||||||
inbound admin en inbound
|
inbound admin en inbound
|
||||||
|
initial admin en Initial
|
||||||
install crontab admin en Install crontab
|
install crontab admin en Install crontab
|
||||||
installed applications common en Installed applications
|
installed applications common en Installed applications
|
||||||
installed crontab admin en Installed crontab
|
installed crontab admin en Installed crontab
|
||||||
@ -406,7 +408,7 @@ use cookies to pass sessionid admin en Use cookies to pass sessionid
|
|||||||
use pure html compliant code (not fully working yet) admin en Use pure HTML compliant code (not fully working yet)
|
use pure html compliant code (not fully working yet) admin en Use pure HTML compliant code (not fully working yet)
|
||||||
use theme admin en Use theme
|
use theme admin en Use theme
|
||||||
user accounts admin en User accounts
|
user accounts admin en User accounts
|
||||||
user data admin en User Data
|
user data common en User Data
|
||||||
user for smtp-authentication (leave it empty if no auth required) admin en User for SMTP-authentication (leave it empty if no auth required)
|
user for smtp-authentication (leave it empty if no auth required) admin en User for SMTP-authentication (leave it empty if no auth required)
|
||||||
user groups admin en User groups
|
user groups admin en User groups
|
||||||
userdata admin en userdata
|
userdata admin en userdata
|
||||||
|
@ -1,6 +1,34 @@
|
|||||||
<!-- BEGIN form -->
|
<!-- BEGIN form -->
|
||||||
{error_messages}
|
{error_messages}
|
||||||
|
<script>
|
||||||
|
var email_set=0;
|
||||||
|
function check_account_email(id)
|
||||||
|
{
|
||||||
|
account = document.getElementById('account').value;
|
||||||
|
firstname = document.getElementById('firstname').value;
|
||||||
|
lastname = document.getElementById('lastname').value;
|
||||||
|
email = document.getElementById('email').value;
|
||||||
|
|
||||||
|
if (!email || email_set || id == 'account')
|
||||||
|
{
|
||||||
|
xajax_doXMLHTTP('admin.uiaccounts.ajax_check_account_email',firstname,lastname,account,{account_id},email_set ? '' : email,id);
|
||||||
|
email_set = !email || email_set;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function check_password(id)
|
||||||
|
{
|
||||||
|
password = document.getElementById('password').value;
|
||||||
|
password2 = document.getElementById('password2').value;
|
||||||
|
|
||||||
|
if (password && (password2 || id == 'password2') && password != password2)
|
||||||
|
{
|
||||||
|
alert('{lang_passwds_unequal}');
|
||||||
|
document.getElementById('password2').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<form method="POST" action="{form_action}">
|
<form method="POST" action="{form_action}">
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<table border="0" width="95%">
|
<table border="0" width="95%">
|
||||||
@ -75,9 +103,9 @@
|
|||||||
<!-- BEGIN form_passwordinfo -->
|
<!-- BEGIN form_passwordinfo -->
|
||||||
<tr class="row_on">
|
<tr class="row_on">
|
||||||
<td>{lang_password}</td>
|
<td>{lang_password}</td>
|
||||||
<td><input type="password" name="account_passwd" value="{account_passwd}"></td>
|
<td><input id="password" onchange="check_password(this.id);" type="password" name="account_passwd" value="{account_passwd}"></td>
|
||||||
<td>{lang_reenter_password}</td>
|
<td>{lang_reenter_password}</td>
|
||||||
<td><input type="password" name="account_passwd_2" value="{account_passwd_2}"></td>
|
<td><input id="password2" onblur="check_password(this.id);" type="password" name="account_passwd_2" value="{account_passwd_2}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END form_passwordinfo -->
|
<!-- END form_passwordinfo -->
|
||||||
|
|
||||||
|
@ -71,6 +71,25 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr class="row_on">
|
||||||
|
<td>{lang_How_should_EMail_addresses_for_new_users_be_constructed?}:</td>
|
||||||
|
<td>
|
||||||
|
<select name="newsettings[email_address_format]">
|
||||||
|
<option value="first_dot_last">{lang_Firstname}.{lang_Lastname}@domain.com</option>
|
||||||
|
<option value="first_last">{lang_Firstname}{lang_Lastname}@domain.com</option>
|
||||||
|
<option value="first_underscore_last">{lang_Firstname}_{lang_Lastname}@domain.com</option>
|
||||||
|
<option value="initial_last">{lang_Initial}{lang_Lastname}@domain.com</option>
|
||||||
|
<option value="initial_dot_last">{lang_Initial}.{lang_Lastname}@domain.com</option>
|
||||||
|
<option value="last_dot_first">{lang_Lastname}.{lang_Firstname}@domain.com</option>
|
||||||
|
<option value="last_first">{lang_Lastname}{lang_Firstname}@domain.com</option>
|
||||||
|
<option value="last_underscore_first">{lang_Lastname}_{lang_Firstname}@domain.com</option>
|
||||||
|
<option value="last">{lang_Lastname}@domain.com</option>
|
||||||
|
<option value="first">{lang_Firstname}@domain.com</option>
|
||||||
|
<option value="account">{lang_Username}@domain.com</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr class="th">
|
<tr class="th">
|
||||||
<td colspan="2"> <b>{lang_appearance}</b></td>
|
<td colspan="2"> <b>{lang_appearance}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user