From abfeea06a8f424ab45dded67e3ca8e9fadb08984 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 2 Jan 2017 20:25:46 +0000 Subject: [PATCH] Move password changing apidoc comment --- RestApiDocs/api_data.js | 109 ++++++++++++++++++++++++++- RestApiDocs/api_data.json | 109 ++++++++++++++++++++++++++- RestApiDocs/api_project.js | 2 +- RestApiDocs/api_project.json | 2 +- build/index.php | 25 +++--- module_index.json | 4 +- modules/feature-user-preferences.php | 25 +++--- 7 files changed, 244 insertions(+), 32 deletions(-) diff --git a/RestApiDocs/api_data.js b/RestApiDocs/api_data.js index d1ac09f..33ba7df 100644 --- a/RestApiDocs/api_data.js +++ b/RestApiDocs/api_data.js @@ -419,6 +419,23 @@ define({ "api": [ "filename": "./modules/action-protect.php", "groupTitle": "Page" }, + { + "type": "get", + "url": "?action=random", + "title": "Redirects to a random page.", + "name": "RawSource", + "group": "Page", + "permission": [ + { + "name": "Anonymous", + "title": "Anybody may use this call.", + "description": "" + } + ], + "version": "0.0.0", + "filename": "./modules/action-random.php", + "groupTitle": "Page" + }, { "type": "get", "url": "?action=raw&page={pageName}", @@ -607,6 +624,79 @@ define({ "api": [ "filename": "./modules/feature-search.php", "groupTitle": "Search" }, + { + "type": "post", + "url": "?action=change-password", + "title": "Change your password", + "name": "ChangePassword", + "group": "Settings", + "permission": [ + { + "name": "User", + "title": "Only users loggged in may use this call.", + "description": "" + } + ], + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "current-pass", + "description": "

Your current password.

" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "new-pass", + "description": "

Your new password.

" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "new-pass-confirm", + "description": "

Your new password again, to make sure you've typed it correctly.

" + } + ] + } + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "optional": false, + "field": "PasswordMismatchError", + "description": "

The new password fields don't match.

" + } + ] + } + }, + "version": "0.0.0", + "filename": "./modules/feature-user-preferences.php", + "groupTitle": "Settings" + }, + { + "type": "get", + "url": "?action=user-preferences", + "title": "Get a user preferences configuration page.", + "name": "UserPreferences", + "group": "Settings", + "permission": [ + { + "name": "User", + "title": "Only users loggged in may use this call.", + "description": "" + } + ], + "version": "0.0.0", + "filename": "./modules/feature-user-preferences.php", + "groupTitle": "Settings" + }, { "type": "get", "url": "?action=recentchanges", @@ -791,7 +881,24 @@ define({ "api": [ { "type": "get", "url": "?action=configure", - "title": "Change the global wiki settings", + "title": "Get a page to change the global wiki settings", + "name": "ConfigureSettings", + "group": "Utility", + "permission": [ + { + "name": "Moderator", + "title": "Only users loggged with a moderator account may use this call.", + "description": "" + } + ], + "version": "0.0.0", + "filename": "./modules/feature-guiconfig.php", + "groupTitle": "Utility" + }, + { + "type": "post", + "url": "?action=configure-save", + "title": "Save changes to the global wiki settings", "name": "ConfigureSettings", "group": "Utility", "permission": [ diff --git a/RestApiDocs/api_data.json b/RestApiDocs/api_data.json index a03d109..59d459c 100644 --- a/RestApiDocs/api_data.json +++ b/RestApiDocs/api_data.json @@ -419,6 +419,23 @@ "filename": "./modules/action-protect.php", "groupTitle": "Page" }, + { + "type": "get", + "url": "?action=random", + "title": "Redirects to a random page.", + "name": "RawSource", + "group": "Page", + "permission": [ + { + "name": "Anonymous", + "title": "Anybody may use this call.", + "description": "" + } + ], + "version": "0.0.0", + "filename": "./modules/action-random.php", + "groupTitle": "Page" + }, { "type": "get", "url": "?action=raw&page={pageName}", @@ -607,6 +624,79 @@ "filename": "./modules/feature-search.php", "groupTitle": "Search" }, + { + "type": "post", + "url": "?action=change-password", + "title": "Change your password", + "name": "ChangePassword", + "group": "Settings", + "permission": [ + { + "name": "User", + "title": "Only users loggged in may use this call.", + "description": "" + } + ], + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "current-pass", + "description": "

Your current password.

" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "new-pass", + "description": "

Your new password.

" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "new-pass-confirm", + "description": "

Your new password again, to make sure you've typed it correctly.

" + } + ] + } + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "optional": false, + "field": "PasswordMismatchError", + "description": "

The new password fields don't match.

" + } + ] + } + }, + "version": "0.0.0", + "filename": "./modules/feature-user-preferences.php", + "groupTitle": "Settings" + }, + { + "type": "get", + "url": "?action=user-preferences", + "title": "Get a user preferences configuration page.", + "name": "UserPreferences", + "group": "Settings", + "permission": [ + { + "name": "User", + "title": "Only users loggged in may use this call.", + "description": "" + } + ], + "version": "0.0.0", + "filename": "./modules/feature-user-preferences.php", + "groupTitle": "Settings" + }, { "type": "get", "url": "?action=recentchanges", @@ -791,7 +881,24 @@ { "type": "get", "url": "?action=configure", - "title": "Change the global wiki settings", + "title": "Get a page to change the global wiki settings", + "name": "ConfigureSettings", + "group": "Utility", + "permission": [ + { + "name": "Moderator", + "title": "Only users loggged with a moderator account may use this call.", + "description": "" + } + ], + "version": "0.0.0", + "filename": "./modules/feature-guiconfig.php", + "groupTitle": "Utility" + }, + { + "type": "post", + "url": "?action=configure-save", + "title": "Save changes to the global wiki settings", "name": "ConfigureSettings", "group": "Utility", "permission": [ diff --git a/RestApiDocs/api_project.js b/RestApiDocs/api_project.js index 3c5194e..4f9ee51 100644 --- a/RestApiDocs/api_project.js +++ b/RestApiDocs/api_project.js @@ -7,7 +7,7 @@ define({ "apidoc": "0.2.0", "generator": { "name": "apidoc", - "time": "2016-10-19T20:01:19.373Z", + "time": "2017-01-02T20:25:29.776Z", "url": "http://apidocjs.com", "version": "0.16.1" } diff --git a/RestApiDocs/api_project.json b/RestApiDocs/api_project.json index 11f2fe6..7465e5e 100644 --- a/RestApiDocs/api_project.json +++ b/RestApiDocs/api_project.json @@ -7,7 +7,7 @@ "apidoc": "0.2.0", "generator": { "name": "apidoc", - "time": "2016-10-19T20:01:19.373Z", + "time": "2017-01-02T20:25:29.776Z", "url": "http://apidocjs.com", "version": "0.16.1" } diff --git a/build/index.php b/build/index.php index 963b90a..1c41f9f 100644 --- a/build/index.php +++ b/build/index.php @@ -3851,6 +3851,18 @@ register_module([ exit(page_renderer::render_main("User Preferences - $settings->sitename", $content)); }); + /** + * @api {post} ?action=change-password Change your password + * @apiName ChangePassword + * @apiGroup Settings + * @apiPermission User + * + * @apiParam {string} current-pass Your current password. + * @apiParam {string} new-pass Your new password. + * @apiParam {string} new-pass-confirm Your new password again, to make sure you've typed it correctly. + * + * @apiError PasswordMismatchError The new password fields don't match. + */ add_action("change-password", function() { global $env, $settings; @@ -3874,19 +3886,6 @@ register_module([ exit(page_renderer::render_main("Password Changed Successfully", "

You password was changed successfully. Go back to the user preferences page.

")); }); - /** - * @api {post} ?action=change-password Change your password - * @apiName ChangePassword - * @apiGroup Settings - * @apiPermission User - * - * @apiParam {string} current-pass Your current password. - * @apiParam {string} new-pass Your new password. - * @apiParam {string} new-pass-confirm Your new password again, to make sure you've typed it correctly. - * - * @apiError PasswordMismatchError The new password fields don't match. - */ - add_help_section("910-user-preferences", "User Preferences", "

(help text coming soon)

"); } ]); diff --git a/module_index.json b/module_index.json index 3e52336..1f20ebd 100755 --- a/module_index.json +++ b/module_index.json @@ -104,7 +104,7 @@ "author": "Starbeamrainbowlabs", "description": "Adds a user preferences page, letting pople do things like change their email address and password.", "id": "feature-user-preferences", - "lastupdate": 1482516311, + "lastupdate": 1483387687, "optional": false }, { @@ -230,7 +230,7 @@ "author": "Emanuil Rusev & Starbeamrainbowlabs", "description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation, and also *requires* write access to the disk on first load.", "id": "parser-parsedown", - "lastupdate": 1482776902, + "lastupdate": 1482776954, "optional": false } ] \ No newline at end of file diff --git a/modules/feature-user-preferences.php b/modules/feature-user-preferences.php index 81e2cac..f1c4da8 100644 --- a/modules/feature-user-preferences.php +++ b/modules/feature-user-preferences.php @@ -63,6 +63,18 @@ register_module([ exit(page_renderer::render_main("User Preferences - $settings->sitename", $content)); }); + /** + * @api {post} ?action=change-password Change your password + * @apiName ChangePassword + * @apiGroup Settings + * @apiPermission User + * + * @apiParam {string} current-pass Your current password. + * @apiParam {string} new-pass Your new password. + * @apiParam {string} new-pass-confirm Your new password again, to make sure you've typed it correctly. + * + * @apiError PasswordMismatchError The new password fields don't match. + */ add_action("change-password", function() { global $env, $settings; @@ -86,19 +98,6 @@ register_module([ exit(page_renderer::render_main("Password Changed Successfully", "

You password was changed successfully. Go back to the user preferences page.

")); }); - /** - * @api {post} ?action=change-password Change your password - * @apiName ChangePassword - * @apiGroup Settings - * @apiPermission User - * - * @apiParam {string} current-pass Your current password. - * @apiParam {string} new-pass Your new password. - * @apiParam {string} new-pass-confirm Your new password again, to make sure you've typed it correctly. - * - * @apiError PasswordMismatchError The new password fields don't match. - */ - add_help_section("910-user-preferences", "User Preferences", "

(help text coming soon)

"); } ]);