/**
  * Class copied from XenForo_ControllerAdmin_Import
  */
 public function actionImport()
 {
     $importModel = $this->_getImportModel();
     $session = new XenForo_ImportSession();
     if (!$session->getImporterKey()) {
         return $this->responseReroute(__CLASS__, 'index');
     }
     $stepInfo = $session->getStepInfo();
     $importer = $importModel->getImporter($session->getImporterKey());
     $showList = $this->_input->filterSingle('list', XenForo_Input::UINT);
     if (!$stepInfo['step'] || $showList) {
         $runStep = false;
     } else {
         $runStep = $stepInfo['stepStart'] || $this->_request->isPost();
     }
     if ($runStep) {
         $response = $this->_runStep($importer, $session, $stepInfo['step'], $stepInfo['stepStart'], $stepInfo['stepOptions']);
         return $response;
     } else {
         $steps = $importModel->addImportStateToSteps($importer->getSteps(), $session->getRunSteps());
         $viewParams = array('steps' => $steps, 'importerName' => $importer->getName());
         //The template has been changed to allow for a custom message after mapping Wordpress roles to Xenforo Groups
         return $this->responseView('XenForo_ViewAdmin_Import_Steps', 'import_wordpress_steps', $viewParams);
     }
 }
Ejemplo n.º 2
0
 public function actionComplete()
 {
     if ($this->_request->isPost()) {
         $session = new XenForo_ImportSession();
         $key = $session->getImporterKey();
         if (strpos($key, 'sonnb_XenGallery') !== false) {
             $GLOBALS[sonnb_XenGallery_Listener::SONNB_XENGALLERY_IMPORTING] = true;
         }
     }
     return parent::actionComplete();
 }
Ejemplo n.º 3
0
 public function actionComplete()
 {
     if ($this->_request->isPost()) {
         $input = $this->_input->filter(array('archive' => XenForo_Input::UINT, 'table' => XenForo_Input::STRING));
         if ($input['archive'] && $input['table']) {
             if (!$this->_getImportModel()->archiveImportLog($input['table'], $error)) {
                 return $this->responseError($error);
             }
         }
         $session = new XenForo_ImportSession();
         $importerKey = $session->getImporterKey();
         $session->delete();
         XenForo_Application::defer('Atomic', array('simple' => array('User', 'Thread', 'Poll', 'Forum')), 'importRebuild', true);
         return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildAdminLink('import/complete', false, array('confirm' => $importerKey)));
     } else {
         if ($importerKey = $this->_input->filterSingle('confirm', XenForo_Input::STRING)) {
             $importer = $this->_getImportModel()->getImporter($importerKey);
             $messages = $importer ? $importer->getImportCompleteMessages() : array();
             return $this->responseView('XenForo_ViewAdmin_Import_Complete', 'import_complete', array('messages' => $messages));
         } else {
             $session = new XenForo_ImportSession();
             $config = $session->getConfig();
             if (!$session->getImporterKey()) {
                 return $this->responseView('XenForo_ViewAdmin_Import_Complete', 'import_complete', array('messages' => array()));
             }
             $viewParams = array('importerName' => $this->_getImportModel()->getImporterName($session->getImporterKey()), 'logSuffix' => $config['db']['dbname']);
             return $this->responseView('XenForo_ViewAdmin_Import_CompleteConfirm', 'import_complete_confirm', $viewParams);
         }
     }
 }
Ejemplo n.º 4
0
 public function actionComplete()
 {
     if ($this->_request->isPost()) {
         $input = $this->_input->filter(array('archive' => XenForo_Input::UINT, 'table' => XenForo_Input::STRING));
         if ($input['archive'] && $input['table']) {
             if (!$this->_getImportModel()->archiveImportLog($input['table'], $error)) {
                 return $this->responseError($error);
             }
         }
         $session = new XenForo_ImportSession();
         $importerKey = $session->getImporterKey();
         $session->delete();
         $caches = array('User', 'Thread', 'Poll', 'Forum');
         return XenForo_CacheRebuilder_Abstract::getRebuilderResponse($this, $caches, XenForo_Link::buildAdminLink('import/complete', false, array('confirm' => $importerKey)));
     } else {
         if ($importerKey = $this->_input->filterSingle('confirm', XenForo_Input::STRING)) {
             $messages = $this->_getImportModel()->getImporter($importerKey)->getImportCompleteMessages();
             return $this->responseView('XenForo_ViewAdmin_Import_Complete', 'import_complete', array('messages' => $messages));
         } else {
             $session = new XenForo_ImportSession();
             $config = $session->getConfig();
             $importer = $this->_getImportModel()->getImporter($session->getImporterKey());
             $viewParams = array('importerName' => $importer->getName(), 'logSuffix' => $config['db']['dbname']);
             return $this->responseView('XenForo_ViewAdmin_Import_CompleteConfirm', 'import_complete_confirm', $viewParams);
         }
     }
 }