/**
  * Saves user extended information.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     if (!$this->_allowAdminEdit($soxId)) {
         return false;
     }
     $aParams = oxConfig::getParameter("editval");
     $oUser = oxNew("oxuser");
     if ($soxId != "-1") {
         $oUser->load($soxId);
     } else {
         $aParams['oxuser__oxid'] = null;
     }
     // checkbox handling
     $aParams['oxuser__oxactive'] = $oUser->oxuser__oxactive->value;
     $blNewsParams = oxConfig::getParameter("editnews");
     if (isset($blNewsParams)) {
         $oNewsSubscription = $oUser->getNewsSubscription();
         $oNewsSubscription->setOptInStatus((int) $blNewsParams);
         $oNewsSubscription->setOptInEmailStatus((int) oxConfig::getParameter("emailfailed"));
     }
     $oUser->assign($aParams);
     $oUser->save();
     // set oxid if inserted
     $this->setEditObjectId($oUser->getId());
 }
 /**
  * Adds this payments to this set
  *
  * @return null
  */
 public function addpaytoset()
 {
     $aChosenSets = $this->_getActionIds('oxpayments.oxid');
     $soxId = oxConfig::getParameter('synchoxid');
     // adding
     if (oxConfig::getParameter('all')) {
         $sPayTable = $this->_getViewName('oxpayments');
         $aChosenSets = $this->_getAll($this->_addFilter("select {$sPayTable}.oxid " . $this->_getQuery()));
     }
     if ($soxId && $soxId != "-1" && is_array($aChosenSets)) {
         $oDb = oxDb::getDb();
         foreach ($aChosenSets as $sChosenSet) {
             // check if we have this entry already in
             $sID = $oDb->GetOne("select oxid from oxobject2payment where oxpaymentid = " . $oDb->quote($sChosenSet) . "  and oxobjectid = " . $oDb->quote($soxId) . " and oxtype = 'oxdelset'");
             if (!isset($sID) || !$sID) {
                 $oObject = oxNew('oxbase');
                 $oObject->init('oxobject2payment');
                 $oObject->oxobject2payment__oxpaymentid = new oxField($sChosenSet);
                 $oObject->oxobject2payment__oxobjectid = new oxField($soxId);
                 $oObject->oxobject2payment__oxtype = new oxField("oxdelset");
                 $oObject->save();
             }
         }
     }
 }
 /**
  * Speichert den Standort mit den jeweiligen Parameter
  * Saves selection list parameters changes.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $this->resetContentCache();
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     if (!isset($aParams['stores__store_active'])) {
         $aParams['stores__store_active'] = 0;
     }
     $oShoplocator = oxNew("shoplocator");
     if (isset($aParams['stores__store_address'])) {
         $address = str_replace(' ', '', $aParams['stores__store_address']) . "+" . $aParams['stores__store_city'] . "+" . $aParams['stores__store_zip'];
         $pc = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . $address . '&sensor=false');
         $output = json_decode($pc);
         $aParams['stores__store_latitude'] = $output->results[0]->geometry->location->lat;
         $aParams['stores__store_logitude'] = $output->results[0]->geometry->location->lng;
     }
     if ($soxId != "-1") {
         $oShoplocator->load($soxId);
     } else {
         $aParams['stores__oxid'] = null;
     }
     //Disable editing for derived articles
     if ($oShoplocator->isDerived()) {
         return;
     }
     $oShoplocator->assign($aParams);
     $oShoplocator->save();
     // set oxid if inserted
     $this->setEditObjectId($oShoplocator->getId());
 }
 /**
  * Non static getter returning str handler. The sense of getStr() and _getStrHandler() is
  * to be possible to call this method statically ( oxStr::getStr() ), yet leaving the
  * possibility to extend it in modules by overriding _getStrHandler() method.
  *
  * @return object
  */
 protected function _getStrHandler()
 {
     if (oxConfig::getInstance()->isUtf() && function_exists('mb_strlen')) {
         return oxNew("oxStrMb");
     }
     return oxNew("oxStrRegular");
 }
 /**
  * Collects article crosselling and attributes information, passes
  * them to Smarty engine and returns name or template file
  * "article_crossselling.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     // crossselling
     $sChosenArtCat = $this->_getCategoryTree("artcattree", oxConfig::getParameter("artcat"));
     // accessoires
     $sChosenArtCat2 = $this->_getCategoryTree("artcattree2", oxConfig::getParameter("artcat2"));
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/article_crossselling.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_crossselling.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/article_accessories.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_accessories.tpl";
     }
     return "article_crossselling.tpl";
 }
/**
 * Smarty plugin
 * -------------------------------------------------------------
 * File: insert.oxid_newbasketitem.php
 * Type: string, html
 * Name: newbasketitem
 * Purpose: Used for tracking in econda, etracker etc.
 * -------------------------------------------------------------
 *
 * @param array  $params  params
 * @param Smarty &$smarty clever simulation of a method
 *
 * @return string
 */
