OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
oxconfig.php
Go to the documentation of this file.
1 <?php
2 
3 //max integer
4 define( 'MAX_64BIT_INTEGER', '18446744073709551615' );
5 
10 class oxConfig extends oxSuperCfg
11 {
12  // this column of params are defined in config.inc.php file,
13  // so for backwards compatibility. names starts without underscore
14 
20  protected $dbHost = null;
21 
27  protected $dbName = null;
28 
34  protected $dbUser = null;
35 
41  protected $dbPwd = null;
42 
48  protected $dbType = null;
49 
55  protected $sShopURL = null;
56 
62  protected $sSSLShopURL = null;
63 
69  protected $sAdminSSLURL = null;
70 
76  protected $sShopDir = null;
77 
83  protected $sCompileDir = null;
84 
99  protected $iDebug = 0;
100 
106  protected $sAdminEmail = null;
107 
113  protected $blSessionUseCookies = null;
114 
124  protected $blNativeImages = true;
125 
131  protected $aMultiShopTables = array( 'oxarticles', 'oxdiscount', 'oxcategories', 'oxattribute',
132  'oxlinks', 'oxvoucherseries', 'oxmanufacturers',
133  'oxnews', 'oxselectlist', 'oxwrapping',
134  'oxdeliveryset', 'oxdelivery', 'oxvendor', 'oxobject2category');
135 
141  private static $_instance = null;
142 
148  private $_oStart = null;
149 
150 
156  protected $_oActShop = null;
157 
165  protected $_aActiveViews = array();
166 
172  protected $_aGlobalParams = array();
173 
179  protected $_aConfigParams = array();
180 
186  protected $_aThemeConfigParams = array();
187 
193  protected $_iLanguageId = null;
194 
200  protected $_iShopId = null;
201 
202 
208  protected $_sOutDir = 'out';
209 
215  protected $_sImageDir = 'img';
216 
222  protected $_sPictureDir = 'pictures';
223 
229  protected $_sMasterPictureDir = 'master';
230 
236  protected $_sTemplateDir = 'tpl';
237 
243  protected $_sResourceDir = 'src';
244 
250  protected $_sModulesDir = 'modules';
251 
257  protected $_blIsSsl = null;
258 
264  protected $_aAbsDynImageDir = array();
265 
271  protected $_oActCurrencyObject = null;
272 
280  protected $_blInit = false;
281 
287  const OXMODULE_THEME_PREFIX = 'theme:';
288 
294  const OXMODULE_MODULE_PREFIX = 'module:';
295 
303  public function getConfigParam( $sName )
304  {
305 
306  if ( defined( 'OXID_PHP_UNIT' ) ) {
307  if ( isset( modConfig::$unitMOD ) && is_object( modConfig::$unitMOD ) ) {
308  $sValue = modConfig::$unitMOD->getModConfigParam( $sName );
309  if ( $sValue !== null ) {
310  return $sValue;
311  }
312  }
313  }
314 
315  $this->init();
316 
317  if ( isset ( $this->_aConfigParams[$sName] ) ) {
318  return $this->_aConfigParams[$sName];
319  }
320 
321  if ( isset( $this->$sName ) ) {
322  return $this->$sName;
323  }
324 
325  }
326 
335  public function setConfigParam( $sName, $sValue )
336  {
337  if ( isset( $this->$sName ) ) {
338  $this->$sName = $sValue;
339  } else {
340  $this->_aConfigParams[$sName] = $sValue;
341  }
342  }
343 
349  protected function _processSeoCall()
350  {
351  // TODO: refactor shop bootstrap and parse url params as soon as possible
352  if (isSearchEngineUrl()) {
353  oxNew('oxSeoDecoder')->processSeoCall();
354  }
355  }
356 
364  public function init()
365  {
366  // Duplicated init protection
367  if ($this->_blInit) {
368  return;
369  }
370  $this->_blInit = true;
371 
372  $this->_loadVarsFromFile();
373 
374  include getShopBasePath().'core/oxconfk.php';
375 
376  // setting ADODB timeout
377  global $ADODB_SESS_LIFE;
378  $ADODB_SESS_LIFE = 1;
379 
380  // some important defaults
381  $this->_setDefaults();
382 
383  try {
384  $sShopID = $this->getShopId();
385  $blConfigLoaded = $this->_loadVarsFromDb( $sShopID );
386 
387  // loading shop config
388  if ( empty($sShopID) || !$blConfigLoaded ) {
389  // if no config values where loaded (some problems with DB), throwing an exception
390  $oEx = oxNew( "oxConnectionException" );
391  $oEx->setMessage( "Unable to load shop config values from database" );
392  throw $oEx;
393  }
394 
395  // loading theme config options
396  $this->_loadVarsFromDb( $sShopID, null, oxConfig::OXMODULE_THEME_PREFIX . $this->getConfigParam('sTheme') );
397 
398  // checking if custom theme (which has defined parent theme) config options should be loaded over parent theme (#3362)
399  if ( $this->getConfigParam('sCustomTheme') ) {
400  $this->_loadVarsFromDb( $sShopID, null, oxConfig::OXMODULE_THEME_PREFIX . $this->getConfigParam('sCustomTheme') );
401  }
402 
403  // loading modules config
404  $this->_loadVarsFromDb( $sShopID, null, oxConfig::OXMODULE_MODULE_PREFIX );
405 
406 
407  $this->_processSeoCall();
408 
409  //starting up the session
410  $this->getSession()->start();
411 
412 
413  // Admin handling
414  $this->setConfigParam( 'blAdmin', isAdmin() );
415 
416  if ( defined('OX_ADMIN_DIR') ) {
417  $this->setConfigParam( 'sAdminDir', OX_ADMIN_DIR );
418  }
419 
420  $this->_loadVarsFromFile();
421 
422  //application initialization
423  $this->_oStart = new oxStart();
424  $this->_oStart->appInit();
425  } catch ( oxConnectionException $oEx ) {
426  return $this->_handleDbConnectionException( $oEx );
427  } catch ( oxCookieException $oEx ) {
428  return $this->_handleCookieException( $oEx );
429  }
430  }
431 
439  public static function getInstance()
440  {
441  return oxRegistry::getConfig();
442  }
443 
449  protected function _loadVarsFromFile()
450  {
451  //config variables from config.inc.php takes priority over the ones loaded from db
452  include getShopBasePath().'/config.inc.php';
453 
454  //adding trailing slashes
455  $oFileUtils = oxRegistry::get("oxUtilsFile");
456  $this->sShopDir = $oFileUtils->normalizeDir($this->sShopDir);
457  $this->sCompileDir = $oFileUtils->normalizeDir($this->sCompileDir);
458  $this->sShopURL = $oFileUtils->normalizeDir($this->sShopURL);
459  $this->sSSLShopURL = $oFileUtils->normalizeDir($this->sSSLShopURL);
460  $this->sAdminSSLURL = $oFileUtils->normalizeDir($this->sAdminSSLURL);
461 
462  $this->_loadCustomConfig();
463  }
464 
470  protected function _setDefaults()
471  {
472 
473  // some important defaults
474  if( !$this->getConfigParam( 'sDefaultLang' ) )
475  $this->setConfigParam( 'sDefaultLang', 0 );
476 
477 
478  $this->setConfigParam( 'sTheme', 'azure' );
479 
480 
481  $blLogChangesInAdmin = $this->getConfigParam( 'blLogChangesInAdmin' );
482  if( !isset( $blLogChangesInAdmin ) )
483  $this->setConfigParam( 'blLogChangesInAdmin', false );
484 
485  $blCheckTemplates = $this->getConfigParam( 'blCheckTemplates' );
486  if( !isset( $blCheckTemplates ) )
487  $this->setConfigParam( 'blCheckTemplates', false );
488 
489  $blAllowArticlesubclass = $this->getConfigParam( 'blAllowArticlesubclass' );
490  if( !isset( $blAllowArticlesubclass ) )
491  $this->setConfigParam( 'blAllowArticlesubclass', false );
492 
493  $iAdminListSize = $this->getConfigParam( 'iAdminListSize' );
494  if( !isset( $iAdminListSize ) )
495  $this->setConfigParam( 'iAdminListSize', 9 );
496 
497  // #1173M for EE - not all pic are deleted
498  $iPicCount = $this->getConfigParam( 'iPicCount' );
499  if ( !isset( $iPicCount ) )
500  $this->setConfigParam( 'iPicCount', 7 );
501 
502  $iZoomPicCount = $this->getConfigParam( 'iZoomPicCount' );
503  if ( !isset( $iZoomPicCount ) )
504  $this->setConfigParam( 'iZoomPicCount', 4 );
505 
506  // ADODB cache life time
507  $iDBCacheLifeTime = $this->getConfigParam( 'iDBCacheLifeTime' );
508  if ( !isset( $iDBCacheLifeTime ) )
509  $this->setConfigParam( 'iDBCacheLifeTime', 3600 ); // 1 hour
510 
511  $sCoreDir = $this->getConfigParam( 'sShopDir' );
512  $this->setConfigParam( 'sCoreDir', $sCoreDir.'/core/' );
513  }
514 
520  protected function _loadCustomConfig()
521  {
522  $sCustConfig = getShopBasePath().'/cust_config.inc.php';
523  if ( is_readable( $sCustConfig ) ) {
524  include $sCustConfig;
525  }
526  }
527 
537  protected function _loadVarsFromDb( $sShopID, $aOnlyVars = null, $sModule = '' )
538  {
539  $oDb = oxDb::getDb();
540 
541  if ( !empty($sModule) ) {
542  $sModuleSql = " oxmodule LIKE " . $oDb->quote($sModule."%");
543  } else {
544  $sModuleSql = " oxmodule='' ";
545  }
546 
547  $sQ = "select oxvarname, oxvartype, ".$this->getDecodeValueQuery()." as oxvarvalue from oxconfig where oxshopid = '$sShopID' and " . $sModuleSql;
548  // dodger, allow loading from some vars only from baseshop
549  if ( $aOnlyVars !== null ) {
550  $blSep = false;
551  $sIn = '';
552  foreach ( $aOnlyVars as $sField ) {
553  if ( $blSep ) {
554  $sIn .= ', ';
555  }
556  $sIn .= '"'.$sField.'"';
557  $blSep = true;
558  }
559  $sQ .= ' and oxvarname in ( '.$sIn.' ) ';
560  }
561  $oRs = $oDb->select( $sQ );
562 
563  if ( $oRs != false && $oRs->recordCount() > 0 ) {
564  while ( !$oRs->EOF ) {
565  $sVarName = $oRs->fields[0];
566  $sVarType = $oRs->fields[1];
567  $sVarVal = $oRs->fields[2];
568 
569  //in sShopURL and sSSLShopURL cases we skip (for admin or when URL values are not set)
570  if ( ( $sVarName == 'sShopURL' || $sVarName == 'sSSLShopURL' ) &&
571  ( !$sVarVal || $this->isAdmin() === true ) ) {
572  $oRs->moveNext();
573  continue;
574  }
575 
576  $this->_setConfVarFromDb($sVarName, $sVarType, $sVarVal);
577 
578  //setting theme options array
579  if ( $sModule != '' ) {
580  $this->_aThemeConfigParams[$sVarName] = $sModule;
581  }
582 
583  $oRs->moveNext();
584  }
585 
586  return true;
587  } else {
588  return false;
589  }
590  }
591 
601  protected function _setConfVarFromDb($sVarName, $sVarType, $sVarVal)
602  {
603  switch ( $sVarType ) {
604  case 'arr':
605  case 'aarr':
606  $this->setConfigParam( $sVarName, unserialize( $sVarVal ) );
607  break;
608  case 'bool':
609  $this->setConfigParam( $sVarName, ( $sVarVal == 'true' || $sVarVal == '1' ) );
610  break;
611  default:
612  $this->setConfigParam( $sVarName, $sVarVal );
613  break;
614  }
615  }
616 
622  public function pageClose()
623  {
624  if ( $this->hasActiveViewsChain() ) {
625  // do not commit session until active views chain exists
626  return;
627  }
628 
629  return $this->_oStart->pageClose();
630  }
631 
644  public static function getParameter( $sName, $blRaw = false )
645  {
646  return oxRegistry::getConfig()->getRequestParameter( $sName, $blRaw );
647  }
648 
660  public function getRequestParameter( $sName, $blRaw = false )
661  {
662  if ( defined( 'OXID_PHP_UNIT' ) ) {
663  if ( isset( modConfig::$unitMOD ) && is_object( modConfig::$unitMOD ) ) {
664  try{
665  $sValue = modConfig::getParameter( $sName, $blRaw );
666 
667  // TODO: remove this after special chars concept implementation
668  $blIsAdmin = modConfig::getInstance()->isAdmin() || modSession::getInstance()->getVariable( "blIsAdmin" );
669  if ( $sValue !== null && !$blIsAdmin && (!$blRaw || is_array($blRaw))) {
670  $this->checkParamSpecialChars( $sValue, $blRaw );
671  }
672 
673  return $sValue;
674  } catch( Exception $e ) {
675  // if exception is thrown, use default
676  }
677  }
678  }
679 
680  $sValue = null;
681 
682  if ( isset( $_POST[$sName] ) ) {
683  $sValue = $_POST[$sName];
684  } elseif ( isset( $_GET[$sName] ) ) {
685  $sValue = $_GET[$sName];
686  }
687 
688  // TODO: remove this after special chars concept implementation
689  $blIsAdmin = $this->isAdmin() && $this->getSession()->getVariable( "blIsAdmin" );
690  if ( $sValue !== null && !$blIsAdmin && (!$blRaw || is_array($blRaw))) {
691  $this->checkParamSpecialChars( $sValue, $blRaw );
692  }
693 
694  return $sValue;
695  }
696 
704  public function getUploadedFile($sParamName)
705  {
706  return $_FILES[$sParamName];
707  }
708 
717  public function setGlobalParameter( $sName, $sValue )
718  {
719  $this->_aGlobalParams[$sName] = $sValue;
720  }
721 
729  public function getGlobalParameter( $sName )
730  {
731  if ( isset( $this->_aGlobalParams[$sName] ) ) {
732  return $this->_aGlobalParams[$sName];
733  } else {
734  return null;
735  }
736  }
737 
749  public static function checkSpecialChars( & $sValue, $aRaw = null )
750  {
751  return oxRegistry::getConfig()->checkParamSpecialChars( $sValue, $aRaw );
752  }
753 
763  public function checkParamSpecialChars( & $sValue, $aRaw = null )
764  {
765  if ( is_object( $sValue ) ) {
766  return $sValue;
767  }
768 
769  if ( is_array( $sValue ) ) {
770  $newValue = array();
771  foreach ( $sValue as $sKey => $sVal ) {
772  $sValidKey = $sKey;
773  if ( !$aRaw || !in_array($sKey, $aRaw) ) {
774  $this->checkParamSpecialChars( $sValidKey );
775  $this->checkParamSpecialChars( $sVal );
776  if ($sValidKey != $sKey) {
777  unset ($sValue[$sKey]);
778  }
779  }
780  $newValue[$sValidKey] = $sVal;
781  }
782  $sValue = $newValue;
783  } elseif ( is_string( $sValue ) ) {
784  $sValue = str_replace( array( '&', '<', '>', '"', "'", chr(0), '\\', "\n", "\r" ),
785  array( '&amp;', '&lt;', '&gt;', '&quot;', '&#039;', '', '&#092;', '&#10;', '&#13;' ),
786  $sValue );
787  }
788  return $sValue;
789  }
790 
796  public function getShopId()
797  {
798  if ( $this->_iShopId !== null )
799  return $this->_iShopId;
800 
801  $this->_iShopId = $this->getBaseShopId();
802 
803 
804  $this->getSession()->setVariable( 'actshop', $this->_iShopId );
805  return $this->_iShopId;
806  }
807 
808 
816  public function setShopId( $sShopId )
817  {
818  $this->getSession()->setVariable( 'actshop', $sShopId );
819  $this->_iShopId = $sShopId;
820  }
821 
822 
823 
831  public function setIsSsl( $blIsSsl = false )
832  {
833  $this->_blIsSsl = $blIsSsl;
834  }
835 
841  protected function _checkSsl()
842  {
843  $myUtilsServer = oxRegistry::get("oxUtilsServer");
844  $aServerVars = $myUtilsServer->getServerVar();
845  $aHttpsServerVar = $myUtilsServer->getServerVar( 'HTTPS' );
846 
847  $this->setIsSsl();
848  if (isset( $aHttpsServerVar ) && ($aHttpsServerVar === 'on' || $aHttpsServerVar === 'ON' || $aHttpsServerVar == '1' )) {
849  // "1&1" hoster provides "1"
850  $this->setIsSsl($this->getConfigParam('sSSLShopURL') || $this->getConfigParam('sMallSSLShopURL')) ;
851  if ($this->isAdmin() && !$this->_blIsSsl) {
852  //#4026
853  $this->setIsSsl( !is_null($this->getConfigParam('sAdminSSLURL')) );
854  }
855  }
856 
857  //additional special handling for profihost customers
858  if ( isset( $aServerVars['HTTP_X_FORWARDED_SERVER'] ) &&
859  ( strpos( $aServerVars['HTTP_X_FORWARDED_SERVER'], 'ssl' ) !== false ||
860  strpos( $aServerVars['HTTP_X_FORWARDED_SERVER'], 'secure-online-shopping.de' ) !== false ) ) {
861  $this->setIsSsl( true );
862  }
863 
864  }
865 
866 
872  public function isSsl()
873  {
874  if ( is_null( $this->_blIsSsl ) ) {
875  $this->_checkSsl();
876  }
877  return $this->_blIsSsl;
878  }
879 
887  public function isCurrentUrl( $sURL )
888  {
889  // Missing protocol, cannot proceed, assuming true.
890  if ( !$sURL || (strpos( $sURL, "http" ) !== 0)) {
891  return true;
892  }
893 
894  return oxRegistry::get("oxUtilsServer")->isCurrentUrl($sURL);
895  }
896 
904  public function isCurrentProtocol( $sURL )
905  {
906  // Missing protocol, cannot proceed, assuming true.
907  if ( !$sURL || (strpos( $sURL, "http" ) !== 0)) {
908  return true;
909  }
910 
911  return (strpos( $sURL, "https:" ) === 0) == $this->isSsl();
912  }
913 
922  public function getShopUrl($iLang = null, $blAdmin = null)
923  {
924  $sUrl = null;
925  $blAdmin = isset($blAdmin) ? $blAdmin : $this->isAdmin();
926 
927  if (!$blAdmin) {
928  $sUrl = $this->getShopUrlByLanguage($iLang);
929  if (!$sUrl) {
930  $sUrl = $this->getMallShopUrl();
931  }
932  }
933 
934  if (!$sUrl) {
935  $sUrl = $this->getConfigParam('sShopURL');
936  }
937 
938  return $sUrl;
939  }
940 
948  public function getSslShopUrl($iLang = null)
949  {
950  $sUrl = null;
951 
952  if(!$sUrl) {
953  $sUrl = $this->getShopUrlByLanguage($iLang, true);
954  }
955 
956  if(!$sUrl) {
957  $sUrl = $this->getMallShopUrl(true);
958  }
959 
960  if(!$sUrl) {
961  $sUrl = $this->getMallShopUrl();
962  }
963 
964  //normal section
965  if (!$sUrl) {
966  $sUrl = $this->getConfigParam('sSSLShopURL');
967  }
968 
969  if (!$sUrl) {
970  $sUrl = $this->getShopUrl($iLang);
971  }
972 
973  return $sUrl;
974  }
975 
981  public function getCoreUtilsUrl()
982  {
983  return $this->getCurrentShopUrl().'core/utils/';
984  }
985 
994  public function getCurrentShopUrl($blAdmin = null)
995  {
996  if ($blAdmin===null) {
997  $blAdmin = $this->isAdmin();
998  }
999  if ($blAdmin) {
1000  if ($this->isSsl()) {
1001 
1002  $sUrl = $this->getConfigParam( 'sAdminSSLURL' );
1003  if ( !$sUrl ) {
1004  return $this->getSslShopUrl() . $this->getConfigParam( 'sAdminDir' ) . '/';
1005  }
1006  return $sUrl;
1007  } else {
1008  return $this->getShopUrl() . $this->getConfigParam( 'sAdminDir' ) . '/';
1009  }
1010  } else {
1011  return $this->isSsl() ? $this->getSslShopUrl() : $this->getShopUrl();
1012  }
1013  }
1014 
1022  public function getShopCurrentUrl( $iLang = null )
1023  {
1024  if ( $this->isSsl() ) {
1025  $sURL = $this->getSSLShopURL( $iLang );
1026  } else {
1027  $sURL = $this->getShopURL( $iLang );
1028  }
1029 
1030  return oxRegistry::get("oxUtilsUrl")->processUrl( $sURL.'index.php', false );
1031  }
1032 
1041  public function getShopHomeUrl( $iLang = null, $blAdmin = null )
1042  {
1043  return oxRegistry::get("oxUtilsUrl")->processUrl($this->getShopUrl( $iLang, $blAdmin).'index.php', false );
1044  }
1045 
1054  public function getWidgetUrl( $iLang = null, $blAdmin = null )
1055  {
1056  $sUrl = $this->isSsl() ? $this->getSslShopUrl($iLang) : $this->getShopUrl($iLang, $blAdmin);
1057 
1058  return oxRegistry::get('oxUtilsUrl')->processUrl($sUrl.'widget.php', false);
1059  }
1060 
1066  public function getShopSecureHomeUrl()
1067  {
1068  return oxRegistry::get("oxUtilsUrl")->processUrl( $this->getSslShopUrl().'index.php', false );
1069  }
1070 
1076  public function getShopCurrency()
1077  {
1078  $iCurr = null;
1079  if ( ( null === ( $iCurr = $this->getRequestParameter( 'cur' ) ) ) ) {
1080  if ( null === ( $iCurr = $this->getRequestParameter( 'currency' ) ) ) {
1081  $iCurr = $this->getSession()->getVariable( 'currency' );
1082  }
1083  }
1084  return (int) $iCurr;
1085  }
1086 
1092  public function getActShopCurrencyObject()
1093  {
1094  //caching currency as it does not change through the script
1095  //but not for unit tests as ther it changes always
1096  if ( !defined( 'OXID_PHP_UNIT' ) ) {
1097  if (!is_null($this->_oActCurrencyObject)) {
1099  }
1100  }
1101 
1102  $iCur = $this->getShopCurrency();
1103  $aCurrencies = $this->getCurrencyArray();
1104  if ( !isset( $aCurrencies[$iCur] ) ) {
1105  return $this->_oActCurrencyObject = reset( $aCurrencies ); // reset() returns the first element
1106  }
1107 
1108  return $this->_oActCurrencyObject = $aCurrencies[$iCur];
1109  }
1110 
1118  public function setActShopCurrency( $iCur )
1119  {
1120  $aCurrencies = $this->getCurrencyArray();
1121  if ( isset( $aCurrencies[$iCur] ) ) {
1122  $this->getSession()->setVariable( 'currency', $iCur );
1123  $this->_oActCurrencyObject = null;
1124  }
1125  }
1126 
1134  public function getOutDir( $blAbsolute = true)
1135  {
1136  if ($blAbsolute) {
1137  return $this->getConfigParam('sShopDir').$this->_sOutDir.'/';
1138  } else {
1139  return $this->_sOutDir.'/';
1140  }
1141  }
1142 
1150  public function getViewsDir( $blAbsolute = true )
1151  {
1152  if ($blAbsolute) {
1153  return $this->getConfigParam('sShopDir'). 'application/views/';
1154  } else {
1155  return 'application/views/';
1156  }
1157  }
1158 
1168  public function getTranslationsDir( $sFile, $sDir, $blAbsolute = true )
1169  {
1170  $sPath = $blAbsolute ? $this->getConfigParam( 'sShopDir' ) : '';
1171  $sPath .= 'application/translations/';
1172  if ( is_readable( $sPath. $sDir. '/'. $sFile ) ) {
1173  return $sPath. $sDir. '/'. $sFile;
1174  }
1175  return false;
1176  }
1177 
1185  public function getAppDir( $blAbsolute = true )
1186  {
1187  if ($blAbsolute) {
1188  return $this->getConfigParam('sShopDir'). 'application/';
1189  } else {
1190  return 'application/';
1191  }
1192  }
1193 
1203  public function getOutUrl( $blSSL = null , $blAdmin = null, $blNativeImg = false )
1204  {
1205  $blSSL = is_null($blSSL)?$this->isSsl():$blSSL;
1206  $blAdmin = is_null($blAdmin)?$this->isAdmin():$blAdmin;
1207 
1208  if ( $blSSL ) {
1209  if ($blNativeImg && !$blAdmin) {
1210  $sUrl = $this->getSslShopUrl();
1211  } else {
1212  $sUrl = $this->getConfigParam('sSSLShopURL');
1213  if (!$sUrl && $blAdmin) {
1214  $sUrl = $this->getConfigParam('sAdminSSLURL').'../';
1215  }
1216  }
1217  } else {
1218  $sUrl = ($blNativeImg && !$blAdmin )?$this->getShopUrl():$this->getConfigParam( 'sShopURL' );
1219  }
1220 
1221  return $sUrl.$this->_sOutDir.'/';
1222  }
1223 
1238  public function getDir($sFile, $sDir, $blAdmin, $iLang = null, $iShop = null, $sTheme = null, $blAbsolute = true, $blIgnoreCust = false )
1239  {
1240  if ( is_null($sTheme) ) {
1241  $sTheme = $this->getConfigParam( 'sTheme' );
1242  }
1243 
1244  if ( $blAdmin ) {
1245  $sTheme = 'admin';
1246  }
1247 
1248  if ( $sDir != $this->_sTemplateDir ) {
1249  $sBase = $this->getOutDir( $blAbsolute );
1250  $sAbsBase = $this->getOutDir();
1251  } else {
1252  $sBase = $this->getViewsDir( $blAbsolute );
1253  $sAbsBase = $this->getViewsDir();
1254  }
1255 
1256  $sLang = '-';
1257  // FALSE means skip language folder check
1258  if ( $iLang !== false ) {
1259  $oLang = oxRegistry::getLang();
1260 
1261  if ( is_null( $iLang ) ) {
1262  $iLang = $oLang->getEditLanguage();
1263  }
1264 
1265  $sLang = $oLang->getLanguageAbbr( $iLang );
1266  }
1267 
1268  if ( is_null($iShop) ) {
1269  $iShop = $this->getShopId();
1270  }
1271 
1272  //Load from
1273  $sPath = "{$sTheme}/{$iShop}/{$sLang}/{$sDir}/{$sFile}";
1274  $sCacheKey = $sPath . "_{$blIgnoreCust}{$blAbsolute}";
1275 
1276  if ( ( $sReturn = oxRegistry::getUtils()->fromStaticCache( $sCacheKey ) ) !== null ) {
1277  return $sReturn;
1278  }
1279 
1280  $sReturn = false;
1281 
1282  // Check for custom template
1283  $sCustomTheme = $this->getConfigParam( 'sCustomTheme' );
1284  if ( !$blAdmin && !$blIgnoreCust && $sCustomTheme && $sCustomTheme != $sTheme) {
1285  $sReturn = $this->getDir( $sFile, $sDir, $blAdmin, $iLang, $iShop, $sCustomTheme, $blAbsolute );
1286  }
1287 
1288  //test lang level ..
1289  if ( !$sReturn && !$blAdmin && is_readable( $sAbsBase.$sPath ) ) {
1290  $sReturn = $sBase . $sPath;
1291  }
1292 
1293  //test shop level ..
1294  $sPath = "$sTheme/$iShop/$sDir/$sFile";
1295  if ( !$sReturn && !$blAdmin && is_readable( $sAbsBase.$sPath ) ) {
1296  $sReturn = $sBase . $sPath;
1297  }
1298 
1299 
1300  //test theme language level ..
1301  $sPath = "$sTheme/$sLang/$sDir/$sFile";
1302  if ( !$sReturn && $iLang !== false && is_readable( $sAbsBase.$sPath ) ) {
1303  $sReturn = $sBase . $sPath;
1304  }
1305 
1306  //test theme level ..
1307  $sPath = "$sTheme/$sDir/$sFile";
1308  if ( !$sReturn && is_readable( $sAbsBase.$sPath ) ) {
1309  $sReturn = $sBase . $sPath;
1310  }
1311 
1312  //test out language level ..
1313  $sPath = "$sLang/$sDir/$sFile";
1314  if ( !$sReturn && $iLang !== false && is_readable( $sAbsBase.$sPath ) ) {
1315  $sReturn = $sBase . $sPath;
1316  }
1317 
1318  //test out level ..
1319  $sPath = "$sDir/$sFile";
1320  if ( !$sReturn && is_readable( $sAbsBase.$sPath ) ) {
1321  $sReturn = $sBase . $sPath;
1322  }
1323 
1324  if ( !$sReturn ) {
1325  // TODO: implement logic to log missing paths
1326  }
1327 
1328  // to cache
1329  oxRegistry::getUtils()->toStaticCache( $sCacheKey, $sReturn );
1330 
1331  return $sReturn;
1332  }
1333 
1348  public function getUrl($sFile, $sDir , $blAdmin = null, $blSSL = null, $blNativeImg = false, $iLang = null , $iShop = null , $sTheme = null )
1349  {
1350  $sUrl = str_replace(
1351  $this->getOutDir(),
1352  $this->getOutUrl($blSSL, $blAdmin, $blNativeImg),
1353  $this->getDir( $sFile, $sDir, $blAdmin, $iLang, $iShop, $sTheme )
1354  );
1355 
1356  return $sUrl;
1357  }
1358 
1367  public function getImagePath( $sFile, $blAdmin = false )
1368  {
1369  return $this->getDir( $sFile, $this->_sImageDir, $blAdmin );
1370  }
1371 
1382  public function getImageUrl( $blAdmin = false, $blSSL = null, $blNativeImg = null, $sFile = null )
1383  {
1384  $blNativeImg = is_null($blNativeImg)?$this->getConfigParam( 'blNativeImages' ):$blNativeImg;
1385  return $this->getUrl( $sFile, $this->_sImageDir, $blAdmin, $blSSL, $blNativeImg );
1386  }
1387 
1395  public function getImageDir( $blAdmin = false )
1396  {
1397  return $this->getDir( null, $this->_sImageDir, $blAdmin );
1398  }
1399 
1411  public function getPicturePath($sFile, $blAdmin = false, $iLang = null , $iShop = null , $sTheme = null)
1412  {
1413  return $this->getDir( $sFile, $this->_sPictureDir, $blAdmin, $iLang, $iShop, $sTheme );
1414  }
1415 
1423  public function getMasterPictureDir( $blAdmin = false )
1424  {
1425  return $this->getDir( null, $this->_sPictureDir . "/" . $this->_sMasterPictureDir, $blAdmin );
1426  }
1427 
1436  public function getMasterPicturePath( $sFile, $blAdmin = false )
1437  {
1438  return $this->getDir( $sFile, $this->_sPictureDir . "/" . $this->_sMasterPictureDir, $blAdmin );
1439  }
1440 
1453  public function getPictureUrl( $sFile, $blAdmin = false, $blSSL = null, $iLang = null, $iShopId = null, $sDefPic = "master/nopic.jpg" )
1454  {
1455  if ( $sAltUrl = oxRegistry::get("oxPictureHandler")->getAltImageUrl('/', $sFile, $blSSL) ) {
1456  return $sAltUrl;
1457  }
1458 
1459  $blNativeImg = $this->getConfigParam( 'blNativeImages' );
1460  $sUrl = $this->getUrl( $sFile, $this->_sPictureDir, $blAdmin, $blSSL, $blNativeImg, $iLang, $iShopId );
1461 
1462  //anything is better than empty name, because <img src=""> calls shop once more = x2 SLOW.
1463  if ( !$sUrl && $sDefPic ) {
1464  $sUrl = $this->getUrl( $sDefPic, $this->_sPictureDir, $blAdmin, $blSSL, $blNativeImg, $iLang, $iShopId );
1465  }
1466  return $sUrl;
1467  }
1468 
1476  public function getPictureDir( $blAdmin )
1477  {
1478  return $this->getDir( null, $this->_sPictureDir, $blAdmin );
1479  }
1480 
1489  public function getTemplatePath( $sFile, $blAdmin )
1490  {
1491  $sTemplatePath = $this->getDir( $sFile, $this->_sTemplateDir, $blAdmin );
1492 
1493  if (!$sTemplatePath) {
1494  $sBasePath = getShopBasePath();
1495  $aModuleTemplates = $this->getConfigParam('aModuleTemplates');
1496 
1497  $oModulelist = oxNew('oxmodulelist');
1498  $aActiveModuleInfo = $oModulelist->getActiveModuleInfo();
1499  if (is_array($aModuleTemplates) && is_array($aActiveModuleInfo)) {
1500  foreach ($aModuleTemplates as $sModuleId => $aTemplates) {
1501  if (isset($aTemplates[$sFile]) && isset($aActiveModuleInfo[$sModuleId])) {
1502  $sPath = $aTemplates[$sFile];
1503  $sPath = $sBasePath. 'modules/'. $sPath;
1504  if (is_file($sPath) && is_readable($sPath)) {
1505  $sTemplatePath = $sPath;
1506  }
1507  }
1508  }
1509  }
1510  }
1511 
1512  return $sTemplatePath;
1513  }
1514 
1522  public function getTemplateDir( $blAdmin = false )
1523  {
1524  return $this->getDir( null, $this->_sTemplateDir, $blAdmin );
1525  }
1526 
1537  public function getTemplateUrl( $sFile = null, $blAdmin = false, $blSSL = null , $iLang = null )
1538  {
1539  return $this->getShopMainUrl() . $this->getDir( $sFile, $this->_sTemplateDir, $blAdmin, $iLang, null, null, false );
1540  }
1541 
1549  public function getTemplateBase( $blAdmin = false )
1550  {
1551  // Base template dir is the parent dir of template dir
1552  return str_replace( $this->_sTemplateDir.'/', '', $this->getDir( null, $this->_sTemplateDir, $blAdmin, null, null, null, false ));
1553  }
1554 
1563  public function getResourcePath($sFile = '', $blAdmin = false )
1564  {
1565  return $this->getDir( $sFile, $this->_sResourceDir, $blAdmin );
1566  }
1567 
1575  public function getModulesDir( $blAbsolute = true )
1576  {
1577  if ($blAbsolute) {
1578  return $this->getConfigParam('sShopDir') . $this->_sModulesDir . '/';
1579  } else {
1580  return $this->_sModulesDir . '/';
1581  }
1582  }
1583 
1594  public function getResourceUrl( $sFile = '', $blAdmin = false , $blSSL = null , $iLang = null )
1595  {
1596  $blNativeImg = $this->getConfigParam( 'blNativeImages' );
1597  return $this->getUrl( $sFile, $this->_sResourceDir, $blAdmin, $blSSL, $blNativeImg, $iLang );
1598  }
1599 
1607  public function getResourceDir( $blAdmin )
1608  {
1609  return $this->getDir( null, $this->_sResourceDir, $blAdmin );
1610  }
1611 
1619  public function getCurrencyArray( $iCurrency = null )
1620  {
1621  $aConfCurrencies = $this->getConfigParam( 'aCurrencies' );
1622  if ( !is_array( $aConfCurrencies ) ) {
1623  return array();
1624  }
1625 
1626  if ( defined( 'OXID_PHP_UNIT' ) ) {
1627  if ( isset( modConfig::$unitMOD ) && is_object( modConfig::$unitMOD ) ) {
1628  try{
1629  $aAltCurrencies = modConfig::getInstance()->getConfigParam( 'modaCurrencies' );
1630  if ( isset( $aAltCurrencies ) ) {
1631  $aConfCurrencies = $aAltCurrencies;
1632  }
1633  } catch( Exception $e ) {
1634  // if exception is thrown, use default
1635  }
1636  }
1637  }
1638 
1639  // processing currency configuration data
1640  $aCurrencies = array();
1641  reset( $aConfCurrencies );
1642  while ( list( $key, $val ) = each( $aConfCurrencies ) ) {
1643  if ( $val ) {
1644  $oCur = new stdClass();
1645  $oCur->id = $key;
1646  $sCur = explode( '@', $val);
1647  $oCur->name = trim( $sCur[0] );
1648  $oCur->rate = trim( $sCur[1] );
1649  $oCur->dec = trim( $sCur[2] );
1650  $oCur->thousand = trim( $sCur[3] );
1651  $oCur->sign = trim( $sCur[4] );
1652  $oCur->decimal = trim( $sCur[5] );
1653 
1654  // change for US version
1655  if ( isset( $sCur[6] ) ) {
1656  $oCur->side = trim($sCur[6]);
1657  }
1658 
1659  if ( isset( $iCurrency) && $key == $iCurrency ) {
1660  $oCur->selected = 1;
1661  } else {
1662  $oCur->selected = 0;
1663  }
1664  $aCurrencies[$key]= $oCur;
1665  }
1666 
1667  // #861C - performance, do not load other currencies
1668  if ( !$this->getConfigParam( 'bl_perfLoadCurrency' ) ) {
1669  break;
1670  }
1671  }
1672  return $aCurrencies;
1673  }
1674 
1682  public function getCurrencyObject( $sName )
1683  {
1684  $aSearch = $this->getCurrencyArray();
1685  foreach ( $aSearch as $oCur ) {
1686  if ( $oCur->name == $sName ) {
1687  return $oCur;
1688  }
1689  }
1690  }
1691 
1697  public function isDemoShop()
1698  {
1699  return $this->getConfigParam('blDemoShop');
1700  }
1701 
1702 
1703 
1709  public function getEdition()
1710  {
1711  return "CE";
1712 
1713 
1714  }
1715 
1721  public function getFullEdition()
1722  {
1723  $sEdition = $this->getEdition();
1724 
1725  if ($sEdition == "CE") {
1726  return "Community Edition";
1727  }
1728 
1729 
1730 
1731  return $sEdition;
1732  }
1733 
1739  public function getVersion()
1740  {
1741  $sVersion = $this->getActiveShop()->oxshops__oxversion->value;
1742  return $sVersion;
1743  }
1744 
1750  public function getRevision()
1751  {
1752  $sFileName = $this->getConfigParam( 'sShopDir' ) . "/pkg.rev";
1753  $sRev = trim(@file_get_contents($sFileName));
1754 
1755  if (!$sRev) {
1756  return false;
1757  }
1758 
1759  return $sRev;
1760  }
1761 
1767  public function getPackageInfo()
1768  {
1769  $sFileName = $this->getConfigParam( 'sShopDir' ) . "/pkg.info";
1770  $sRev = @file_get_contents($sFileName);
1771  $sRev = str_replace("\n", "<br>", $sRev);
1772 
1773  if (!$sRev) {
1774  return false;
1775  }
1776 
1777  return $sRev;
1778  }
1779 
1780 
1786  public function isMall()
1787  {
1788 
1789  return false;
1790  }
1791 
1801  public function detectVersion()
1802  {
1803  }
1804 
1805 
1806 
1819  public function saveShopConfVar( $sVarType, $sVarName, $sVarVal, $sShopId = null, $sModule = '' )
1820  {
1821  switch ( $sVarType ) {
1822  case 'arr':
1823  case 'aarr':
1824  $sValue = serialize( $sVarVal );
1825  break;
1826  case 'bool':
1827  //config param
1828  $sVarVal = (( $sVarVal == 'true' || $sVarVal) && $sVarVal && strcasecmp($sVarVal, "false"));
1829  //db value
1830  $sValue = $sVarVal?"1":"";
1831  break;
1832  case 'num':
1833  //config param
1834  $sVarVal = $sVarVal != ''? oxRegistry::getUtils()->string2Float( $sVarVal ) : '';
1835  $sValue = $sVarVal;
1836  break;
1837  default:
1838  $sValue = $sVarVal;
1839  break;
1840  }
1841 
1842  if ( !$sShopId ) {
1843  $sShopId = $this->getShopId();
1844  }
1845 
1846  // Update value only for current shop
1847  if ($sShopId == $this->getShopId()) {
1848  $this->setConfigParam( $sVarName, $sVarVal );
1849  }
1850 
1851  $oDb = oxDb::getDb();
1852 
1853  $sShopIdQuoted = $oDb->quote($sShopId);
1854  $sModuleQuoted = $oDb->quote($sModule);
1855  $sVarNameQuoted = $oDb->quote($sVarName);
1856  $sVarTypeQuoted = $oDb->quote($sVarType);
1857  $sVarValueQuoted = $oDb->quote($sValue);
1858  $sConfigKeyQuoted = $oDb->quote($this->getConfigParam('sConfigKey'));
1859  $sNewOXIDdQuoted = $oDb->quote(oxUtilsObject::getInstance()->generateUID());
1860 
1861  $sQ = "delete from oxconfig where oxshopid = $sShopIdQuoted and oxvarname = $sVarNameQuoted and oxmodule = $sModuleQuoted";
1862  $oDb->execute( $sQ );
1863 
1864  $sQ = "insert into oxconfig (oxid, oxshopid, oxmodule, oxvarname, oxvartype, oxvarvalue)
1865  values($sNewOXIDdQuoted, $sShopIdQuoted, $sModuleQuoted, $sVarNameQuoted, $sVarTypeQuoted, ENCODE( $sVarValueQuoted, $sConfigKeyQuoted) )";
1866  $oDb->execute( $sQ );
1867 
1868 
1869 
1870  }
1871 
1872 
1882  public function getShopConfVar( $sVarName, $sShopId = null, $sModule = '' )
1883  {
1884  if ( !$sShopId ) {
1885  $sShopId = $this->getShopId();
1886  }
1887 
1888  if ( $sShopId === $this->getShopId() && ( !$sModule || $sModule == oxConfig::OXMODULE_THEME_PREFIX . $this->getConfigParam('sTheme') ) ) {
1889  $sVarValue = $this->getConfigParam( $sVarName );
1890  if ( $sVarValue !== null ) {
1891  return $sVarValue;
1892  }
1893  }
1894 
1896 
1897  $sQ = "select oxvartype, ".$this->getDecodeValueQuery()." as oxvarvalue from oxconfig where oxshopid = '{$sShopId}' and oxmodule = '{$sModule}' and oxvarname = ".$oDb->quote($sVarName);
1898  $oRs = $oDb->select( $sQ );
1899 
1900  $sValue = null;
1901  if ( $oRs != false && $oRs->recordCount() > 0 ) {
1902  $sValue = $this->decodeValue( $oRs->fields['oxvartype'], $oRs->fields['oxvarvalue'] );
1903  }
1904  return $sValue;
1905  }
1906 
1915  public function decodeValue( $sType, $mOrigValue )
1916  {
1917  $sValue = $mOrigValue;
1918  switch ( $sType ) {
1919  case 'arr':
1920  case 'aarr':
1921  $sValue = unserialize( $mOrigValue );
1922  break;
1923  case 'bool':
1924  $sValue = ( $mOrigValue == 'true' || $mOrigValue == '1' );
1925  break;
1926  }
1927 
1928  return $sValue;
1929  }
1930 
1938  public function getDecodeValueQuery( $sFieldName = "oxvarvalue" )
1939  {
1940  return " DECODE( {$sFieldName}, '".$this->getConfigParam( 'sConfigKey' )."') ";
1941  }
1942 
1948  public function isProductiveMode()
1949  {
1950  $blProductive = false;
1951 
1952  $blProductive = $this->getConfigParam( 'blProductive' );
1953  if ( !isset( $blProductive ) ) {
1954  $sQ = 'select oxproductive from oxshops where oxid = "'.$this->getShopId().'"';
1955  $blProductive = ( bool ) oxDb::getDb()->getOne( $sQ );
1956  $this->setConfigParam( 'blProductive', $blProductive );
1957  }
1958 
1959  return $blProductive;
1960  }
1961 
1962 
1963 
1969  public function getBaseShopId()
1970  {
1971 
1972  return 'oxbaseshop';
1973  }
1974 
1980  public function getActiveShop()
1981  {
1982  if ( $this->_oActShop && $this->_iShopId == $this->_oActShop->getId() &&
1983  $this->_oActShop->getLanguage() == oxRegistry::getLang()->getBaseLanguage() ) {
1984  return $this->_oActShop;
1985  }
1986 
1987  $this->_oActShop = oxNew( 'oxshop' );
1988  $this->_oActShop->load( $this->getShopId() );
1989  return $this->_oActShop;
1990  }
1991 
1997  public function getActiveView()
1998  {
1999  if ( count( $this->_aActiveViews ) ) {
2000  $oActView = end( $this->_aActiveViews );
2001  }
2002  if ( $oActView == null ) {
2003  $oActView = oxNew( 'oxubase' );
2004  $this->_aActiveViews[] = $oActView;
2005  }
2006 
2007  return $oActView;
2008  }
2009 
2015  public function getTopActiveView()
2016  {
2017  if ( count( $this->_aActiveViews ) ) {
2018  return reset( $this->_aActiveViews );
2019  } else {
2020  return $this->getActiveView();
2021  }
2022  }
2023 
2029  public function getActiveViewsList()
2030  {
2031  return $this->_aActiveViews;
2032  }
2033 
2041  public function setActiveView( $oView )
2042  {
2043  $this->_aActiveViews[] = $oView;
2044  }
2045 
2051  public function dropLastActiveView()
2052  {
2053  array_pop( $this->_aActiveViews );
2054  }
2055 
2061  public function hasActiveViewsChain()
2062  {
2063  return ( count( $this->_aActiveViews ) > 1 );
2064  }
2065 
2071  public function getActiveViewsNames()
2072  {
2073  $aNames = array();
2074 
2075  if ( is_array( $this->getActiveViewsList() ) ) {
2076  foreach ($this->getActiveViewsList() as $oView ) {
2077  $aNames[] = $oView->getClassName();
2078  }
2079  }
2080 
2081  return $aNames;
2082  }
2083 
2089  public function isUtf()
2090  {
2091  return ( bool ) $this->getConfigParam( 'iUtfMode' );
2092  }
2093 
2099  public function getLogsDir()
2100  {
2101  return $this->getConfigParam( 'sShopDir' ).'log/';
2102  }
2103 
2111  public function isThemeOption( $sName )
2112  {
2113  return (bool) isset( $this->_aThemeConfigParams[$sName] );
2114  }
2115 
2121  public function getShopMainUrl()
2122  {
2123  return $this->_blIsSsl ? $this->getConfigParam( 'sSSLShopURL' ) : $this->getConfigParam( 'sShopURL' );
2124  }
2125 
2131  public function getAllModules()
2132  {
2133  return $this->parseModuleChains($this->getConfigParam('aModules'));
2134  }
2135 
2143  public function parseModuleChains($aModules)
2144  {
2145  $aModuleArray = array();
2146 
2147  if (is_array($aModules)) {
2148  foreach ($aModules as $sClass => $sModuleChain) {
2149  if (strstr($sModuleChain, '&')) {
2150  $aModuleChain = explode('&', $sModuleChain);
2151  } else {
2152  $aModuleChain = array($sModuleChain);
2153  }
2154  $aModuleArray[$sClass] = $aModuleChain;
2155  }
2156  }
2157 
2158  return $aModuleArray;
2159  }
2160 
2166  public function getShopIds()
2167  {
2168  return oxDb::getDb()->getCol( "SELECT `oxid` FROM `oxshops`" );
2169  }
2170 
2180  public function getShopUrlByLanguage($iLang, $blSSL = false)
2181  {
2182  $sLanguageUrl = null;
2183  $sConfigParameter = $blSSL ? 'aLanguageSSLURLs' : 'aLanguageURLs';
2184  $iLang = isset($iLang) ? $iLang : oxRegistry::getLang()->getBaseLanguage();
2185  $aLanguageURLs = $this->getConfigParam($sConfigParameter);
2186  if (isset($iLang) && isset($aLanguageURLs[$iLang]) && !empty($aLanguageURLs[$iLang])) {
2187  $aLanguageURLs[$iLang] = oxRegistry::getUtils()->checkUrlEndingSlash($aLanguageURLs[$iLang]);
2188  $sLanguageUrl = $aLanguageURLs[$iLang];
2189  }
2190 
2191  return $sLanguageUrl;
2192  }
2193 
2201  public function getMallShopUrl($blSSL = false)
2202  {
2203  $sUrl = null;
2204  $sConfigParameter = $blSSL ? 'sMallSSLShopURL' : 'sMallShopURL';
2205  $sMallShopURL = $this->getConfigParam($sConfigParameter);
2206  if ($sMallShopURL) {
2207  $sMallShopURL = oxRegistry::getUtils()->checkUrlEndingSlash($sMallShopURL);
2208  $sUrl = $sMallShopURL;
2209  }
2210 
2211  return $sUrl;
2212  }
2213 
2220  protected function _handleDbConnectionException( $oEx )
2221  {
2222  $oEx->debugOut();
2223  if ( defined( 'OXID_PHP_UNIT' ) ) {
2224  return false;
2225  } elseif ( 0 != $this->iDebug ) {
2226  oxRegistry::getUtils()->showMessageAndExit( $oEx->getString() );
2227  } else {
2228  header( "HTTP/1.1 500 Internal Server Error");
2229  header( "Location: offline.html");
2230  header( "Connection: close");
2231  exit(1);
2232  }
2233  }
2234 
2241  protected function _handleCookieException( $oEx )
2242  {
2243  $this->_processSeoCall();
2244 
2245  //starting up the session
2246  $this->getSession()->start();
2247 
2248  // redirect to start page and display the error
2249  oxRegistry::get("oxUtilsView")->addErrorToDisplay( $oEx );
2250  oxRegistry::getUtils()->redirect( $this->getShopHomeURL() .'cl=start', true, 302 );
2251  }
2252 }