summaryrefslogtreecommitdiff
path: root/modules/rest/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rest/controllers')
-rw-r--r--modules/rest/controllers/rest.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php
index bf2f0a54..a721ff2b 100644
--- a/modules/rest/controllers/rest.php
+++ b/modules/rest/controllers/rest.php
@@ -37,6 +37,22 @@ class Rest_Controller extends Controller {
rest::reply(rest::access_key());
}
+ public function reset_api_key_confirm() {
+ $form = new Forge("rest/reset_api_key", "", "post", array("id" => "g-reset-api-key"));
+ $group = $form->group("confirm_reset")->label(t("Confirm resetting your REST API key"));
+ $group->submit("")->value(t("Reset"));
+ $v = new View("reset_api_key_confirm.html");
+ $v->form = $form;
+ print $v;
+ }
+
+ public function reset_api_key() {
+ access::verify_csrf();
+ rest::reset_access_key();
+ message::success(t("Your REST API key has been reset."));
+ json::reply(array("result" => "success"));
+ }
+
public function __call($function, $args) {
try {
$input = Input::instance();