Exemplo n.º 1
0
 public function createRequestXML($request)
 {
     $vars['VPSProtocol'] = "2.23";
     $vars['TxType'] = "PAYMENT";
     // AUTHORISE
     $vars['Vendor'] = $this->settings['vid'];
     $vars['VendorTxCode'] = $request->invoice->invoice_number;
     $vars['Amount'] = number_format($request->items->total->cost['amount'], 2);
     $vars['Description'] = AECToolbox::rewriteEngineRQ($this->settings['item_name'], $request);
     $vars['RelatedSecurityKey'] = $this->settings['secret'];
     $vars['Currency'] = $this->settings['currency'];
     $vars['CardHolder'] = $request->int_var['params']['billFirstName'] . ' ' . $request->int_var['params']['billLastName'];
     $vars['CardNumber'] = $request->int_var['params']['cardNumber'];
     $vars['CardType'] = $this->translateCardType($request->int_var['params']['cardType']);
     $vars['ExpiryDate'] = $request->int_var['params']['expirationMonth'] . substr($request->int_var['params']['expirationYear'], -2);
     $vars['CV2'] = $request->int_var['params']['cardVV2'];
     $vars['ClientIPAddress'] = $_SERVER['REMOTE_ADDR'];
     $vars['Apply3DSecure'] = $this->settings['3dsecure'];
     $vars['BillingSurname'] = $request->int_var['params']['billLastName'];
     $vars['BillingFirstnames'] = $request->int_var['params']['billFirstName'];
     $vars['BillingAddress1'] = $request->int_var['params']['billAddress'];
     $vars['BillingCity'] = $request->int_var['params']['billCity'];
     $vars['BillingPostCode'] = $request->int_var['params']['billZip'];
     $vars['BillingState'] = $request->int_var['params']['billState'];
     $vars['BillingCountry'] = $request->int_var['params']['billCountry'];
     $vars['DeliverySurname'] = $request->int_var['params']['billLastName'];
     $vars['DeliveryFirstnames'] = $request->int_var['params']['billFirstName'];
     $vars['DeliveryAddress1'] = $request->int_var['params']['billAddress'];
     $vars['DeliveryCity'] = $request->int_var['params']['billCity'];
     $vars['DeliveryPostCode'] = $request->int_var['params']['billZip'];
     $vars['DeliveryState'] = $request->int_var['params']['billState'];
     $vars['DeliveryCountry'] = $request->int_var['params']['billCountry'];
     return $this->arrayToNVP($vars);
 }
Exemplo n.º 2
0
 public function createGatewayLink($request)
 {
     $var['post_url'] = 'https://select.worldpay.com/wcc/purchase';
     if ($this->settings['testmode']) {
         $var['testMode'] = '100';
     }
     $var['instId'] = $this->settings['instId'];
     $var['currency'] = $this->settings['currency'];
     $var['cartId'] = $request->invoice->invoice_number;
     $var['desc'] = AECToolbox::rewriteEngineRQ($this->settings['item_name'], $request);
     $var['futurePayType'] = 'regular';
     $var['option'] = '0';
     $units = array('D' => '1', 'W' => '2', 'M' => '3', 'Y' => '4');
     if (isset($units[$request->int_var['amount']['unit3']])) {
         $var['intervalUnit'] = $units[$request->int_var['amount']['unit3']];
     } else {
         $var['intervalUnit'] = '1';
     }
     $var['intervalMult'] = $request->int_var['amount']['period3'];
     if (isset($request->int_var['amount']['amount1'])) {
         $var['initialAmount'] = $request->int_var['amount']['amount1'];
     }
     $var['normalAmount'] = $request->int_var['amount']['amount1'];
     return $var;
 }
Exemplo n.º 3
0
 public function transmitRequestXML($xml, $request)
 {
     require_once dirname(__FILE__) . '/lib/cls.ideal.php';
     $response = array();
     $response['valid'] = false;
     $description = substr(AECToolbox::rewriteEngineRQ($this->settings['description'], $request), 0, 29);
     $report_url = AECToolbox::deadsureURL("index.php?option=com_acctexp&task=mollie_idealnotification");
     $return_url = $request->int_var['return_url'];
     $amount = $request->int_var['amount'] * 100;
     $mollieIdeal = new iDEAL_Payment($this->settings['partner_id']);
     if ($this->settings['testmode']) {
         $mollieIdeal->setTestmode(true);
     } else {
         $mollieIdeal->setTestmode(false);
     }
     if ($mollieIdeal->createPayment($request->int_var['params']['bank_id'], $amount, $description, $return_url, $report_url)) {
         // ...Request valid transaction id from Mollie and store it...
         $request->invoice->secondary_ident = $mollieIdeal->getTransactionId();
         $request->invoice->storeload();
         // Redirect to issuer bank
         aecRedirect($mollieIdeal->getBankURL());
     } else {
         // error handling
         $this->___logError("iDEAL_Payment::createPayment failed", $mollieIdeal->getErrorCode(), $mollieIdeal->getErrorMessage());
         return $response;
     }
     return null;
 }
Exemplo n.º 4
0
 public function createGatewayLink($request)
 {
     $var['post_url'] = "https://www.alertpay.com/PayProcess.aspx";
     if ($this->settings['testmode']) {
         $var['ap_test'] = '1';
     }
     if (is_array($request->int_var['amount'])) {
         $var['ap_purchasetype'] = 'Subscription';
         if (isset($request->int_var['amount']['amount1'])) {
             $var['ap_trialamount'] = $request->int_var['amount']['amount1'];
             $put = $this->convertPeriodUnit($request->int_var['amount']['unit1'], $request->int_var['amount']['period1']);
             $var['ap_trialtimeunit'] = $put['unit'];
             $var['ap_trialperiodlength'] = $put['period'];
         }
         $var['ap_amount'] = $request->int_var['amount']['amount3'];
         $puf = $this->convertPeriodUnit($request->int_var['amount']['unit3'], $request->int_var['amount']['period3']);
         $var['ap_timeunit'] = $puf['unit'];
         $var['ap_periodlength'] = $puf['period'];
     } else {
         $var['ap_purchasetype'] = 'Item';
         $var['ap_amount'] = $request->int_var['amount'];
     }
     $var['ap_merchant'] = $this->settings['merchant'];
     $var['ap_itemname'] = $request->invoice->invoice_number;
     $var['ap_currency'] = $this->settings['currency'];
     $var['ap_returnurl'] = AECToolbox::deadsureURL("index.php?option=com_acctexp&task=thanks");
     $var['ap_description'] = AECToolbox::rewriteEngineRQ($this->settings['item_name'], $request);
     $var['ap_cancelurl'] = AECToolbox::deadsureURL("index.php?option=com_acctexp&task=cancel");
     $var['apc_1'] = $request->metaUser->cmsUser->id;
     $var['apc_2'] = AECToolbox::rewriteEngineRQ($this->settings['item_name'], $request);
     $var['apc_3'] = $request->int_var['usage'];
     return $var;
 }
