summaryrefslogtreecommitdiff
path: root/plugins/YammerImport/actions
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-09-28 15:45:00 -0700
committerBrion Vibber <brion@pobox.com>2010-09-28 15:59:29 -0700
commit62d9b66dffb0000122cd611a9d991da008f9a527 (patch)
tree39911f2ab88c83edd916d9167d5b8aa1222db222 /plugins/YammerImport/actions
parentc62e4d08008faf7fdfb67f0e5eda3db6d8d1ceef (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.php13
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');
}