function smarty_insert_oxid_newbasketitem($params, &$smarty)
{
    $myConfig = oxConfig::getInstance();
    $aTypes = array('0' => 'none', '1' => 'message', '2' => 'popup', '3' => 'basket');
    $iType = $myConfig->getConfigParam('iNewBasketItemMessage');
    // If corect type of message is expected
    if ($iType && $params['type'] && $params['type'] != $aTypes[$iType]) {
        return '';
    }
    //name of template file where is stored message text
    $sTemplate = $params['tpl'] ? $params['tpl'] : 'inc_newbasketitem.snippet.tpl';
    //allways render for ajaxstyle popup
    $blRender = $params['ajax'] && $iType == 2;
    //fetching article data
    $oNewItem = oxSession::getVar('_newitem');
    $oBasket = oxSession::getInstance()->getBasket();
    if ($oNewItem) {
        // loading article object here because on some system passing article by session couses problems
        $oNewItem->oArticle = oxNew('oxarticle');
        $oNewItem->oArticle->Load($oNewItem->sId);
        // passing variable to template with unique name
        $smarty->assign('_newitem', $oNewItem);
        // deleting article object data
        oxSession::deleteVar('_newitem');
        $blRender = true;
    }
    // returning generated message content
    if ($blRender) {
        return $smarty->fetch($sTemplate);
    }
}
 /**
  * Sets up navigation for current view
  *
  * @param string $sNode None name
  *
  * @return null
  */
 protected function _setupNavigation($sNode)
 {
     $myAdminNavig = $this->getNavigation();
     $sNode = oxConfig::getParameter("menu");
     // active tab
     $iActTab = oxConfig::getParameter('actedit');
     $iActTab = $iActTab ? $iActTab : $this->_iDefEdit;
     $sActTab = $iActTab ? "&actedit={$iActTab}" : '';
     // list url
     $this->_aViewData['listurl'] = $myAdminNavig->getListUrl($sNode) . $sActTab;
     // edit url
     $sEditUrl = $myAdminNavig->getEditUrl($sNode, $iActTab) . $sActTab;
     if (!getStr()->preg_match("/^http(s)?:\\/\\//", $sEditUrl)) {
         //internal link, adding path
         $sEditUrl = oxUtilsUrl::getInstance()->appendParamSeparator($this->getViewConfig()->getViewConfigParam('selflink')) . $sEditUrl;
     }
     $this->_aViewData['editurl'] = $sEditUrl;
     // tabs
     $this->_aViewData['editnavi'] = $myAdminNavig->getTabs($sNode, $iActTab);
     // active tab
     $this->_aViewData['actlocation'] = $myAdminNavig->getActiveTab($sNode, $iActTab);
     // default tab
     $this->_aViewData['default_edit'] = $myAdminNavig->getActiveTab($sNode, $this->_iDefEdit);
     // passign active tab number
     $this->_aViewData['actedit'] = $iActTab;
     // buttons
     $this->_aViewData['bottom_buttons'] = $myAdminNavig->getBtn($sNode);
 }
 /**
  * Collects article attributes and selection lists, passes them to Smarty engine,
  * returns name of template file "article_attribute.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData["readonly"] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/article_attribute.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_attribute.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/article_selection.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_selection.tpl";
     }
     return "article_attribute.tpl";
 }
 /**
  * Executes parent method parent::render(), creates discount category tree,
  * passes data to Smarty engine and returns name of template file "discount_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     if ($soxId != '-1' && isset($soxId)) {
         // load object
         $oDiscount = oxNew('oxdiscount');
         $oDiscount->load($soxId);
         $this->_aViewData['edit'] = $oDiscount;
         //disabling derived items
         if ($oDiscount->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
         // generating category tree for artikel choose select list
         $this->_getCategoryTree("artcattree", null);
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/discount_articles.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/discount_articles.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/discount_categories.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/discount_categories.tpl";
     }
     return 'discount_articles.tpl';
 }
Beispiel #10
0
 /**
  * Setup routine
  */
 public static function onActivate()
 {
     if (class_exists('oxRegistry')) {
         $myConfig = oxRegistry::getConfig();
     } else {
         $myConfig = oxConfig::getInstance()->getConfig();
     }
     $bIsEE = $myConfig->getEdition() === "EE";
     try {
         $db = oxDb::getDb();
         // create oxjson groups
         if ($bIsEE) {
             $maxRRId = intval($db->getOne("select MAX(OXRRID) from oxgroups"));
             $nextRRId = $maxRRId + 1;
             $sQ = "INSERT IGNORE INTO oxgroups (OXID, OXACTIVE, OXTITLE, OXTITLE_1, OXRRID) VALUES ('oxjsonro', '1', 'OXJSON Read-only', 'OXJSON Read-only', '{$nextRRId}');";
             $db->Execute($sQ);
             $nextRRId++;
             $sQ = "INSERT IGNORE INTO oxgroups (OXID, OXACTIVE, OXTITLE, OXTITLE_1, OXRRID) VALUES ('oxjsonfull', '1', 'OXJSON Full', 'OXJSON Full', '{$nextRRId}');";
             $db->Execute($sQ);
         } else {
             $sQ = "INSERT IGNORE INTO oxgroups (OXID, OXACTIVE, OXTITLE, OXTITLE_1) VALUES ('oxjsonro', '1', 'OXJSON Read-only', 'OXJSON Read-only');";
             $db->Execute($sQ);
             $nextRRId++;
             $sQ = "INSERT IGNORE INTO oxgroups (OXID, OXACTIVE, OXTITLE, OXTITLE_1) VALUES ('oxjsonfull', '1', 'OXJSON Full', 'OXJSON Full');";
             $db->Execute($sQ);
         }
     } catch (Exception $ex) {
         error_log("Error activating module: " . $ex->getMessage());
     }
 }
