forked from extern/egroupware
only generate default email address for new accounts, allows to set empty email address for existing accounts or by emptying it before save for new accounts
This commit is contained in:
parent
41e8331edd
commit
5661201ee1
@ -670,7 +670,6 @@ app.classes.addressbook = AppJS.extend(
|
|||||||
case 'account_lid':
|
case 'account_lid':
|
||||||
case 'n_family':
|
case 'n_family':
|
||||||
case 'n_given':
|
case 'n_given':
|
||||||
case 'email':
|
|
||||||
case 'account_passwd_2':
|
case 'account_passwd_2':
|
||||||
var values = this.et2._inst.getValues(this.et2);
|
var values = this.et2._inst.getValues(this.et2);
|
||||||
var data = {
|
var data = {
|
||||||
|
@ -250,8 +250,8 @@ class admin_account
|
|||||||
*/
|
*/
|
||||||
public static function ajax_check(array $data, $changed)
|
public static function ajax_check(array $data, $changed)
|
||||||
{
|
{
|
||||||
// generate default email address
|
// generate default email address, but only for new accounts
|
||||||
if (empty($data['account_email']) || !$data['account_id'] && in_array($changed, array('n_given', 'n_family')))
|
if (!$data['account_id'] && in_array($changed, array('n_given', 'n_family', 'account_lid')))
|
||||||
{
|
{
|
||||||
$email = common::email_address($data['account_firstname'], $data['account_lastname'], $data['account_lid']);
|
$email = common::email_address($data['account_firstname'], $data['account_lastname'], $data['account_lid']);
|
||||||
if ($email && $email[0] != '@' && strpos($email, '@')) // only add valid email addresses
|
if ($email && $email[0] != '@' && strpos($email, '@')) // only add valid email addresses
|
||||||
|
Loading…
Reference in New Issue
Block a user