function synchronizeMedia() { if (!class_exists('Permissions')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php'; } if (!Permissions::getInstance()->check('admin')) { $msg = 'Forget IT'; $this->setRedirect('index.php?option=com_virtuemart', $msg); } if (!class_exists('Migrator')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'migrator.php'; } $migrator = new Migrator(); $result = $migrator->portMedia(); $this->setRedirect(null, $result); }
function portMedia() { $this->checkPermissionForTools(); $this->storeMigrationOptionsInSession(); if (!class_exists('Migrator')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'migrator.php'; } $migrator = new Migrator(); $result = $migrator->portMedia(); $this->setRedirect($this->redirectPath, $result); }
function synchronizeMedia() { if (vmAccess::manager('media')) { $configPaths = array('assets_general_path', 'media_category_path', 'media_product_path', 'media_manufacturer_path', 'media_vendor_path'); foreach ($configPaths as $path) { $this->renameFileExtension(VMPATH_ROOT . DS . VmConfig::get($path)); } if (!class_exists('Migrator')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'migrator.php'; } $migrator = new Migrator(); $result = $migrator->portMedia(); $this->setRedirect($this->redirectPath, $result); } else { $msg = 'Forget IT'; $this->setRedirect('index.php?option=com_virtuemart', $msg); } }
function portMedia() { $data = JRequest::get('get'); JRequest::setVar($data['token'], '1', 'post'); JRequest::checkToken() or jexit('Invalid Token, in ' . JRequest::getWord('task')); $this->checkPermissionForTools(); $this->storeMigrationOptionsInSession(); if (!class_exists('Migrator')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'migrator.php'; } $migrator = new Migrator(); $result = $migrator->portMedia(); $this->setRedirect($this->redirectPath, $result); }
function synchronizeMedia() { $user = JFactory::getUser(); if ($user->authorise('core.admin', 'com_virtuemart') or $user->authorise('core.manage', 'com_virtuemart')) { $configPaths = array('assets_general_path', 'media_category_path', 'media_product_path', 'media_manufacturer_path', 'media_vendor_path'); foreach ($configPaths as $path) { $this->renameFileExtension(JPATH_ROOT . DS . VmConfig::get($path)); } if (!class_exists('Migrator')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'migrator.php'; } $migrator = new Migrator(); $result = $migrator->portMedia(); $this->setRedirect($this->redirectPath, $result); } else { $msg = 'Forget IT'; $this->setRedirect('index.php?option=com_virtuemart', $msg); } }