Exemplo n.º 5
0
 public function action($request)
 {
     $db = JFactory::getDBO();
     $text = AECToolbox::rewriteEngineRQ($this->settings['text'], $request);
     $displaypipeline = new displayPipeline();
     $displaypipeline->create($request->metaUser->userid, $this->settings['only_user'], $this->settings['once_per_user'], $this->settings['expire'], $this->settings['expiration'], $this->settings['displaymax'], $text);
     return true;
 }
Exemplo n.º 6
0
 public function relayAction($request)
 {
     if (!isset($this->settings['url' . $request->area])) {
         return null;
     }
     $url = AECToolbox::rewriteEngineRQ($this->settings['url' . $request->area], $request);
     $query = AECToolbox::rewriteEngineRQ($this->settings['query' . $request->area], $request);
     return $this->fetchURL($this->createURL($url, $query));
 }
Exemplo n.º 7
0
 public function modifyPrice($request)
 {
     if (!isset($request->params['amt'])) {
         return null;
     }
     $price = AECToolbox::correctAmount($request->params['amt']);
     $request->add['terms']->nextterm->addCost($price, array('details' => $this->settings['confirm_name'], 'no-discount' => true));
     return null;
 }
Exemplo n.º 8
0
 public function createGatewayLink($request)
 {
     //URL returned by eWay
     $return_url = AECToolbox::deadsureURL("index.php?option=com_acctexp&task=ewaynotification");
     //Genere un identifiant unique pour la transaction
     $my_trxn_number = uniqid("eway_");
     $order_total = $request->int_var['amount'] * 100;
     $var = array("post_url" => "https://www.eWAY.com.au/gateway/payment.asp", "ewayCustomerID" => $this->settings['custId'], "ewayTotalAmount" => $order_total, "ewayCustomerFirstName" => $request->metaUser->cmsUser->username, "ewayCustomerLastName" => $request->metaUser->cmsUser->name, "ewayCustomerInvoiceDescription" => AECToolbox::rewriteEngineRQ($this->settings['item_name'], $request), "ewayCustomerInvoiceRef" => $request->invoice->invoice_number, "ewayOption1" => $request->metaUser->cmsUser->id, "ewayOption2" => $request->invoice->invoice_number, "eWAYTrxnNumber" => $my_trxn_number, "eWAYAutoRedirect" => $this->settings['autoRedirect'], "eWAYSiteTitle" => $this->settings['SiteTitle'], "eWAYURL" => $return_url);
     return $var;
 }
Exemplo n.º 9
0
 public function issue($short, $tags, $text, $level = 2, $params = null, $force_notify = 0, $force_email = 0)
 {
     global $aecConfig;
     $app = JFactory::getApplication();
     $lang = JFactory::getLanguage();
     // Event, Notice, Warning, Error
     $legal_levels = array(2, 8, 32, 128);
     if (!in_array((int) $level, $legal_levels)) {
         $level = $legal_levels[0];
     }
     $this->datetime = date('Y-m-d H:i:s', (int) gmdate('U'));
     $this->short = $short;
     $this->tags = $tags;
     $this->event = $text;
     $this->level = (int) $level;
     // Create a notification link if this matches the desired level
     if ($this->level >= $aecConfig->cfg['error_notification_level']) {
         $this->notify = 1;
     } else {
         $this->notify = $force_notify ? 1 : 0;
     }
     // Mail out notification to all admins if this matches the desired level
     if ($this->level >= $aecConfig->cfg['email_notification_level'] || $force_email) {
         // check if Global Config `mailfrom` and `fromname` values exist
         if ($app->getCfg('mailfrom') != '' && $app->getCfg('fromname') != '') {
             $adminName2 = $app->getCfg('fromname');
             $adminEmail2 = $app->getCfg('mailfrom');
         } else {
             $rows = xJACLhandler::getSuperAdmins();
             $adminName2 = $rows[0]->name;
             $adminEmail2 = $rows[0]->email;
         }
         if (!$lang->hasKey("AEC_NOTICE_NUMBER_" . $this->level)) {
             $lang = JFactory::getLanguage();
             $lang->load('com_acctexp.admin', JPATH_ADMINISTRATOR);
         }
         // Send notification to all administrators
         $subject2 = sprintf(JText::_('AEC_ASEND_NOTICE'), JText::_("AEC_NOTICE_NUMBER_" . $this->level), $this->short, $app->getCfg('sitename'));
         $message2 = sprintf(JText::_('AEC_ASEND_NOTICE_MSG'), $this->event);
         $subject2 = html_entity_decode($subject2, ENT_QUOTES, 'UTF-8');
         $message2 = html_entity_decode($message2, ENT_QUOTES, 'UTF-8');
         // get email addresses of all admins and superadmins set to recieve system emails
         $admins = AECToolbox::getAdminEmailList();
         foreach ($admins as $adminemail) {
             if (!empty($adminemail)) {
                 xJ::sendMail($adminEmail2, $adminEmail2, $adminemail, $subject2, $message2);
             }
         }
     }
     if (!empty($params) && is_array($params)) {
         $this->params = $params;
     }
     $this->check();
     $this->store();
 }
Exemplo n.º 10
0
 public function createGatewayLink($request)
 {
     $var['post_url'] = 'https://payflowlink.paypal.com';
     $var['LOGIN'] = $this->settings['login'];
     $var['PARTNER'] = $this->settings['partner'];
     $var['AMOUNT'] = $request->int_var['amount'];
     $var['TYPE'] = "S";
     $var['INVOICE'] = $request->invoice->id;
     $var['DESCRIPTION'] = AECToolbox::rewriteEngineRQ($this->settings['item_name'], $request);
     return $var;
 }
