Example #1
0
 public function initTemplate()
 {
     // Set up new template for new installs
     $template = new configTemplate();
     $template->loadDefault();
     if (!empty($template->id)) {
         return;
     }
     $template->name = 'etacarinae';
     $template->default = 1;
     $template->storeload();
 }
Example #2
0
/**
 * @version $Id: upgrade_1_0_0.inc.php
 * @package AEC - Account Control Expiration - Membership Manager
 * @subpackage Install Includes
 * @copyright 2011-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.');
if (isset($aecConfig->cfg['customtext_plans'])) {
    $oldsettings = array('customtext_plans', 'custom_confirm_userdetails', 'customtext_confirm_keeporiginal', 'customtext_confirm', 'customtext_checkout_keeporiginal', 'customtext_checkout', 'customtext_exception_keeporiginal', 'customtext_exception', 'customtext_notallowed_keeporiginal', 'customtext_notallowed', 'customtext_pending_keeporiginal', 'customtext_pending', 'customtext_hold_keeporiginal', 'customtext_hold', 'customtext_expired_keeporiginal', 'customtext_expired', 'customtext_thanks_keeporiginal', 'customtext_thanks', 'customtext_cancel_keeporiginal', 'customtext_cancel', 'confirmation_changeusername', 'confirmation_changeusage', 'invoice_before_header', 'invoice_page_title', 'invoice_header', 'invoice_after_header', 'invoice_address_allow_edit', 'invoice_address', 'invoice_before_content', 'invoice_after_content', 'invoice_before_footer', 'invoice_footer', 'invoice_after_footer', 'customthanks', 'customcancel', 'customnotallowed', ' confirmation_display_descriptions', 'tos', 'tos_iframe', 'customlink_continueshopping', ' renew_button_never', 'renew_button_nolifetimerecurring', 'continue_button', 'use_recaptcha', 'recaptcha_privatekey', 'recaptcha_publickey');
    $copysettings = array();
    foreach ($oldsettings as $k) {
        if (isset($aecConfig->cfg[$k])) {
            $copysettings[$k] = $aecConfig->cfg[$k];
            unset($aecConfig->cfg[$k]);
        } else {
            $copysettings[$k] = "";
        }
    }
    $aecConfig->saveSettings();
    $template = new configTemplate();
    $template->name = 'helix';
    $template->default = 1;
    $template->settings = $copysettings;
    $template->storeload();
}
$eucaInstalldb->dropColifExists('ordering', 'coupons_static');
$eucaInstalldb->dropColifExists('ordering', 'coupons');
$eucaInstalldb->addColifNotExists('restrictions', "text NULL", 'microintegrations');
Example #3
0
/**
 * @param string $view
 */
