示例#1
0
文件: html.php 项目: Ibrahim1/aec
    // Make sure this really is expired
    if (!$metaUser->objSubscription->isExpired()) {
        return getView('access_denied');
    }
    $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") {
示例#2
0
 public function loadLatest($userid, $plan, $subscr = null)
 {
     if (!empty($subscr)) {
         $this->loadbySubscriptionId($subscr, $userid);
     }
     if (empty($this->id)) {
         $this->load(aecInvoiceHelper::lastClearedInvoiceIDbyUserID($userid, $plan));
     }
     if (empty($this->id)) {
         $this->load(aecInvoiceHelper::lastUnclearedInvoiceIDbyUserID($userid, $plan));
     }
 }
示例#3
0
文件: html.php 项目: Ibrahim1/aec
$db = JFactory::getDBO();
// Redirect to SSL if the config requires it
if (!empty($tmpl->cfg['ssl_profile']) && empty($_SERVER['HTTPS']) && empty($tmpl->cfg['override_reqssl'])) {
    aecRedirect(AECToolbox::deadsureURL("index.php?option=" . $option . "&task=subscriptiondetails", true, false));
    exit;
}
// Load metaUser and invoice data
$invoiceno = aecInvoiceHelper::InvoiceCountbyUserID($metaUser->userid);
$properties = array();
$properties['showcheckout'] = false;
// Do not let the user in without a subscription or at least an invoice
if (!$metaUser->hasSubscription && empty($invoiceno)) {
    subscribe($option);
    return;
} elseif (!$metaUser->hasSubscription && !empty($invoiceno)) {
    $properties['showcheckout'] = aecInvoiceHelper::lastUnclearedInvoiceIDbyUserID($metaUser->userid);
}
// Prepare Main Tabs
$tabs = array();
foreach (array('overview', 'invoices') as $fname) {
    $tabs[$fname] = JText::_(strtoupper('aec_subdetails_tab_' . $fname));
}
// If we have a cart, we want to link to it
$cart = aecCartHelper::getCartbyUserid($metaUser->userid);
$properties['hascart'] = $cart->id;
$properties['alert'] = $metaUser->getAlertLevel();
// Load a couple of basic variables
$subscriptions = array();
$pplist = array();
$excludedprocs = array('free', 'error');
$custom = null;
示例#4
0
 static function VerifyMetaUser($metaUser)
 {
     global $aecConfig;
     if (!$aecConfig->cfg['require_subscription']) {
         return true;
     }
     if ($metaUser->hasSubscription) {
         $result = $metaUser->objSubscription->verify($metaUser);
         if ($result == 'expired' || $result == 'pending') {
             $metaUser->setTempAuth();
         }
         return $result;
     }
     if (!empty($aecConfig->cfg['entry_plan'])) {
         $payment_plan = new SubscriptionPlan();
         $payment_plan->load($aecConfig->cfg['entry_plan']);
         $metaUser->establishFocus($payment_plan, 'free', false);
         $metaUser->focusSubscription->applyUsage($payment_plan->id, 'free', 1, 0);
         return AECToolbox::VerifyUser($metaUser->cmsUser->username);
     } else {
         $invoices = aecInvoiceHelper::InvoiceCountbyUserID($metaUser->userid);
         $metaUser->setTempAuth();
         if ($invoices) {
             $invoice = aecInvoiceHelper::lastUnclearedInvoiceIDbyUserID($metaUser->userid);
             if ($invoice) {
                 return 'open_invoice';
             }
         }
         return 'subscribe';
     }
 }