/** * 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'); }
/** * Restart the import process. Undo any work we've done so far and erase state. * * @since 2.0.0 * @access public */ public function restart() { $this->permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed. // Delete the individual table files. $Imp = new ImportModel(); try { $Imp->loadState(); $Imp->deleteFiles(); } catch (Exception $Ex) { } $Imp->deleteState(); redirect(strtolower($this->Application) . '/import'); }
/** * Restart the import process. Undo any work we've done so far and erase state. * * @since 2.0.0 * @access public */ public function restart() { $this->permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed. if (!Gdn::request()->isAuthenticatedPostBack(true)) { throw new Exception('Requires POST', 405); } // Delete the individual table files. $Imp = new ImportModel(); try { $Imp->loadState(); $Imp->deleteFiles(); } catch (Exception $Ex) { } $Imp->deleteState(); redirect(strtolower($this->Application) . '/import'); }