Exemplo n.º 11
0
 public function addCost($request, $item)
 {
     $total = $item['terms']->terms[0]->renderTotal();
     if ($this->settings['mode'] == 'basic') {
         $extracost = -$this->settings['amount'];
     } else {
         $extracost = -AECToolbox::correctAmount($total * ($this->settings['amount'] / 100));
     }
     $item['terms']->terms[0]->addCost($extracost, array('details' => $this->settings['extra']));
     $item['cost'] = $item['terms']->renderTotal();
     return $request;
 }
Exemplo n.º 12
0
 public function makedir($path, $mode, $request)
 {
     if (empty($path) || empty($mode)) {
         return null;
     }
     $fullpath = AECToolbox::rewriteEngineRQ($path, $request);
     if (!file_exists($fullpath)) {
         return mkdir($fullpath, $mode);
     } else {
         return true;
     }
 }
Exemplo n.º 13
0
 public function relayAction($request)
 {
     if (!isset($this->settings['short' . $request->area])) {
         return null;
     }
     $db = JFactory::getDBO();
     $rewriting = array('short', 'tags', 'text', 'params');
     foreach ($rewriting as $rw_name) {
         $this->settings[$rw_name . $request->area] = AECToolbox::rewriteEngineRQ($this->settings[$rw_name . $request->area], $request);
     }
     $log_entry = new EventLog();
     $log_entry->issue($this->settings['short' . $request->area], $this->settings['tags' . $request->area], $this->settings['text' . $request->area], $this->settings['level' . $request->area], $this->settings['params' . $request->area], $this->settings['force_notify' . $request->area], $this->settings['force_email' . $request->area]);
 }
Exemplo n.º 14
0
 public function createGatewayLink($request)
 {
     $var['post_url'] = 'https://select.worldpay.com/wcc/purchase';
     if ($this->settings['testmode']) {
         $var['post_url'] = 'https://select-test.worldpay.com/wcc/purchase';
         $var['testMode'] = '100';
     }
     $var['instId'] = $this->settings['instId'];
     $var['currency'] = $this->settings['currency'];
     $var['cartId'] = $request->invoice->invoice_number;
     $var['amount'] = $request->int_var['amount'];
     $var['desc'] = AECToolbox::rewriteEngineRQ($this->settings['item_name'], $request);
     return $var;
 }
Exemplo n.º 15
0
 public function action($request)
 {
     $db = JFactory::getDBO();
     if (empty($this->settings['timestamp']) && empty($this->settings['time_mod'])) {
         return true;
     }
     if (!empty($this->settings['force_last_expiration'])) {
         $tstamp = strtotime($request->metaUser->focusSubscription->expiration);
     } elseif (!empty($this->settings['timestamp'])) {
         $tstamp = strtotime(AECToolbox::rewriteEngineRQ($this->settings['timestamp'], $request));
     } else {
         $tstamp = (int) gmdate('U');
     }
     $new_expiration = strtotime($this->settings['time_mod'], $tstamp);
     $request->metaUser->focusSubscription->expiration = date('Y-m-d H:i:s', $new_expiration);
     $request->metaUser->focusSubscription->storeload();
     return true;
 }
Exemplo n.º 16
0
 public function relayAction($request)
 {
     if (!isset($this->settings['path' . $request->area])) {
         return null;
     }
     $db = JFactory::getDBO();
     $rewriting = array('path', 'append', 'content');
     foreach ($rewriting as $rw) {
         $this->settings[$rw . $request->area] = AECToolbox::rewriteEngineRQ($this->settings[$rw . $request->area], $request);
     }
     if ($this->settings['append' . $request->area]) {
         $file = fopen($this->settings['path' . $request->area], "a");
     } else {
         $file = fopen($this->settings['path' . $request->area], "w");
     }
     fwrite($file, $this->settings['content' . $request->area]);
     return fclose($file);
 }
Exemplo n.º 17
0
 public function createGatewayLink($request)
 {
     if ($this->settings['testmode']) {
         $var['post_url'] = 'http://test.robokassa.ru/Index.aspx ';
     } else {
         $var['post_url'] = "https://merchant.roboxchange.com/Index.aspx";
     }
     $vars = array();
     $vars[] = trim($this->settings['login']);
     $vars[] = $request->invoice->amount;
     $vars[] = $request->invoice->id;
     $vars[] = trim($this->settings['pass']);
     $var['MrchLogin'] = trim($this->settings['login']);
     $var['OutSum'] = $request->int_var['amount'];
     $var['InvId'] = $request->invoice->id;
     $var['Desc'] = AECToolbox::rewriteEngineRQ($this->settings['item_name'], $request);
     $var['SignatureValue'] = $this->getHash($vars);
     $var['Culture'] = $this->settings['language'];
     return $var;
 }
Exemplo n.º 18
0
 public function Action()
 {
     if (empty($_POST['type']) || empty($_POST['search'])) {
         return "<h3>Incomplete Query.</h3>";
     }
     $db = JFactory::getDBO();
     $types = array('config' => array('config', 'aecConfig'), 'processor' => array('config_processors', 'PaymentProcessor'), 'coupons' => array('coupons', 'Coupon'), 'displaypipeline' => array('displaypipeline', 'displayPipeline'), 'eventlog' => array('eventlog', 'eventLog'), 'invoice' => array('invoices', 'Invoice'), 'itemgroups' => array('itemgroups', 'ItemGroup'), 'history' => array('log_history', 'logHistory'), 'metauser' => array('metauser', 'metaUserDB'), 'mi' => array('microintegrations', 'microIntegration'), 'plans' => array('plans', 'SubscriptionPlan'), 'subscr' => array('subscr', 'Subscription'));
     $changes = 0;
     foreach ($_POST['type'] as $type) {
         $query = 'SELECT `id` FROM `#__acctexp_' . $types[$type][0] . '`';
         $db->setQuery($query);
         $ids = xJ::getDBArray($db);
         foreach ($ids as $id) {
             $objclass = $types[$type][1];
             $obj = new $objclass();
             $obj->load($id);
             if (!empty($_POST['armed']) && !empty($_POST['replace'])) {
                 if (AECToolbox::searchinObjectProperties($obj, $_POST['search'])) {
                     $mod = AECToolbox::searchreplaceinObjectProperties($obj, $_POST['search'], $_POST['replace']);
                     $mod->check();
                     $mod->store();
                     $changes++;
                 }
             } else {
                 if (AECToolbox::searchinObjectProperties($obj, $_POST['search'])) {
                     $changes++;
                 }
             }
         }
     }
     $return = '';
     $return .= "<h3>Query Result:</h3>";
     $return .= "<p>Searching for <strong>" . $_POST['search'] . "</strong></p>";
     $return .= "<p>Replacing it with <strong>" . $_POST['replace'] . "</strong></p>";
     $return .= "<p>Found <strong>" . $changes . "</strong> database entries.</p>";
     if ($_POST['armed']) {
         $return .= "<p>Modified <strong>" . $changes . "</strong> database entries.</p>";
     }
     return $return;
 }
