Пример #1
0
	/**
	 *
	 * Task for disabling dangerous database tools, used after install
	 * @author Max Milbers
	 */
	public function disableDangerousTools(){

		$data = vRequest::getRequest();
		$config = VmModel::getInstance('config', 'VirtueMartModel');
		$config->setDangerousToolsOff();
		$this->display();
	}
Пример #2
0
 /**
  * Install script
  * Triggers after database processing
  *
  * @param object JInstallerComponent parent
  * @return boolean True on success
  */
 public function install($loadVm = true)
 {
     if ($loadVm) {
         $this->loadVm();
     }
     if ($this->checkIfUpdate()) {
         return $this->update($loadVm);
     }
     $_REQUEST['install'] = 1;
     if (!class_exists('JFile')) {
         require JPATH_VM_LIBRARIES . DS . 'joomla' . DS . 'filesystem' . DS . 'file.php';
     }
     if (!class_exists('JFolder')) {
         require JPATH_VM_LIBRARIES . DS . 'joomla' . DS . 'filesystem' . DS . 'folder.php';
     }
     $this->joomlaSessionDBToMediumText();
     // install essential and required data
     // should this be covered in install.sql (or 1.6's JInstaller::parseSchemaUpdates)?
     //			if(!class_exists('VirtueMartModelUpdatesMigration')) require(JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'updatesMigration.php');
     $params = JComponentHelper::getParams('com_languages');
     $lang = $params->get('site', 'en-GB');
     //use default joomla
     $lang = strtolower(strtr($lang, '-', '_'));
     if (!class_exists('VmModel')) {
         require $this->path . DS . 'helpers' . DS . 'vmmodel.php';
     }
     $model = VmModel::getInstance('updatesmigration', 'VirtueMartModel');
     $model->execSQLFile($this->path . DS . 'install' . DS . 'install.sql');
     $model->execSQLFile($this->path . DS . 'install' . DS . 'install_essential_data.sql');
     $model->execSQLFile($this->path . DS . 'install' . DS . 'install_required_data.sql');
     $model->setStoreOwner();
     //copy sampel media
     $src = $this->path . DS . 'assets' . DS . 'images' . DS . 'vmsampleimages';
     // 			if(version_compare(JVERSION,'1.6.0','ge')) {
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'shipment');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'payment');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'category');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'category' . DS . 'resized');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'manufacturer');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'manufacturer' . DS . 'resized');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'product');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'product' . DS . 'resized');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'forSale');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'forSale' . DS . 'invoices');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'forSale' . DS . 'resized');
     $this->createIndexFolder(JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart' . DS . 'typeless');
     $dst = JPATH_ROOT . DS . 'images' . DS . 'stories' . DS . 'virtuemart';
     $this->recurse_copy($src, $dst);
     if (!class_exists('GenericTableUpdater')) {
         require $this->path . DS . 'helpers' . DS . 'tableupdater.php';
     }
     $updater = new GenericTableUpdater();
     $updater->createLanguageTables();
     $this->checkAddDefaultShoppergroups();
     $this->displayFinished(false);
     //include($this->path.DS.'install'.DS.'install.virtuemart.html.php');
     // perhaps a redirect to updatesMigration here rather than the html file?
     //			$parent->getParent()->setRedirectURL('index.php?option=com_virtuemart&view=updatesMigration');
     return true;
 }