} else { $company_id = 0; } if ($ab->add_contact("", $GO_SECURITY->user_id, $_POST['addressbook_id'], $first_name, $middle_name, $last_name, $initials, $title, $sex, $birthday, $email, $work_phone, $home_phone, $fax, $cellular, $country, $state, $city, $zip, $address, $company_id, $work_fax, $department, $function, '', $group_id, '', $acl_read, $acl_write)) { $GO_SECURITY->copy_acl($addressbook['acl_read'], $acl_read); $GO_SECURITY->copy_acl($addressbook['acl_write'], $acl_write); } else { $GO_SECURITY->delete_acl($acl_read); $GO_SECURITY->delete_acl($acl_write); } } } } else { if (isset($record[$_POST['name']]) && $record[$_POST['name']] != '') { $name = addslashes(trim($record[$_POST['name']])); if (!$ab->get_company_by_name($_POST['addressbook_id'], $name)) { $email = isset($record[$_POST['email']]) ? addslashes(trim($record[$_POST['email']])) : ''; if (preg_match("/(\\b)([\\w\\.\\-]+)(@)([\\w\\.-]+)([A-Za-z]{2,4})\\b/i", $email, $matches)) { $email = $matches[0]; } $phone = isset($record[$_POST['phone']]) ? addslashes(trim($record[$_POST['phone']])) : ''; $fax = isset($record[$_POST['fax']]) ? addslashes(trim($record[$_POST['fax']])) : ''; $country = isset($record[$_POST['country']]) ? addslashes(trim($record[$_POST['country']])) : ''; $state = isset($record[$_POST['state']]) ? addslashes(trim($record[$_POST['state']])) : ''; $city = isset($record[$_POST['city']]) ? addslashes(trim($record[$_POST['city']])) : ''; $zip = isset($record[$_POST['zip']]) ? addslashes(trim($record[$_POST['zip']])) : ''; $address = isset($record[$_POST['address']]) ? addslashes(trim($record[$_POST['address']])) : ''; $homepage = isset($record[$_POST['homepage']]) ? addslashes(trim($record[$_POST['homepage']])) : ''; $bank_no = isset($record[$_POST['bank_no']]) ? addslashes(trim($record[$_POST['bank_no']])) : ''; $vat_no = isset($record[$_POST['vat_no']]) ? addslashes(trim($record[$_POST['vat_no']])) : ''; $acl_read = $GO_SECURITY->get_new_acl('contact read');