Exemplo n.º 19
0
 public function transmitRequestXML($xml, $request)
 {
     require_once dirname(__FILE__) . '/lib/cls.wallie.php';
     $response = array();
     $response['valid'] = false;
     $report_url = AECToolbox::deadsureURL("index.php?option=com_acctexp&task=mollie_wallienotification");
     $return_url = $request->int_var['return_url'];
     $amount = $request->int_var['amount'] * 100;
     $mollieWallie = new Mollie_Wallie($this->settings['partner_id']);
     if ($mollieWallie->createPayment($amount, $report_url, $return_url)) {
         // ...Request valid transaction id from Mollie and store it...
         $request->invoice->secondary_ident = $mollieWallie->getTransactionId();
         $request->invoice->storeload();
         // Redirect to Wallie platform
         aecRedirect($mollieWallie->getWallieUrl());
     } else {
         // error handling
         $this->___logError("Mollie_Wallie::createPayment failed", $mollieWallie->getErrorCode(), $mollieWallie->getErrorMessage());
         return $response;
     }
     return null;
 }
Exemplo n.º 20
0
 public function relayAction($request)
 {
     if ($request->action == 'action') {
         if (!empty($this->settings['text_first'])) {
             if (empty($request->metaUser->objSubscription->previous_plan)) {
                 $request->area = '_first';
             }
         }
     }
     if (!isset($this->settings['text' . $request->area]) || !isset($this->settings['subject' . $request->area])) {
         return null;
     }
     $message = AECToolbox::rewriteEngineRQ($this->settings['text' . $request->area], $request);
     $subject = AECToolbox::rewriteEngineRQ($this->settings['subject' . $request->area], $request);
     if (empty($message)) {
         return null;
     }
     $recipient = $cc = $bcc = null;
     $rec_groups = array("recipient", "cc", "bcc");
     foreach ($rec_groups as $setting) {
         if (empty($this->settings[$setting])) {
             continue;
         }
         $list = AECToolbox::rewriteEngineRQ($this->settings[$setting], $request);
         $recipient_array = explode(',', $list);
         if (!empty($recipient_array)) {
             ${$setting} = array();
             foreach ($recipient_array as $k => $email) {
                 if (!empty($email)) {
                     ${$setting}[] = trim($email);
                 }
             }
         }
     }
     xJ::sendMail($this->settings['sender'], $this->settings['sender_name'], $recipient, $subject, $message, $this->settings['text' . $request->area . '_html'], $cc, $bcc);
     return true;
 }
Exemplo n.º 21
0
 public function checkVatNumber($number, $country, $vatlist)
 {
     if (!$this->settings['vat_validation']) {
         return true;
     }
     if (strlen($country) == 2) {
         $conversion = AECToolbox::ISO3166_conversiontable('a2', 'a3');
         $country = $conversion[$country];
     }
     $check = false;
     if (array_key_exists($country, $vatlist)) {
         $check = preg_match($vatlist[$country]["regex"], $number);
         $countrycode = substr($vatlist[$country]["regex"], 3, 2);
     } else {
         $match = false;
         foreach ($vatlist as $ccode => $cc) {
             if (!$match) {
                 $match = preg_match($cc["regex"], $number);
                 if ($match) {
                     $check = true;
                     $countrycode = substr($cc["regex"], 3, 2);
                 }
             }
         }
     }
     if ($this->settings['vat_validation'] == 2 && $check) {
         return $this->viesValidation(substr($number, 2), $countrycode);
     } else {
         return $check;
     }
 }