/**
 * Smarty plugin
 * -------------------------------------------------------------
 * File: insert.oxid_nocache.php
 * Type: string, html
 * Name: oxid_nocache
 * Purpose: Inserts Items not cached
 * -------------------------------------------------------------
 *
 * @param array  $params  params
 * @param Smarty &$smarty clever simulation of a method
 *
 * @return string
 */
function smarty_insert_oxid_nocache($params, &$smarty)
{
    $myConfig = oxConfig::getInstance();
    $smarty->caching = false;
    /* if( isset( $smarty->oxobject->oProduct))
       $smarty->assign_by_ref( "product", $smarty->oxobject->oProduct);*/
    // #1184M - specialchar search
    $sSearchParamForHTML = oxConfig::getParameter("searchparam");
    $sSearchParamForLink = rawurlencode(oxConfig::getParameter("searchparam", true));
    if ($sSearchParamForHTML) {
        $smarty->assign_by_ref("searchparamforhtml", $sSearchParamForHTML);
        $smarty->assign_by_ref("searchparam", $sSearchParamForLink);
    }
    $sSearchCat = oxConfig::getParameter("searchcnid");
    if ($sSearchCat) {
        $smarty->assign_by_ref("searchcnid", rawurldecode($sSearchCat));
    }
    foreach (array_keys($params) as $key) {
        $viewData =& $params[$key];
        $smarty->assign_by_ref($key, $viewData);
    }
    $sOutput = $smarty->fetch($params['tpl']);
    $smarty->caching = false;
    return $sOutput;
}
 /**
  * Executes parent method parent::render()
  * passes data to Smarty engine and returns name of template file "deliveryset_payment.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $odeliveryset = oxNew("oxdeliveryset");
         $odeliveryset->setLanguage($this->_iEditLang);
         $odeliveryset->load($soxId);
         $oOtherLang = $odeliveryset->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $odeliveryset->setLanguage(key($oOtherLang));
             $odeliveryset->load($soxId);
         }
         $this->_aViewData["edit"] = $odeliveryset;
         //Disable editing for derived articles
         if ($odeliveryset->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/deliveryset_payment.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_payment.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/deliveryset_country.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_country.tpl";
     }
     return "deliveryset_payment.tpl";
 }
 /**
  * changes current user password
  *
  * @return null
  */
 public function changePassword()
 {
     $oUser = $this->getUser();
     if (!$oUser) {
         return;
     }
     $sOldPass = oxConfig::getParameter('password_old', true);
     $sNewPass = oxConfig::getParameter('password_new', true);
     $sConfPass = oxConfig::getParameter('password_new_confirm', true);
     if ($oExcp = $oUser->checkPassword($sNewPass, $sConfPass, true)) {
         switch ($oExcp->getMessage()) {
             case 'EXCEPTION_INPUT_EMPTYPASS':
             case 'EXCEPTION_INPUT_PASSTOOSHORT':
                 return oxUtilsView::getInstance()->addErrorToDisplay('ACCOUNT_PASSWORD_ERRPASSWORDTOSHORT', false, true);
             default:
                 return oxUtilsView::getInstance()->addErrorToDisplay('ACCOUNT_PASSWORD_ERRPASSWDONOTMATCH', false, true);
         }
     }
     if (!$sOldPass || !$oUser->isSamePassword($sOldPass)) {
         return oxUtilsView::getInstance()->addErrorToDisplay('ACCOUNT_PASSWORD_ERRINCORRECTCURRENTPASSW', false, true, 'user');
     }
     // testing passed - changing password
     $oUser->setPassword($sNewPass);
     if ($oUser->save()) {
         $this->_blPasswordChanged = true;
     }
 }
 /**
  * Adds active promotion check
  *
  * @param array  $aWhere  SQL condition array
  * @param string $sqlFull SQL query string
  *
  * @return $sQ
  */
 protected function _prepareWhereQuery($aWhere, $sqlFull)
 {
     $sQ = parent::_prepareWhereQuery($aWhere, $sqlFull);
     $sDisplayType = (int) oxConfig::getParameter('displaytype');
     $sTable = getViewName("oxactions");
     //searchong for empty oxfolder fields
     if ($sDisplayType) {
         $sNow = date('Y-m-d H:i:s', oxUtilsDate::getInstance()->getTime());
         switch ($sDisplayType) {
             case 1:
                 // active
                 $sQ .= " and {$sTable}.oxactivefrom < '{$sNow}' and {$sTable}.oxactiveto > '{$sNow}' ";
                 break;
             case 2:
                 // upcoming
                 $sQ .= " and {$sTable}.oxactivefrom > '{$sNow}' ";
                 break;
             case 3:
                 // expired
                 $sQ .= " and {$sTable}.oxactiveto < '{$sNow}' and {$sTable}.oxactiveto != '0000-00-00 00:00:00' ";
                 break;
         }
     }
     return $sQ;
 }
 public function convertToUtf($value)
 {
     if (!oxConfig::getInstance()->isUtf()) {
         $value = utf8_decode($value);
     }
     return $value;
 }
 /**
  * Testing that the right sandbox value is returned.
  */
 public function testGetSandbox()
 {
     $oxConfig = oxConfig::getInstance();
     $sandbox = $oxConfig->getShopConfVar('bzSandbox', $oxConfig->getShopId, oxConfig::OXMODULE_MODULE_PREFIX . 'bz_barzahlen');
     $oView = new bz_barzahlen_payment();
     $this->assertEquals($sandbox, $oView->getSandbox());
 }
 /**
  * Executes parent method parent::render(), creates delivery category tree,
  * passes data to Smarty engine and returns name of template file "delivery_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     $sChosenArtCat2 = oxConfig::getParameter("artcat2");
     if ($soxId != "-1" && isset($soxId)) {
         $sChosenArtCat2 = $this->_getCategoryTree("artcattree", $sChosenArtCat2);
         // load object
         $oDelivery = oxNew("oxdelivery");
         $oDelivery->load($soxId);
         $this->_aViewData["edit"] = $oDelivery;
         //Disable editing for derived articles
         if ($oDelivery->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/delivery_articles.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/delivery_articles.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/delivery_categories.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/delivery_categories.tpl";
     }
     return "delivery_articles.tpl";
 }
 public function send()
 {
     $aParams = oxConfig::getParameter("editval");
     // loads submited values
     $this->_aRegParams = $aParams;
     $blSubscribe = oxConfig::getParameter("subscribeStatus");
     if ($blSubscribe) {
         //subscribe
         $url = SUBSCRIPTION_URL;
         //$this->getConfig()->getConfigParam( 'pbtPommoUrl' );
         $fields = array('Email' => urlencode($aParams['oxuser__oxusername']), 'pommo_signup' => urlencode("true"));
         foreach ($fields as $key => $value) {
             $fields_string .= $key . '=' . $value . '&';
         }
         rtrim($fields_string, '&');
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_POST, count($fields));
         curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         $result = curl_exec($ch);
         curl_close($ch);
     } else {
         //unsubscribe
     }
     //disable Opt-In To avoid OXID Mails
     $this->getConfig()->setConfigParam('blOrderOptInEmail', false);
     return parent::send();
 }
 /**
  * Checks for currency parameter set in URL, session or post
  * variables. If such were found - loads all currencies possible
  * in shop, searches if passed is available (if no - default
  * currency is set the first defined in admin). Then sets currency
  * parameter so session ($myConfig->setActShopCurrency($iCur)),
  * loads basket and forces ir to recalculate (oBasket->blCalcNeeded
  * = true). Finally executes parent::init().
  *
  * @return null
  */
 public function init()
 {
     // Performance
     $myConfig = $this->getConfig();
     if (!$myConfig->getConfigParam('bl_perfLoadCurrency')) {
         //#861C -  show first currency
         $aCurrencies = $myConfig->getCurrencyArray();
         $this->_oActCur = current($aCurrencies);
         return;
     }
     $iCur = oxConfig::getParameter('cur');
     if (isset($iCur)) {
         $aCurrencies = $myConfig->getCurrencyArray();
         if (!isset($aCurrencies[$iCur])) {
             $iCur = 0;
         }
         // set new currency
         $myConfig->setActShopCurrency($iCur);
         // recalc basket
         $oBasket = $this->getSession()->getBasket();
         $oBasket->onUpdate();
     }
     $iActCur = $myConfig->getShopCurrency();
     $this->aCurrencies = $myConfig->getCurrencyArray($iActCur);
     $this->_oActCur = $this->aCurrencies[$iActCur];
     //setting basket currency (M:825)
     if (!isset($oBasket)) {
         $oBasket = $this->getSession()->getBasket();
     }
     $oBasket->setBasketCurrency($this->_oActCur);
     parent::init();
 }
 /**
  * Saves changed shop configuration parameters.
  *
  * @return mixed
  */
 public function save()
 {
     $myConfig = $this->getConfig();
     $sOxId = $this->getEditObjectId();
     // base parameters
     $aConfStrs = oxConfig::getParameter("confstrs");
     $aConfAArs = oxConfig::getParameter("confaarrs");
     $aConfBools = oxConfig::getParameter("confbools");
     // validating language Ids
     if (is_array($aConfAArs['aTsLangIds'])) {
         $blActive = isset($aConfBools["blTsWidget"]) && $aConfBools["blTsWidget"] == "true" ? true : false;
         $sPkg = "OXID_ESALES";
         $aActiveLangs = array();
         foreach ($aConfAArs['aTsLangIds'] as $sLangId => $sId) {
             $aActiveLangs[$sLangId] = false;
             if ($sId) {
                 $sTsUser = $myConfig->getConfigParam('sTsUser');
                 $sTsPass = $myConfig->getConfigParam('sTsPass');
                 // validating and switching on/off
                 $sResult = $this->_validateId($sId, (bool) $blActive, $sTsUser, $sTsPass, $sPkg);
                 // keeping activation state
                 $aActiveLangs[$sLangId] = $sResult == "OK" ? true : false;
                 // error message
                 if ($sResult && $sResult != "OK") {
                     $this->_aViewData["errorsaving"] = "DYN_TRUSTED_RATINGS_ERR_{$sResult}";
                 }
             }
         }
         $myConfig->saveShopConfVar("arr", "aTsActiveLangIds", $aActiveLangs, $sOxId);
     }
     parent::save();
 }
 public function init()
 {
     parent::init();
     if (!oxConfig::getParameter('fnc')) {
         $oViewConf = $this->getViewConfig();
         oxRegistry::get('oxUtils')->redirect($oViewConf->getHomeLink(), false);
     }
 }
 /**
  * Saves service attributes.
  *
  * @return null
  */
 public function save()
 {
     $oShop = oxNew("oxshop");
     if ($oShop->load($this->getEditObjectId())) {
         $oShop->assign(oxConfig::getParameter("editval"));
         $oShop->save();
     }
 }
 /**
  * check for write access for id
  *
  * @param oxBase $oObj  loaded shop object
  * @param array  $aData fields to be written, null for default
  *
  * @throws Exception on now access
  *
  * @return null
  */
 public function checkWriteAccess($oObj, $aData = null)
 {
     return;
     if ($oObj->oxorderarticles__oxordershopid->value != oxConfig::getInstance()->getShopId()) {
         throw new Exception(oxERPBase::$ERROR_USER_NO_RIGHTS);
     }
     parent::checkWriteAccess($oObj, $aData);
 }
 /**
  * Performs cleanup of statistic data for selected period.
  *
  * @return null
  */
 public function cleanup()
 {
     $iTimeFrame = oxConfig::getParameter("timeframe");
     $dNow = time();
     $sDeleteFrom = date("Y-m-d H:i:s", mktime(date("H", $dNow), date("i", $dNow), date("s", $dNow), date("m", $dNow), date("d", $dNow) - $iTimeFrame, date("Y", $dNow)));
     $oDb = oxDb::getDb();
     $oDb->Execute("delete from oxlogs where oxtime < " . $oDb->quote($sDeleteFrom));
 }
 /**
  * log the given message
  *
  * @param string $message
  * @param string $debuginfo
  */
 public function log($message, $debuginfo)
 {
     if (oxConfig::getInstance()->getShopConfVar('PAYMILL_ACTIVATE_LOGGING')) {
         $logging = oxNew('paymill_logging');
         $logging->assign(array('identifier' => oxSession::getInstance()->getVar('paymill_identifier'), 'debug' => $debuginfo, 'message' => $message, 'date' => date('Y-m-d H:i:s', oxUtilsDate::getInstance()->getTime())));
         $logging->save();
     }
 }
 public function getPassword()
 {
     if (!$this->isBackendUser) {
         return parent::getPassword();
     }
     $oConfig = class_exists('oxRegistry') ? \oxRegistry::getConfig() : \oxConfig::getInstance();
     return $oConfig->getConfigParam('sSwFFAdminPassword');
 }
 /**
  * Basic access check for writing data, checks for same shopid, should be overridden if field oxshopid does not exist
  *
  * @param oxBase $oObj  loaded shop object
  * @param array  $aData fields to be written, null for default
  *
  * @throws Exception on now access
  *
  * @return null
  */
 public function checkWriteAccess($oObj, $aData = null)
 {
     return;
     $myConfig = oxConfig::getInstance();
     if (!$myConfig->getConfigParam('blMallUsers')) {
         parent::checkWriteAccess($oObj, $aData);
     }
 }
