Exemplo n.º 1
0
<?php

/**
 * @version $Id: acctexp.class.php
 * @package AEC - Account Control Expiration - Membership Manager
 * @subpackage Core Class
 * @copyright 2006-2015 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.');
define('_AEC_VERSION', '1.2');
define('_AEC_REVISION', '6772');
include_once JPATH_SITE . '/components/com_acctexp/lib/compat.php';
$langlist = array('com_acctexp' => JPATH_SITE, 'com_acctexp.iso3166-1a2' => JPATH_SITE, 'com_acctexp.iso639-1' => JPATH_SITE, 'com_acctexp.microintegrations' => JPATH_SITE, 'com_acctexp.processors' => JPATH_SITE);
xJLanguageHandler::loadList($langlist);
if (!class_exists('paramDBTable')) {
    include_once JPATH_SITE . '/components/com_acctexp/lib/eucalib/eucalib.php';
}
$aecclasses = array('api', 'bucket', 'cart', 'component', 'config', 'coupon', 'displaypipeline', 'event', 'eventlog', 'functions', 'heartbeat', 'history', 'html', 'invoice', 'itemgroup', 'itemterms', 'microintegration', 'paymentprocessor', 'registration', 'restriction', 'rewriteengine', 'service', 'settings', 'subscription', 'subscriptionplan', 'template', 'temptoken', 'toolbox', 'user');
foreach ($aecclasses as $class) {
    include_once dirname(__FILE__) . '/classes/acctexp.' . $class . '.class.php';
}
global $aecConfig;
if (!is_object($aecConfig)) {
    $aecConfig = new aecConfig();
}
 public function copyAssets()
 {
     $handle = str_replace('mi_', '', $this->class_name);
     $syslangpath = JPATH_SITE . '/language';
     $languages = xJLanguageHandler::getSystemLanguages();
     $langpath = JPATH_SITE . '/components/com_acctexp/micro_integration/' . $handle . '/language';
     foreach ($languages as $l) {
         $lpath = $langpath . '/' . $l;
         if (is_dir($lpath) && is_dir($syslangpath . '/' . $l)) {
             $filename = $l . '.com_acctexp.mi.' . $handle . '.ini';
             $source = $lpath . '/' . $filename;
             if (!file_exists($source)) {
                 continue;
             }
             $dest = $syslangpath . '/' . $l . '/' . $filename;
             copy($source, $dest);
         }
     }
 }
Exemplo n.º 3
0
 public function copyAssets()
 {
     $syslangpath = JPATH_SITE . '/language';
     $languages = xJLanguageHandler::getSystemLanguages();
     $langpath = JPATH_SITE . '/components/com_acctexp/services/' . $this->type . '/language';
     foreach ($languages as $l) {
         $lpath = $langpath . '/' . $l;
         if (!is_dir($lpath) || !is_dir($syslangpath . '/' . $l)) {
             continue;
         }
         $filename = $l . '.com_acctexp.services.' . $this->type . '.ini';
         $source = $lpath . '/' . $filename;
         if (!file_exists($source)) {
             continue;
         }
         $dest = $syslangpath . '/' . $l . '/' . $filename;
         copy($source, $dest);
     }
 }
Exemplo n.º 4
0
 public function fileEventlog()
 {
     // Make sure we have all the language stuff loaded
     $langlist = array('com_acctexp.admin' => JPATH_ADMINISTRATOR);
     xJLanguageHandler::loadList($langlist);
     $short = JText::_('AEC_LOG_SH_HEARTBEAT');
     $event = array(JText::_('AEC_LOG_LO_HEARTBEAT') . ' ');
     $tags = array('heartbeat');
     $level = 2;
     if ($this->result['expired']) {
         if ($this->result['expired'] > 1) {
             $event[] = 'Expires ' . $this->result['expired'] . ' subscriptions';
         } else {
             $event[] = 'Expires 1 subscription';
         }
         $tags[] = 'expiration';
     }
     if ($this->result['fallback']) {
         if ($this->result['fallback'] > 1) {
             $event[] = $this->result['fallback'] . ' subscriptions assigned to a fallback subscription plan';
         } else {
             $event[] = '1 subscription assigned to a fallback subscription plan';
         }
         $tags[] = 'fallback';
     }
     if ($this->result['fail_expired']) {
         if ($this->result['fail_expired'] > 1) {
             $event[] = 'Failed to expire ' . $this->result['fail_expired'] . ' subscriptions';
         } else {
             $event[] = 'Failed to expire 1 subscription';
         }
         $event[] = '- please check your subscriptions for problems';
         $tags[] = 'error';
         $level = 128;
     }
     if ($this->result['pre_exp_actions']) {
         $event[] = $this->result['pre_exp_actions'] . ' Pre-expiration action';
         $event[] = $this->result['pre_exp_actions'] > 1 ? 's' : '';
         $event[] = ' for ' . $this->result['pre_expired'] . ' subscription';
         $event[] = $this->result['pre_expired'] > 1 ? 's' : '';
         $tags[] = 'pre-expiration';
     }
     if ($this->result['skipped']) {
         if ($this->result['fail_expired'] > 1) {
             $event[] = 'Skipped ' . $this->result['fail_expired'] . ' subscriptions';
         } else {
             $event[] = 'Skipped 1 subscription';
         }
     }
     if (count($event) === 0) {
         $event[] = JText::_('AEC_LOG_AD_HEARTBEAT_DO_NOTHING');
     }
     $eventlog = new eventLog();
     $eventlog->issue($short, implode(',', $tags), implode(" ", $event), $level);
 }
 public function copyAssets()
 {
     $png = $this->processor_name . '.png';
     $source = $this->path . '/media/images/' . $png;
     if (file_exists($source)) {
         $dest = JPATH_SITE . '/media/com_acctexp/images/site/' . $png;
         if (!file_exists($dest) && file_exists($source)) {
             copy($source, $dest);
         }
     }
     $syslangpath = JPATH_SITE . '/language';
     $languages = xJLanguageHandler::getSystemLanguages();
     $langpath = $this->path . '/language';
     foreach ($languages as $l) {
         $lpath = $langpath . '/' . $l;
         if (is_dir($lpath) && is_dir($syslangpath . '/' . $l)) {
             $filename = $l . '.com_acctexp.processors.' . $this->processor_name . '.ini';
             $source = $lpath . '/' . $filename;
             if (!file_exists($source)) {
                 continue;
             }
             $dest = $syslangpath . '/' . $l . '/' . $filename;
             copy($source, $dest);
         }
     }
 }