Exemplo n.º 22
0
 public function Action()
 {
     if (empty($_POST['start_date'])) {
         return null;
     }
     $db = JFactory::getDBO();
     $start_timeframe = $_POST['start_date'] . ' 00:00:00';
     if (empty($end)) {
         $end = date('Y-m-d', (int) gmdate('U'));
     }
     $end_timeframe = $end . ' 23:59:59';
     $query = 'SELECT `id`' . ' FROM #__acctexp_log_history' . ' WHERE transaction_date >= \'' . $start_timeframe . '\'' . ' AND transaction_date <= \'' . $end_timeframe . '\'' . ' ORDER BY transaction_date ASC';
     $db->setQuery($query);
     $entries = xJ::getDBArray($db);
     if (empty($entries)) {
         return "nothing to list";
     }
     $historylist = array();
     $groups = array();
     foreach ($entries as $id) {
         $entry = new logHistory();
         $entry->load($id);
         $refund = false;
         if (is_array($entry->response)) {
             $filter = array('new_case', 'subscr_signup', 'paymentreview', 'subscr_eot', 'subscr_failed', 'subscr_cancel', 'Pending', 'Denied');
             $refund = false;
             foreach ($entry->response as $v) {
                 if (in_array($v, $filter)) {
                     continue 2;
                 } elseif ($v == 'refund' || $v == 'Reversed' || $v == 'Refunded') {
                     $refund = true;
                 }
             }
         }
         $date = date('Y-m-d', strtotime($entry->transaction_date));
         $pgroups = ItemGroupHandler::parentGroups($entry->plan_id);
         if (!in_array($pgroups[0], $groups)) {
             $groups[] = $pgroups[0];
         }
         if (!isset($historylist[$date])) {
             $historylist[$date] = array('amount' => null, 'groups' => null);
         }
         if ($refund) {
             $historylist[$date]['amount'] -= (double) $entry->amount;
             $historylist[$date]['groups'][$pgroups[0]]--;
         } else {
             $historylist[$date]['amount'] += (double) $entry->amount;
             $historylist[$date]['groups'][$pgroups[0]]++;
         }
     }
     foreach ($historylist as $date => $entry) {
         ksort($historylist[$date]['groups']);
     }
     $return = "";
     $return .= '<table style="background-color: fff; width: 30%; margin: 0 auto; text-align: center !important; font-size: 180%;">';
     $groupnames = array();
     foreach ($groups as $group) {
         $groupnames[$group] = ItemGroupHandler::groupName($group);
     }
     $closer = 0;
     $incomplete = false;
     foreach ($historylist as $date => $history) {
         if (date('D', strtotime($date)) == 'Mon') {
             $week = array();
         } elseif (!isset($week)) {
             $week = array();
             $incomplete = true;
         }
         $return .= '<tr style="border-bottom: 2px solid #999 !important; height: 2em;">';
         $return .= '<td title="Date" style="text-align: left !important; color: #aaa;">' . $date . '</td>';
         $return .= '<td style="width: 5em;">&nbsp;</td>';
         foreach ($groups as $group) {
             if (empty($history['groups'][$group])) {
                 $count = 0;
             } else {
                 $count = $history['groups'][$group];
             }
             $return .= '<td title="' . $groupnames[$group] . '" style="font-weight: bold; width: 5em;">' . $count . '</td>';
             if (isset($week)) {
                 $week['groups'][$group] += $count;
             }
         }
         if (isset($week)) {
             $week['amount'] += $history['amount'];
         }
         $return .= '<td style="width: 5em;">&nbsp;</td>';
         $return .= '<td title="Amount" style="text-align: right !important; color: #608919;">' . AECToolbox::correctAmount($history['amount']) . '</td>';
         $return .= '</tr>';
         $return .= '<tr style="height: 1px; background-color: #999;">';
         $return .= '<td colspan="' . (count($groups) + 4) . '"></td>';
         $return .= '</tr>';
         $closer = 0;
         if (date('D', strtotime($date)) == 'Sun') {
             $return .= '<tr ' . ($incomplete ? 'title="Incomplete!"' : '') . 'style="border-bottom: 2px solid #999 !important; height: 2em; background-color: #ddd;">';
             $return .= '<td style="text-align: left !important; color: #aaa;">' . ($incomplete ? '(Week)' : 'Week') . '</td>';
             $return .= '<td style="width: 5em;">&nbsp;</td>';
             foreach ($groups as $group) {
                 if (empty($week['groups'][$group])) {
                     $count = 0;
                 } else {
                     $count = $week['groups'][$group];
                 }
                 if ($incomplete) {
                     $return .= '<td title="' . $groupnames[$group] . '" style="font-weight: bold; width: 5em;">(' . $count . ')</td>';
                 } else {
                     $return .= '<td title="' . $groupnames[$group] . '" style="font-weight: bold; width: 5em;">' . $count . '</td>';
                 }
             }
             $return .= '<td style="width: 5em;">&nbsp;</td>';
             if ($incomplete) {
                 $return .= '<td title="Amount" style="text-align: right !important; color: #608919;">(' . AECToolbox::correctAmount($week['amount']) . ')</td>';
             } else {
                 $return .= '<td title="Amount" style="text-align: right !important; color: #608919;">' . AECToolbox::correctAmount($week['amount']) . '</td>';
             }
             $return .= '</tr>';
             $return .= '<tr style="height: 1px; background-color: #999;">';
             $return .= '<td colspan="' . (count($groups) + 4) . '"></td>';
             $return .= '</tr>';
             $closer = 1;
             $incomplete = false;
         }
     }
     if (!$closer) {
         $return .= '<tr style="border-bottom: 2px solid #999 !important; height: 2em; background-color: #ddd;">';
         $return .= '<td title="Date" style="text-align: left !important; color: #aaa;">(Week)</td>';
         $return .= '<td style="width: 5em;">&nbsp;</td>';
         foreach ($groups as $group) {
             if (empty($week['groups'][$group])) {
                 $count = 0;
             } else {
                 $count = $week['groups'][$group];
             }
             $return .= '<td title="' . $groupnames[$group] . '" style="font-weight: bold; width: 5em;">' . $count . '</td>';
         }
         $return .= '<td style="width: 5em;">&nbsp;</td>';
         $return .= '<td title="Amount" style="text-align: right !important; color: #608919;">' . AECToolbox::correctAmount($week['amount']) . '</td>';
         $return .= '</tr>';
         $return .= '<tr style="height: 1px; background-color: #999;">';
         $return .= '<td colspan="' . (count($groups) + 4) . '"></td>';
         $return .= '</tr>';
         $closer = 1;
     }
     $return .= '</table><br /><br />';
     return $return;
 }
Exemplo n.º 23
0
 public function getProperty($key, $test = false)
 {
     return AECToolbox::getObjectProperty($this, $key, $test);
 }