function getView($view, $args = null)
{
    global $aecConfig;
    $db = JFactory::getDBO();
    $user = JFactory::getUser();
    $metaUser = null;
    if ($user->id) {
        $userid = $user->id;
        $metaUser = new metaUser($user->id);
    } else {
        $userid = aecGetParam('userid', 0, true, array('word', 'int'));
        $metaUser = new metaUser($userid);
    }
    $app = JFactory::getApplication();
    $option = 'com_acctexp';
    $dbtmpl = new configTemplate();
    $dbtmpl->loadDefault();
    $tmpl = $dbtmpl->template;
    if (!empty($dbtmpl->settings)) {
        $tmpl->cfg = array_merge($aecConfig->cfg, $dbtmpl->settings);
    } else {
        $tmpl->cfg = $aecConfig->cfg;
    }
    $tmpl->option = 'com_acctexp';
    $tmpl->metaUser = $metaUser;
    if (strpos(JPATH_BASE, '/administrator')) {
        if (defined('JPATH_MANIFESTS')) {
            $query = 'SELECT `template`' . ' FROM #__template_styles' . ' WHERE `home` = 1 AND `client_id` = 0';
            $db->setQuery($query);
            $tmpl->system_template = $db->loadResult();
        } else {
            $query = 'SELECT `template`' . ' FROM #__templates_menu' . ' WHERE `menu_id` = 0 AND `client_id` = 0';
            $db->setQuery($query);
            $tmpl->system_template = $db->loadResult();
        }
    } else {
        $tmpl->system_template = $app->getTemplate();
    }
    $tmpl->template = $dbtmpl->name;
    $tmpl->view = $view;
    $tmpl->paths['base'] = JPATH_SITE . '/components/com_acctexp/tmpl';
    $tmpl->paths = array('default' => $tmpl->paths['base'] . '/default', 'current' => $tmpl->paths['base'] . '/' . $tmpl->template, 'site' => JPATH_SITE . '/templates/' . $tmpl->system_template . '/html/com_acctexp');
    $hphp = '/' . $view . '/html.php';
    $tphp = '/' . $view . '/tmpl/' . $view . '.php';
    if (!empty($args)) {
        foreach ($args as $n => $v) {
            ${$n} = $v;
        }
    }
    if (file_exists($tmpl->paths['site'] . $hphp)) {
        include $tmpl->paths['site'] . $hphp;
    } elseif (file_exists($tmpl->paths['current'] . $hphp)) {
        include $tmpl->paths['current'] . $hphp;
    } elseif (file_exists($tmpl->paths['default'] . $hphp)) {
        include $tmpl->paths['default'] . $hphp;
    } elseif (file_exists($tmpl->paths['site'] . $tphp)) {
        include $tmpl->paths['site'] . $tphp;
    } elseif (file_exists($tmpl->paths['current'] . $tphp)) {
        include $tmpl->paths['current'] . $tphp;
    } elseif (file_exists($tmpl->paths['default'] . $tphp)) {
        include $tmpl->paths['default'] . $tphp;
    }
    return true;
}
Example #4
0
 public function save($name)
 {
     $temp = new configTemplate();
     $temp->loadName($name);
     if ($_POST['default']) {
         if ($temp->id) {
             if (!$temp->default) {
                 // Reset all other items
                 $this->db->setQuery('UPDATE #__acctexp_config_templates' . ' SET `default` = 0' . ' WHERE `id` > 0');
                 $this->db->query();
             }
         } else {
             // Reset all other items
             $this->db->setQuery('UPDATE #__acctexp_config_templates' . ' SET `default` = 0' . ' WHERE `id` > 0');
             $this->db->query();
         }
         $temp->default = 1;
     } else {
         $temp->default = 0;
     }
     unset($_POST['id']);
     unset($_POST['task']);
     unset($_POST['option']);
     unset($_POST['name']);
     unset($_POST['default']);
     $temp->template->cfg = $temp->settings;
     $temp->settings = $_POST;
     $temp->storeload();
 }
Example #5
0
 public function save($coupon = null)
 {
     global $aecConfig;
     $this->confirmed = 1;
     $this->loadPlanObject();
     $add =& $this;
     $exchange = $silent = null;
     $this->triggerMIs('before_invoice_confirm', $exchange, $add, $silent);
     if (empty($this->userid)) {
         if (!empty($aecConfig->cfg['skip_registration'])) {
             if (!$this->reCaptchaCheck()) {
                 return false;
             }
         }
         $dbtmpl = new configTemplate();
         $dbtmpl->loadDefault();
         if (!empty($dbtmpl->settings['tos'])) {
             $tos = aecGetParam('tos', 0, true, array('bool'));
             if (!$tos) {
                 $this->confirmed = 0;
                 return $this->confirm();
             }
         }
         if (!empty($this->plan)) {
             if (!isset($this->plan->params['override_activation'])) {
                 $this->plan->params['override_activation'] = false;
             }
             if (!isset($this->plan->params['override_regmail'])) {
                 $this->plan->params['override_regmail'] = false;
             }
             $this->userid = aecRegistration::saveUserRegistration($this->passthrough, false, $this->plan->params['override_activation'], $this->plan->params['override_regmail']);
         } else {
             $this->userid = aecRegistration::saveUserRegistration($this->passthrough);
         }
         if (!$this->userid) {
             $errors = JError::getErrors();
             aecErrorAlert(JText::_('COM_USERS_REGISTRATION_SAVE_FAILED'));
         }
     }
     $this->loadMetaUser(true);
     $this->metaUser->setTempAuth();
     if (!empty($this->plan)) {
         if ($this->verifyMIForms($this->plan) === false) {
             $this->confirmed = 0;
             return $this->confirm();
         }
     } elseif (!empty($this->cart)) {
         $check = true;
         foreach ($this->cart as $ci) {
             if ($this->verifyMIForms($ci['obj']) === false) {
                 $check = false;
             }
         }
         if (!$check) {
             $this->confirmed = 0;
             return $this->confirm();
         }
     }
     return $this->checkout(0, null, $coupon);
 }