/** * Saves the registration information * * @param object $tab - The tab * @param JUser &$user - The JUser * @param object $ui - The UI * @param object $postdata - The postdata * * @return void */ function saveRegistrationTab($tab, &$user, $ui, $postdata) { // Save User to temporary table- not active here if (!empty($postdata['cmc']['newsletter'])) { // For the hidden field $listId = $postdata['cmc']['listid']; $plugin = GetCmcTab::getPlugin(); $mappedData = $this->getMapping($plugin->params->get('mapfields'), $postdata); if (count($mappedData)) { $mergedGroups = array_merge($mappedData, $postdata['cmc_groups']); $postdata = array_merge($postdata, array('cmc_groups' => $mergedGroups)); } $updated = CmcHelperRegistration::isSubscribed($listId, $user->email); if ($updated) { // Update users subscription with the new data CmcHelperRegistration::updateSubscription($user, $postdata); } else { // Temporary save user in cmc database CmcHelperRegistration::saveTempUser($user, $postdata, _CPLG_CB); } } }