wesnothd: removed password reminder backend (closes #2753)
(cherry-picked from commit e52682e07b
)
This commit is contained in:
parent
717511a428
commit
122976bef0
6 changed files with 0 additions and 39 deletions
|
@ -171,11 +171,6 @@ void fuh::set_is_moderator(const std::string& name, const bool& is_moderator) {
|
|||
}
|
||||
}
|
||||
|
||||
void fuh::password_reminder(const std::string& /*name*/) {
|
||||
throw error("For now please use the password recovery "
|
||||
"function provided at https://forums.wesnoth.org");
|
||||
}
|
||||
|
||||
std::string fuh::user_info(const std::string& name) {
|
||||
if(!user_exists(name)) {
|
||||
throw error("No user with the name '" + name + "' exists.");
|
||||
|
|
|
@ -68,9 +68,6 @@ class fuh : public user_handler {
|
|||
bool user_is_moderator(const std::string& name);
|
||||
void set_is_moderator(const std::string& name, const bool& is_moderator);
|
||||
|
||||
// Throws user_handler::error
|
||||
void password_reminder(const std::string& name);
|
||||
|
||||
// Throws user_handler::error
|
||||
std::string user_info(const std::string& name);
|
||||
|
||||
|
|
|
@ -203,12 +203,6 @@ void suh::user_logged_in(const std::string& name) {
|
|||
set_lastlogin(name, time(nullptr));
|
||||
}
|
||||
|
||||
void suh::password_reminder(const std::string& name) {
|
||||
std::stringstream msg;
|
||||
msg << "Hello " << name << ",\nyour password is '" << get_password(name) << "'.\n\nHave fun playing Wesnoth :)";
|
||||
send_mail(name, "Wesnoth Password Reminder", msg.str());
|
||||
}
|
||||
|
||||
std::string suh::user_info(const std::string& name) {
|
||||
if(!user_exists(name)) throw error("No user with the name '" + name + "' exists.");
|
||||
|
||||
|
|
|
@ -37,8 +37,6 @@ class suh : public user_handler {
|
|||
bool login(const std::string& name, const std::string& password, const std::string&);
|
||||
void user_logged_in(const std::string& name);
|
||||
|
||||
void password_reminder(const std::string& name);
|
||||
|
||||
bool user_exists(const std::string& name);
|
||||
bool user_is_active(const std::string& name);
|
||||
|
||||
|
|
|
@ -624,21 +624,6 @@ void server::handle_login(socket_ptr socket, std::shared_ptr<simple_wml::documen
|
|||
}
|
||||
}
|
||||
|
||||
// If this is a request for password reminder
|
||||
if(user_handler_) {
|
||||
std::string password_reminder = (*login)["password_reminder"].to_string();
|
||||
if(password_reminder == "yes") {
|
||||
try {
|
||||
user_handler_->password_reminder(username);
|
||||
async_send_error(socket, "Your password reminder email has been sent.");
|
||||
} catch (user_handler::error& e) {
|
||||
async_send_error(socket, "There was an error sending your password reminder email. The error message was: " +
|
||||
e.message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check the username isn't already taken
|
||||
auto p = player_connections_.get<name_t>().find(username);
|
||||
bool name_taken = p != player_connections_.get<name_t>().end();
|
||||
|
|
|
@ -66,14 +66,6 @@ class user_handler {
|
|||
*/
|
||||
virtual void clean_up() =0;
|
||||
|
||||
/**
|
||||
* Send a password reminder email to the given user.
|
||||
*
|
||||
* Should throw user_handler::error if sending fails
|
||||
* (e.g. because we cannot send email).
|
||||
*/
|
||||
virtual void password_reminder(const std::string& name) =0;
|
||||
|
||||
/**
|
||||
* Return true if the given password matches the password for the given user.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue