summaryrefslogtreecommitdiff
path: root/src/gui/changepassworddialog.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-10-19 14:18:04 -0600
committerJared Adams <jaxad0127@gmail.com>2009-10-19 14:18:04 -0600
commit7fc4b120bf35daa5d3d96eb565ec7d79ce153653 (patch)
tree159b576c6cb87486e043d5ba103b4b634ef1b230 /src/gui/changepassworddialog.cpp
parent72883051f1c947c324e259dc5e323ca3dfaf3737 (diff)
downloadmana-client-7fc4b120bf35daa5d3d96eb565ec7d79ce153653.tar.gz
mana-client-7fc4b120bf35daa5d3d96eb565ec7d79ce153653.tar.bz2
mana-client-7fc4b120bf35daa5d3d96eb565ec7d79ce153653.tar.xz
mana-client-7fc4b120bf35daa5d3d96eb565ec7d79ce153653.zip
Fix RegisterDialog tab order and detail lengths
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)