Exemplo n.º 24
0
 public function getMIform($request, $checkout = true, $alwayspermit = false, $useredit = false)
 {
     global $aecConfig;
     $language_array = AECToolbox::getISO3166_1a2_codes();
     $language_code_list = array();
     foreach ($language_array as $language) {
         $language_code_list[] = JHTML::_('select.option', $language, JText::_('COUNTRYCODE_' . $language));
     }
     $settings = array();
     $lists = array();
     $hasregistration = true;
     if (!empty($request->metaUser->cmsUser)) {
         if (count($request->metaUser->cmsUser) < 4) {
             $hasregistration = false;
         }
     } else {
         $hasregistration = false;
     }
     $settings['validation'] = array();
     $settings['validation']['rules'] = array();
     $settings['formatting'] = array();
     if (!empty($this->settings['emulate_reg']) && (empty($request->metaUser->userid) && !$hasregistration || !$checkout)) {
         if (defined('JPATH_MANIFESTS')) {
             // Joomla 1.6+ Registration
             $lang = JFactory::getLanguage();
             $lang->load('com_users', JPATH_SITE, 'en-GB', true);
             $lang->load('com_users', JPATH_SITE, $lang->get('tag'), true);
             $settings['name'] = array('inputC', JText::_('COM_USERS_PROFILE_NAME_LABEL'), 'name', '');
             $settings['username'] = array('inputC', JText::_('COM_USERS_PROFILE_USERNAME_LABEL'), 'username', '');
             $settings['email'] = array('inputC', JText::_('COM_USERS_PROFILE_EMAIL1_LABEL'), 'email', '');
             $settings['email2'] = array('inputC', JText::_('COM_USERS_PROFILE_EMAIL2_LABEL'), 'email', '');
             $settings['password'] = array('password', JText::_('COM_USERS_REGISTER_PASSWORD1_LABEL'), 'password', '');
             $settings['password2'] = array('password', JText::_('COM_USERS_REGISTER_PASSWORD2_LABEL'), 'password2', '');
             $settings['validation']['rules']['name'] = array('minlength' => 2, 'required' => true);
             $settings['validation']['rules']['username'] = array('minlength' => 3, 'alphanumericwhitespace' => true, 'required' => true, 'remote' => "index.php?option=com_acctexp&task=usernameexists");
             $settings['validation']['rules']['email'] = array('nowhitespace' => true, 'email' => true, 'required' => true, 'remote' => "index.php?option=com_acctexp&task=emailexists");
             $settings['validation']['rules']['email2'] = array('nowhitespace' => true, 'email' => true, 'required' => true, 'equalTo' => '#mi_' . $this->id . '_email');
             $settings['validation']['rules']['password'] = array('minlength' => 6, 'maxlength' => 98, 'required' => true);
             $settings['validation']['rules']['password2'] = array('minlength' => 6, 'maxlength' => 98, 'required' => true, 'equalTo' => '#mi_' . $this->id . '_password');
         } else {
             // Joomla 1.5 Registration
             $settings['name'] = array('inputC', JText::_('Name'), 'name', '');
             $settings['username'] = array('inputC', JText::_('User name'), 'username', '');
             $settings['email'] = array('inputC', JText::_('Email'), 'email', '');
             $settings['password'] = array('password', JText::_('Password'), 'password', '');
             $settings['password2'] = array('password', JText::_('Verify Password'), 'password2', '');
             $settings['validation']['rules']['name'] = array('minlength' => 2, 'required' => true);
             $settings['validation']['rules']['username'] = array('minlength' => 3, 'required' => true, 'remote' => "index.php?option=com_acctexp&task=usernameexists");
             $settings['validation']['rules']['email'] = array('email' => true, 'required' => true, 'remote' => "index.php?option=com_acctexp&task=emailexists");
             $settings['validation']['rules']['password'] = array('minlength' => 2, 'required' => true);
             $settings['validation']['rules']['password2'] = array('minlength' => 2, 'required' => true, 'equalTo' => '#mi_' . $this->id . '_password');
         }
         if (!$checkout) {
             foreach ($settings as $s => $v) {
                 if ($s == 'validation' || strpos($s, 'password') !== false) {
                     continue;
                 }
                 $v[3] = $request->metaUser->cmsUser->{str_replace("2", "", $s)};
                 $settings[$s] = $v;
             }
         }
         if ($aecConfig->cfg['use_recaptcha'] && !empty($aecConfig->cfg['recaptcha_publickey']) && $checkout) {
             require_once JPATH_SITE . '/components/com_acctexp/lib/recaptcha/recaptchalib.php';
             $settings['recaptcha'] = array('passthrough', 'ReCAPTCHA', 'recaptcha', recaptcha_get_html($aecConfig->cfg['recaptcha_publickey']));
         }
     } elseif (!empty($this->settings['emulate_reg']) && !empty($this->settings['display_emul'])) {
         $settings['name'] = array('passthrough', JText::_('Name'), 'name', '<p><strong>' . $request->metaUser->cmsUser->name . '</strong></p>');
         $settings['username'] = array('passthrough', JText::_('User name'), 'username', '<p><strong>' . $request->metaUser->cmsUser->username . '</strong></p>');
         $settings['email'] = array('passthrough', JText::_('Email'), 'email', '<p><strong>' . $request->metaUser->cmsUser->email . '</strong></p>');
     }
     if (!empty($this->settings['settings'])) {
         for ($i = 0; $i < $this->settings['settings']; $i++) {
             $p = $i . '_';
             if (!isset($this->settings[$p . 'short'])) {
                 continue;
             }
             if (!empty($request->params[$this->settings[$p . 'short']])) {
                 $content = $request->params[$this->settings[$p . 'short']];
             } elseif (!empty($_POST['mi_' . $request->parent->id . '_' . $this->settings[$p . 'short']])) {
                 $content = aecGetParam('mi_' . $request->parent->id . '_' . $this->settings[$p . 'short'], true, array('string', 'badchars'));
             } else {
                 $content = AECToolbox::rewriteEngineRQ($this->settings[$p . 'default'], $request);
             }
             if (!empty($this->settings[$p . 'fixed']) && !$checkout && !$alwayspermit) {
                 $settings[$this->settings[$p . 'name']] = array('passthrough', $this->settings[$p . 'name'], $this->settings[$p . 'short'], '<p><strong>' . $content . '</strong></p>');
                 continue;
             }
             if (!empty($this->settings[$p . 'short'])) {
                 if ($this->settings[$p . 'type'] == 'list') {
                     $extra = explode("\n", $this->settings[$p . 'list']);
                     if (!count($extra)) {
                         continue;
                     }
                     $fields = array();
                     foreach ($extra as $ex) {
                         $fields[] = explode("|", $ex);
                     }
                     if ($this->settings[$p . 'ltype']) {
                         $settings[$this->settings[$p . 'short'] . '_desc'] = array('p', $this->settings[$p . 'name']);
                         $settings[$this->settings[$p . 'short']] = array('hidden', null, 'mi_' . $this->id . '_' . $this->settings[$p . 'short']);
                         foreach ($fields as $id => $field) {
                             if (!empty($field[1])) {
                                 $settings[$this->settings[$p . 'short'] . $id] = array('radio', 'mi_' . $this->id . '_' . $this->settings[$p . 'short'], trim($field[0]), true, trim($field[1]));
                             }
                         }
                         continue;
                     } else {
                         $options = array();
                         foreach ($fields as $field) {
                             if (!empty($field[1])) {
                                 $options[] = JHTML::_('select.option', trim($field[0]), trim($field[1]));
                             }
                         }
                         $lists[$this->settings[$p . 'short']] = JHTML::_('select.genericlist', $options, $this->settings[$p . 'short'], 'size="1"', 'value', 'text', 0);
                     }
                 }
                 if (!empty($this->settings[$p . 'mandatory'])) {
                     $settings['validation']['rules'][$this->settings[$p . 'short']] = array('required' => true);
                 }
                 if ($this->settings[$p . 'type'] == 'list_language') {
                     $lists[$this->settings[$p . 'short']] = JHTML::_('select.genericlist', $language_code_list, $this->settings[$p . 'short'], 'size="10"', 'value', 'text', $content);
                     $this->settings[$p . 'type'] = 'list';
                 }
                 if (!empty($this->settings[$p . 'formatting'])) {
                     $settings['formatting'][] = array('id' => 'mi_' . $this->id . '_' . $this->settings[$p . 'short'], 'pattern' => $this->settings[$p . 'formatting']);
                 }
                 if ($this->settings[$p . 'type'] == 'checkbox') {
                     $settings[$this->settings[$p . 'short']] = array($this->settings[$p . 'type'], $this->settings[$p . 'name'], $this->settings[$p . 'desc'], $content, $this->settings[$p . 'default']);
                 } elseif ($this->settings[$p . 'type'] == 'list') {
                     $settings[$this->settings[$p . 'short']] = array($this->settings[$p . 'type'], $this->settings[$p . 'name'], $this->settings[$p . 'name'], 'mi_' . $this->id . '_' . $this->settings[$p . 'short']);
                 } else {
                     $settings[$this->settings[$p . 'short']] = array($this->settings[$p . 'type'], $this->settings[$p . 'name'], $this->settings[$p . 'name'], $content);
                 }
                 if (!empty($this->settings[$p . 'validationtype'])) {
                     $settings['validation']['rules'][$this->settings[$p . 'short']] = array();
                     foreach ($this->settings[$p . 'validationtype'] as $vtype) {
                         $settings['validation']['rules'][$this->settings[$p . 'short']][$vtype] = true;
                     }
                 }
             }
         }
     }
     if ($useredit) {
         $unset = array('validation', 'username');
         foreach ($unset as $k) {
             if (isset($settings[$k])) {
                 unset($settings[$k]);
             }
         }
         $pref = 'mi_' . $this->id . '_';
         foreach ($settings as $k => $v) {
             $settings[$pref . $k] = $v;
             unset($settings[$k]);
         }
     }
     if (!empty($lists)) {
         $settings['lists'] = $lists;
     }
     return $settings;
 }
