public function loadState() { $this->CurrentStep = c('Garden.Import.CurrentStep', 0); $this->Data = c('Garden.Import.CurrentStepData', array()); $this->ImportPath = c('Garden.Import.ImportPath', ''); }
/** * Restart the import process. Undo any work we've done so far and erase state. * * @since 2.0.0 * @access public */ public function restart($transientKey = '') { $this->permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed. if (!Gdn::session()->validateTransientKey($transientKey) && !Gdn::request()->isAuthenticatedPostBack()) { throw new Gdn_UserException('The CSRF token is invalid.', 403); } // Delete the individual table files. $Imp = new ImportModel(); try { $Imp->loadState(); $Imp->deleteFiles(); } catch (Exception $Ex) { } $Imp->deleteState(); redirect(strtolower($this->Application) . '/import'); }