if ($url = $iaPlan->prePayment($iaUsers->getItemName(), $itemData, $plan['id'])) { iaUtil::redirect(iaLanguage::get('thanks'), iaLanguage::get('member_created'), $url); } } } } } elseif ('register_confirm' == $iaView->name()) { if (!isset($_GET['email']) || !isset($_GET['key'])) { return iaView::accessDenied(); } $error = true; if ($iaUsers->confirmation($_GET['email'], $_GET['key'])) { $messages[] = $iaCore->get('members_autoapproval') ? iaLanguage::get('reg_confirmed') : iaLanguage::get('reg_confirm_adm_approve'); $error = false; $url = $iaCore->get('members_autoapproval') ? IA_URL . 'login/' : IA_URL; iaUtil::redirect(iaLanguage::get('reg_confirmation'), $messages, $url); } else { $messages[] = iaLanguage::get('confirmation_key_incorrect'); } $iaView->assign('success', !$error); } } switch ($iaView->name()) { case 'member_password_forgot': $template = 'forgot'; break; case 'register_confirm': $template = 'registration-confirmation'; break; default: if ($memberId) {
$iaDb->update($item, iaDb::convertIds(iaUsers::getIdentity()->id)); if (0 == $iaDb->getErrorNumber()) { $iaCore->startHook('phpUserProfileUpdate', array('userInfo' => iaUsers::getIdentity(true), 'data' => $item)); iaUsers::reloadIdentity(); $iaView->setMessages(iaLanguage::get('saved'), iaView::SUCCESS); } else { $iaView->setMessages(iaLanguage::get('db_error')); } } else { $iaView->setMessages($messages); } } if (isset($_POST['plan_id']) && $_POST['plan_id'] != iaUsers::getIdentity()->sponsored_plan_id) { if ($plan = $iaPlan->getById((int) $_POST['plan_id'])) { $url = $iaPlan->prePayment($itemName, iaUsers::getIdentity(true), $plan['id'], IA_SELF); iaUtil::redirect(iaLanguage::get('thanks'), iaLanguage::get('plan_added'), $url); } else { $iaPlan->setUnpaid(iaUsers::getItemName(), iaUsers::getIdentity()->id); } } } $iaCore->startHook('phpFrontAfterProfileProcessData'); $item = iaUsers::getIdentity(true); // get fieldgroups list($tabs, $fieldgroups) = $iaField->generateTabs($iaField->filterByGroup($item, $itemName)); // compose tabs $sections = array_merge(array('common' => $fieldgroups), $tabs); $extraTabs = array(); $iaCore->startHook('phpFrontEditProfileExtraTabs', array('tabs' => &$extraTabs, 'item' => &$item)); $sections = array_merge($sections, $extraTabs); if (iaUsers::MEMBERSHIP_ADMINISTRATOR != iaUsers::getIdentity()->usergroup_id) {
$action = 'added'; $data['id'] = $iaLyric->add($data); } else { if (isset($_POST['delete_lyric'])) { $action = 'deleted'; $data['id'] = 0; $iaLyric->delete('`id` = ' . $lyric['id']); } else { $action = 'updated'; $data['id'] = $lyric['id']; $iaLyric->update($data); } } if (!$error) { $messages[] = _t('lyric_' . $action . $dmsg); iaUtil::redirect(_t('thanks'), $messages, $iaLyric->url('view', $data)); } } if (isset($_POST['ajax'])) { header('Content-type: text/xml'); echo '<?xml version="1.0" encoding="' . $iaCore->get('charset') . '" ?>' . '<root><error>' . $error . '</error><msg><![CDATA[<li>' . implode('</li><li>', $messages) . ']]></msg></root>'; exit; } } $itemInfo = false; $sections = iaField::getAcoGroupsFields(false, 'lyrics', '', $itemInfo); $iaView->assign('sections', $sections); $iaView->assign('fields', $fields); $iaView->assign('error_fields', $errorFields); $iaView->assign('item', $lyric); $iaView->display('manage');
$tplFile = 'pay'; $error = false; $messages = array(); $iaPlan = $iaCore->factory('plan'); $iaUsers = $iaCore->factory('users'); $iaCore->startHook('phpFrontBeforePaymentProcessing', array('transaction' => $transaction)); switch ($transaction['status']) { case iaTransaction::PENDING: if (isset($_POST['source']) && 'internal' == $_POST['source']) { $iaCore->startHook('phpFrontPaymentBeforeBalanceUpdate'); if ($transaction && isset($_POST['source']) && 'internal' == $_POST['source']) { if ($iaPlan->extractFunds($transaction)) { empty($_POST['invaddr']) || $iaCore->factory('invoice')->updateAddress($transaction['id'], $_POST['invaddr']); /*-- MOD // jjangaraev --*/ $iaPlan->setPaid($transaction); iaUtil::redirect(iaLanguage::get('thanks'), iaLanguage::get('payment_done'), $transaction['return_url']); } } } elseif (empty($transaction['gateway']) || isset($_GET['repay'])) { if (empty($transaction['plan_id'])) { $plan['title'] = $transaction['operation']; $plan['cost'] = $transaction['amount']; } else { $plan = $iaPlan->getById($transaction['plan_id']); } $plan['title'] = $transaction['item'] . ' - ' . $plan['title']; $iaView->assign('plan', $plan); $iaView->assign('address', $iaCore->factory('invoice')->getAddress($transaction['id'])); foreach ($gateways as $key => $gateway) { $htmlFormTemplate = IA_PLUGINS . $key . IA_DS . 'templates' . IA_DS . 'front' . IA_DS . 'form.tpl'; $gateways[$key] = file_exists($htmlFormTemplate) ? $htmlFormTemplate : false;
} } else { if (isset($_POST['delete_recipe'])) { $iaDb->delete('`id` = ' . $recipe['id']); $action = 'deleted'; $data['id'] = 0; } else { $action = 'updated'; $data['id'] = $recipe['id']; $iaDb->update($data); } } if (!$error) { $url = IA_PACKAGE_URL . ($data['id'] != 0 ? 'add/?id=' . $data['id'] : 'accounts/'); $msg[] = _t('recipe_' . $action . $dmsg); $iaUtil = $iaCore->factory('core', 'util'); iaUtil::redirect(_t('thanks'), $msg, $url, isset($_POST['ajax'])); } } if (isset($_POST['ajax'])) { header('Content-type: text/xml'); echo '<?xml version="1.0" encoding="' . $iaCore->get('charset') . '" ?>' . '<root><error>' . $error . '</error><msg><![CDATA[<li>' . implode('</li><li>', $msg) . ']]></msg></root>'; exit; } } $iaCore->assign('error_fields', $error_fields); $iaCore->assign('item', $recipe); $iaCore->set_cfg('body', 'submit'); $iaCore->set_cfg('title', _t('page_title_' . INTELLI_REALM)); } $iaDb->resetTable();