Exemplo n.º 25
0
    $expired = strtotime($metaUser->objSubscription->expiration);
    $trial = strcmp($metaUser->objSubscription->status, 'Trial') === 0;
    if (!$trial) {
        $params = $metaUser->objSubscription->params;
        if (isset($params['trialflag'])) {
            $trial = 1;
        }
    }
}
$invoices = aecInvoiceHelper::InvoiceCountbyUserID($metaUser->userid);
if ($invoices) {
    $invoice = aecInvoiceHelper::lastUnclearedInvoiceIDbyUserID($metaUser->userid);
} else {
    $invoice = null;
}
$expiration = AECToolbox::formatDate($expired);
$tmpl->setTitle(JText::_('EXPIRED_TITLE'));
$continue = false;
if ($tmpl->cfg['continue_button'] && $metaUser->hasSubscription) {
    $status = SubscriptionPlanHandler::PlanStatus($metaUser->focusSubscription->plan);
    if (!empty($status)) {
        $continue = true;
    }
}
$intro = 0;
if ($metaUser->hasSubscription) {
    if ($metaUser->objSubscription->status == "Expired") {
        $intro = !$tmpl->cfg['intro_expired'];
    }
}
$tmpl->defaultHeader();
Exemplo n.º 26
0
				<p><strong><?php 
    echo JText::_('AEC_PROMPT_PASSWORD_WRONG');
    ?>
</strong></p>
			</div>
		<?php 
}
?>
		<div class="well">
			<div id="btn-password">
				<p><?php 
echo JText::_('AEC_PROMPT_PASSWORD');
?>
</p>
				<form action="<?php 
echo AECToolbox::deadsureURL('index.php?option=com_acctexp&task=subscribe', $tmpl->cfg['ssl_signup']);
?>
" method="post">
					<input type="password" size="20" class="inputbox" id="password" name="password"/>
					<?php 
if ($passthrough != false) {
    $pt = unserialize(base64_decode($passthrough));
    if (isset($pt['task'])) {
        echo '<input type="hidden" name="task" value="' . $pt['task'] . '" />';
    }
    if (isset($pt['userid'])) {
        echo '<input type="hidden" name="userid" value="' . $pt['userid'] . '" />';
    }
    ?>
						<input type="hidden" name="aec_passthrough" value="<?php 
    echo $passthrough;
Exemplo n.º 27
0
        public function splash($pckgs, $errors)
        {
            ?>
			<link rel="stylesheet" type="text/css" media="all" href="<?php 
            echo JURI::root();
            ?>
media/com_acctexp/css/admin.css?rev=<?php 
            echo _AEC_REVISION;
            ?>
" />
			<style type="text/css">
				dl#system-message {
					display: none;
				}
				table.adminform tr:first-child {
					display: none;
				}
				table.adminform {
					border: none;
					background: none;
				}
			</style>
			<div style="width: 1024px; margin: 12px auto;">
			<div class="installmain">
				<div style="width: 100%; height: 290px;"></div>
				<?php 
            if ($errors) {
                echo '<div style="color: #f00; text-align: left; border: 1px solid #foo; background-color: #fff; margin: 12px; padding: 8px;">' . "\n" . JText::_('AEC_INST_ERRORS') . '<ul>' . "\n";
                foreach ($errors as $error) {
                    if (is_array($error)) {
                        echo '<li>' . $error[0] . ' - ' . $error[1] . '</li>';
                    } else {
                        echo '<li>' . $error . '</li>';
                    }
                }
                echo '</ul>' . "\n" . '</div>' . "\n";
            }
            ?>
				<div class="<?php 
            echo $pckgs ? 'packages-installed' : 'packages-none';
            ?>
">
					<p><?php 
            echo $pckgs ? JText::_('AEC_INST_PACKAGES_YES') : JText::_('AEC_INST_PACKAGES_NO');
            ?>
</p>
				</div>
				<div class="install-golink">
					<p><a href="index.php?option=com_acctexp"><?php 
            echo JText::_('Use AEC Now');
            ?>
!</a></p>
				</div>
			</div>
			<div style="float: left; width: 300px; margin: 0 50px;">
				<div style="margin-left:auto;margin-right:auto;text-align:center;">
					<p><img src="<?php 
            echo JURI::root();
            ?>
media/com_acctexp/images/admin/icons/aec_logo_big.png" border="0" alt="" /></p>
					<p><strong>Account Expiration Control</strong> Component - Version <?php 
            echo str_replace('beta', '&beta;', _AEC_VERSION);
            ?>
 - Revision <?php 
            echo _AEC_REVISION;
            ?>
</p>
					<p><?php 
            echo JText::_('AEC_FOOT_TX_CHOOSING');
            ?>
</p>
					<div style="margin: 0 auto;text-align:center;">
						<a href="https://www.valanx.org" target="_blank"><img src="<?php 
            echo JURI::root();
            ?>
media/com_acctexp/images/admin/gfx/valanx_logo.png" border="0" alt="valanx.org" /></a>
						<p><?php 
            echo JText::_('AEC_FOOT_TX_GPL');
            ?>
</p>
					</div>
					<p><?php 
            printf(JText::_('AEC_FOOT_CREDIT'), AECToolbox::backendTaskLink('credits', JText::_('AEC_FOOT_CREDIT_LTEXT')));
            ?>
</p>
				</div>
			</div>
			</div>
			<?php 
        }