Beispiel #28
0
 /**
  * Returns a request parameter.
  *
  * @param string $sName         Name of the request parameter.
  * @param mixed  $mDefaultValue Return value if $sName isn't set.
  * @param bool   $blRaw         return raw value.
  *
  * @return mixed
  */
 public function getRequestParam($sName, $mDefaultValue = null, $blRaw = false)
 {
     $mReturnValue = oxConfig::getParameter($sName, $blRaw);
     if ($mReturnValue === null) {
         $mReturnValue = $mDefaultValue;
     }
     return $mReturnValue;
 }
Beispiel #29
0
 protected function _writeHeader($data)
 {
     $sFileName = $this->_getFileName();
     $this->_writeFile($data, $sFileName);
     $sFileUrl = oxConfig::getInstance()->getShopUrl() . 'modules/debugax/tmp/file/' . $sFileName . '.json';
     header('filedebug :' . $sFileUrl);
     return true;
 }
Beispiel #30
0
 /**
  * Returns singleton oxConfig object instance or create new if needed
  *
  * @return oxConfig
  */
 public static function getInstance()
 {
     if (!self::$_instance instanceof oxConfig) {
         //exceptions from here go directly to global exception handler
         //if no init is possible whole application has to die!
         self::$_instance = new oxConfig();
     }
     return self::$_instance;
 }