diff options
Diffstat (limited to 'src/gui/unregisterdialog.cpp')
-rw-r--r-- | src/gui/unregisterdialog.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/unregisterdialog.cpp b/src/gui/unregisterdialog.cpp index 0dfc8df9..a5e96532 100644 --- a/src/gui/unregisterdialog.cpp +++ b/src/gui/unregisterdialog.cpp @@ -34,6 +34,8 @@ #include "gui/widgets/textfield.h" #include "net/logindata.h" +#include "net/loginhandler.h" +#include "net/net.h" #include "utils/gettext.h" #include "utils/stringutils.h" @@ -106,20 +108,22 @@ UnRegisterDialog::action(const gcn::ActionEvent &event) std::stringstream errorMessage; bool error = false; + unsigned int min = Net::getLoginHandler()->getMinPasswordLength(); + unsigned int max = Net::getLoginHandler()->getMaxPasswordLength(); + // Check password - if (password.length() < LEN_MIN_PASSWORD) + if (password.length() < min) { // Pass too short errorMessage << strprintf(_("The password needs to be at least %d " - "characters long."), LEN_MIN_PASSWORD); + "characters long."), min); error = true; } - else if (password.length() > LEN_MAX_PASSWORD - 1) + else if (password.length() > max - 1) { // Pass too long errorMessage << strprintf(_("The password needs to be less than " - "%d characters long."), - LEN_MAX_PASSWORD); + "%d characters long."), max); error = true; } |