summaryrefslogtreecommitdiff
path: root/src/gui/changepassworddialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/changepassworddialog.cpp')
-rw-r--r--src/gui/changepassworddialog.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gui/changepassworddialog.cpp b/src/gui/changepassworddialog.cpp
index 0ad9071a..c79db7e9 100644
--- a/src/gui/changepassworddialog.cpp
+++ b/src/gui/changepassworddialog.cpp
@@ -34,6 +34,8 @@
#include "gui/widgets/layout.h"
#include "net/logindata.h"
+#include "net/loginhandler.h"
+#include "net/net.h"
#include "utils/gettext.h"
#include "utils/stringutils.h"
@@ -98,6 +100,9 @@ void ChangePasswordDialog::action(const gcn::ActionEvent &event)
std::stringstream errorMessage;
int error = 0;
+ unsigned int min = Net::getLoginHandler()->getMinPasswordLength();
+ unsigned int max = Net::getLoginHandler()->getMaxPasswordLength();
+
// Check old Password
if (oldPassword.empty())
{
@@ -105,19 +110,18 @@ void ChangePasswordDialog::action(const gcn::ActionEvent &event)
errorMessage << _("Enter the old password first.");
error = 1;
}
- else if (newFirstPass.length() < LEN_MIN_PASSWORD)
+ else if (newFirstPass.length() < min)
{
// First password too short
- errorMessage << strprintf(_("The new password needs to be at least "
- "%d characters long."), LEN_MIN_PASSWORD);
+ errorMessage << strprintf(_("The new password needs to be at least"
+ " %d characters long."), min);
error = 2;
}
- else if (newFirstPass.length() > LEN_MAX_PASSWORD - 1 )
+ else if (newFirstPass.length() > max - 1 )
{
// First password too long
errorMessage << strprintf(_("The new password needs to be less "
- "than %d characters long."),
- LEN_MAX_PASSWORD);
+ "than %d characters long."), max);
error = 2;
}
else if (newFirstPass != newSecondPass)