Skip to content
Snippets Groups Projects
Commit da2bc4bd authored by Rasmus Fuhse's avatar Rasmus Fuhse
Browse files

revamp the deactivating and enfasten up the oauth process

parent 3372209a
No related branches found
No related tags found
No related merge requests found
......@@ -14,12 +14,20 @@ class ConfigureController extends PluginController
$config = UserConfig::get($GLOBALS['user']->id);
$data = Request::getArray("owncloud");
foreach ($data as $key => $value) {
$config->store("OWNCLOUD_".strtoupper($key).($key === "activated" ? "" : "_USER"), $value);
$config->store("OWNCLOUD_" . strtoupper($key) . ($key === "activated" ? "" : "_USER"), $value);
}
if (!$data['activated']) {
$config->store("OWNCLOUD_ACTIVATED", 0);
$this->redirect(URLHelper::getURL("dispatch.php/files"));
} else {
if (\OwnCloud\OAuth::hasAccessToken()) {
$this->redirect(URLHelper::getURL("dispatch.php/files/system/" . $this->plugin->getPluginId()));
} else {
$this->redirect("oauth/request_access_token");
}
}
PageLayout::postMessage(MessageBox::success(_("Konfiguration gespeichert.")));
return;
}
}
}
\ No newline at end of file
<form action="<?= PluginEngine::getLink($plugin, array(), "configure/myarea") ?>"
method="post"
data-dialog
class="default owncloud"
autocomplete="off">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment