"allow admins to import contacts with creator / created date set"

This commit is contained in:
Ralf Becker 2007-11-23 17:19:38 +00:00
parent 4b4922c589
commit 5428f8d941

View File

@ -463,8 +463,9 @@ class bocontacts extends socontacts
// if no owner/addressbook set use the setting of the add_default prefs (if set, otherwise the users personal addressbook) // if no owner/addressbook set use the setting of the add_default prefs (if set, otherwise the users personal addressbook)
if (!isset($contact['owner'])) $contact['owner'] = (int)$this->prefs['add_default'] ? (int)$this->prefs['add_default'] : $this->user; if (!isset($contact['owner'])) $contact['owner'] = (int)$this->prefs['add_default'] ? (int)$this->prefs['add_default'] : $this->user;
if (!isset($contact['private'])) $contact['private'] = (int)(substr($this->prefs['add_default'],-1) == 'p'); if (!isset($contact['private'])) $contact['private'] = (int)(substr($this->prefs['add_default'],-1) == 'p');
$contact['creator'] = $this->user; // allow admins to import contacts with creator / created date set
$contact['created'] = $this->now_su; if (!$contact['creator'] || !$this->is_admin($contact)) $contact['creator'] = $this->user;
if (!$contact['created'] || !$this->is_admin($contact)) $contact['created'] = $this->now_su;
if (!$contact['tid']) $contact['tid'] = 'n'; if (!$contact['tid']) $contact['tid'] = 'n';
} }