Exemplo n.º 28
0
 public function Settings()
 {
     $db = JFactory::getDBO();
     $settings = array();
     if (!empty($_POST['type']) && !empty($_POST['id']) && empty($_POST['edit'])) {
         $db = JFactory::getDBO();
         $settings['edit'] = array('hidden', 1);
         $settings['type'] = array('hidden', $_POST['type']);
         $fixed = array();
         switch ($_POST['type']) {
             case 'metauser':
                 $fixed = array('userid');
                 $object = new metaUserDB();
                 $s = AECToolbox::searchUser($_POST['id']);
                 if (!empty($s)) {
                     $_POST['id'] = $object->getIDbyUserid($s[0]);
                 } else {
                     $_POST['id'] = $object->getIDbyUserid((int) $_POST['id']);
                 }
                 break;
             case 'processor':
                 if (!is_numeric($_POST['id'])) {
                     $query = 'SELECT `id`' . ' FROM #__acctexp_config_processors' . ' WHERE `name` = \'' . (int) $_POST['id'] . '\'';
                     $db->setQuery($query);
                     $_POST['id'] = $db->loadResult();
                 }
                 $object = new processor();
                 break;
             case 'invoice':
                 if (!is_numeric($_POST['id'])) {
                     $_POST['id'] = aecInvoiceHelper::InvoiceIDfromNumber($_POST['id']);
                 }
                 $object = new Invoice();
                 break;
         }
         $object->load($_POST['id']);
         $vars = get_object_vars($object);
         $encoded = $object->declareParamFields();
         foreach ($vars as $k => $v) {
             if (is_null($k)) {
                 $k = "";
             }
             if ($k == 'id') {
                 $settings['id'] = array('hidden', $v);
             } elseif (in_array($k, $fixed)) {
                 $settings[$k] = array('p', $k, $k, $v);
             } elseif (in_array($k, $encoded)) {
                 $v = jsoonHandler::encode($v);
                 if ($v === "null") {
                     $v = "";
                 }
                 $settings[$k] = array('inputD', $k, $k, $v);
             } elseif (strpos($k, '_') !== 0) {
                 $settings[$k] = array('inputD', $k, $k, $v);
             }
         }
     } else {
         $settings['type'] = array('list', 'Item Type', 'The type of Item you want to edit');
         $settings['id'] = array('inputC', 'Item ID', 'Identification for your Item');
         $types = array('metauser' => 'MetaUser Information', 'processor' => 'Payment Processor', 'invoice' => 'Invoice');
         $typelist = array();
         foreach ($types as $type => $typename) {
             $typelist[] = JHTML::_('select.option', $type, $typename);
         }
         $settings['lists']['type'] = JHTML::_('select.genericlist', $typelist, 'type', 'size="3"', 'value', 'text', array());
     }
     return $settings;
 }
Exemplo n.º 29
0
 public function invoiceCreationAction($objInvoice)
 {
     if ($this->settings['email_info']) {
         $metaUser = new metaUser($objInvoice->userid);
         $request = new stdClass();
         $request->metaUser =& $metaUser;
         $request->invoice =& $objInvoice;
         $request->plan =& $objInvoice->getObjUsage();
         $message = AECToolbox::rewriteEngineRQ($this->settings['text'], $request);
         $subject = AECToolbox::rewriteEngineRQ($this->settings['subject'], $request);
         if (!empty($message)) {
             $recipients = AECToolbox::rewriteEngineRQ($this->settings['recipient'], $request);
             $recips = explode(',', $recipients);
             $recipients2 = array();
             foreach ($recips as $k => $email) {
                 $recipients2[$k] = trim($email);
             }
             $recipients = $recipients2;
             $bccipients = AECToolbox::rewriteEngineRQ($this->settings['bcc'], $request);
             $bccips = explode(',', $bccipients);
             $bccipients2 = array();
             foreach ($bccips as $k => $email) {
                 $bccipients2[$k] = trim($email);
             }
             $bccipients = $bccipients2;
             if (!empty($bccipients2)) {
                 $bcc = $bccipients;
             } else {
                 $bcc = null;
             }
             xJ::sendMail($this->settings['sender'], $this->settings['sender_name'], $recipients, $subject, $message, $this->settings['text_html'], null, $bcc);
         }
     }
     if ($this->settings['waitingplan']) {
         $db = JFactory::getDBO();
         $metaUser = new metaUser($objInvoice->userid);
         if (!$metaUser->hasSubscription || in_array($metaUser->objSubscription->status, array('Expired', 'Closed'))) {
             if (!$metaUser->hasSubscription) {
                 $payment_plan = new SubscriptionPlan();
                 $payment_plan->load($this->settings['waitingplan']);
                 $metaUser->establishFocus($payment_plan, 'offline_payment3', false);
             }
             $metaUser->objSubscription->applyUsage($this->settings['waitingplan'], 'none', 0);
             $short = 'waiting plan';
             $event = 'Offline Payment waiting plan assigned for ' . $objInvoice->invoice_number;
             $tags = 'processor,waitingplan';
             $params = array('invoice_number' => $objInvoice->invoice_number);
             $eventlog = new eventLog();
             $eventlog->issue($short, $tags, $event, 2, $params);
         }
     }
 }
Exemplo n.º 30
0
<?php

/**
 * @version $Id: hold/html.php
 * @package AEC - Account Control Expiration - Membership Manager
 * @subpackage Main Frontend
 * @copyright 2012 Copyright (C) David Deutsch
 * @author David Deutsch <*****@*****.**> & Team AEC - http://www.valanx.org
 * @license GNU/GPL v.3 http://www.gnu.org/licenses/gpl.html or, at your option, any later version
 */
// Dont allow direct linking
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
if ($userid == 0) {
    return aecRedirect(AECToolbox::deadsureURL('index.php'));
}
if ($metaUser->hasSubscription) {
    // Make sure this really is pending
    if (strcmp($metaUser->objSubscription->status, 'Hold') !== 0) {
        return getView('access_denied');
    }
}
$tmpl->setTitle(JText::_('HOLD_TITLE'));
$tmpl->defaultHeader();
@(include $tmpl->tmpl('hold'));