Add usersettings template and config values

This commit is contained in:
Albert S. 2021-03-26 22:45:09 +01:00
父節點 9840dbbeff
當前提交 e322587d07
共有 5 個文件被更改,包括 25 次插入3 次删除

查看文件

@ -95,7 +95,7 @@ Config::Config(const std::map<std::string, std::string> &map)
this->urls.settingsurl = required("settingsurl");
this->urls.deletionurl = required("deletionurl");
this->urls.adminregisterurl = required("adminregisterurl");
this->urls.userchangepwurl = required("userchangepwurl");
this->urls.usersettingsurl = required("usersettingsurl");
this->connectionstring = required("connectionstring");
this->handlersConfig.max_pagename_length = optional("max_pagename_length", 256);

查看文件

@ -40,7 +40,7 @@ struct ConfigUrls
std::string deletionurl;
std::string linkhistorysort;
std::string adminregisterurl;
std::string userchangepwurl;
std::string usersettingsurl;
};
class ConfigVariableResolver

查看文件

@ -0,0 +1,17 @@
{qswiki:include:general_header}
<main id="content">
<h2>User settings</h2>
<br>
<h3>Change your current password</h3>
<br><br>
<form action="{qswiki:var:usersettingsurl}" method="POST">
Current password: <input type="text" name="oldpassword" style="width: 25%;"></input><br>
New Password: <input type="password" name="newpassword" style="width: 25%;"></input><br>
Repeat password: <input type="password" name="newpasswordconfirm" style="width: 25%;"></input><br>
<button type="submit" name="do" value="submit">Submit</button>
<input type="hidden" name="csrf_token" value="{qswiki:var:csrf_token}"></input>
</form>
</main>
{qswiki:include:general_footer}

查看文件

@ -106,6 +106,11 @@ std::string UrlProvider::pageDelete(std::string pagename)
return replaceOnlyPage(config->linkdelete, pagename);
}
std::string UrlProvider::userSettings()
{
return config->usersettingsurl;
}
std::string UrlProvider::category(std::string catname)
{
return replaceSingleVar(config->linkcategory, "category", catname);

查看文件

@ -41,7 +41,7 @@ class UrlProvider
std::string pageDelete(std::string pagename);
std::string userchangepw();
std::string userSettings();
std::string refreshSession();