From 7aa0ac6f43a640fdca6481b3bcb2bbe4391d9513 Mon Sep 17 00:00:00 2001 From: Manager Bot Date: Mon, 14 Nov 2022 17:01:16 +0000 Subject: [PATCH] Add docs for user settings. --- Web/lib/MJB/Web/Controller/UserSettings.pm | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Web/lib/MJB/Web/Controller/UserSettings.pm b/Web/lib/MJB/Web/Controller/UserSettings.pm index f09ab35..eccf663 100644 --- a/Web/lib/MJB/Web/Controller/UserSettings.pm +++ b/Web/lib/MJB/Web/Controller/UserSettings.pm @@ -1,12 +1,24 @@ package MJB::Web::Controller::UserSettings; use Mojo::Base 'Mojolicious::Controller', -signatures; +#== +# GET /profile | show_profile | templates/user_settings/profile.html.ep +#== sub profile ( $c ) { # Set the form values from the DB if they don't exist from the POST handler. $c->stash->{form}->{name} ||= $c->stash->{person}->name; $c->stash->{form}->{email} ||= $c->stash->{person}->email; } +#== +# POST /profile | do_profile +# name | The value to set for the account name +# email | The value to set for the account email +# password | The current password, used to authenticate this request. +# +# This route will change the user's name or email address. They are required +# to submit their current password to make these changes. +#== sub do_profile ( $c ) { my $name = $c->stash->{form}->{name} = $c->param('name'); my $email = $c->stash->{form}->{email} = $c->param('email'); @@ -38,8 +50,21 @@ sub do_profile ( $c ) { $c->redirect_to( $c->url_for( 'show_profile' ) ); } -sub change_password ( $c ) { } +#== +# GET /change_password | show_change_password | templates/user_settings/change_password.html.ep +#== +sub change_password ( $c ) { +} + +#== +# POST /change_password | do_change_password +# password | The current password, used to authenticate this request. +# new_password | The new password to set for the account. +# password_confirm | Confirmation of the new password, it must match. +# +# This route will update the user's password. +#== sub do_change_password ( $c ) { # Get the values the user gave for the password change. my $password = $c->stash->{form}->{password} = $c->param('password');