diff options
author | Brion Vibber <brion@pobox.com> | 2010-09-28 15:45:00 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-09-28 15:45:00 -0700 |
commit | 588758ed6d14a6c17eba9acf440164867c21cf25 (patch) | |
tree | a4a201ef17a40cfad02c05b614d31ba3287324ec /plugins/YammerImport/actions | |
parent | 6cf7b2401754aef634d983187d87c9148e1f00ca (diff) |
Made YammerImport more robust against errors; can now pause/resume/reset the import state from the admin interface.
Diffstat (limited to 'plugins/YammerImport/actions')
-rw-r--r-- | plugins/YammerImport/actions/yammeradminpanel.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/YammerImport/actions/yammeradminpanel.php b/plugins/YammerImport/actions/yammeradminpanel.php index 13960d905..3faf390ac 100644 --- a/plugins/YammerImport/actions/yammeradminpanel.php +++ b/plugins/YammerImport/actions/yammeradminpanel.php @@ -73,6 +73,7 @@ class YammeradminpanelAction extends AdminPanelAction { // @fixme move this to saveSettings and friends? if ($_SERVER['REQUEST_METHOD'] == 'POST') { + StatusNet::setApi(true); // short error pages :P $this->checkSessionToken(); if ($this->subaction == 'change-apikey') { $form = new YammerApiKeyForm($this); @@ -97,6 +98,18 @@ class YammeradminpanelAction extends AdminPanelAction $this->runner->startBackgroundImport(); $form = new YammerProgressForm($this, $this->runner); + } else if ($this->subaction == 'pause-import') { + $this->runner->recordError(_m('Paused from admin panel.')); + $form = $this->statusForm(); + } else if ($this->subaction == 'continue-import') { + $this->runner->clearError(); + $this->runner->startBackgroundImport(); + $form = $this->statusForm(); + } else if ($this->subaction == 'abort-import') { + $this->runner->reset(); + $form = $this->statusForm(); + } else if ($this->subaction == 'progress') { + $form = $this->statusForm(); } else { throw new ClientException('Invalid POST'); } |