diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2008-04-18 23:04:38 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2008-04-18 23:04:38 +0000 |
commit | 327db845912a5e3857438fc0ad5ed0543f25a79f (patch) | |
tree | e18d8deb05b070c3d0edaddba703cd29c781ff4b /src/net/loginhandler.cpp | |
parent | b0cdf9ffc57c43aa81187ac856d08da7e97955ba (diff) | |
download | mana-327db845912a5e3857438fc0ad5ed0543f25a79f.tar.gz mana-327db845912a5e3857438fc0ad5ed0543f25a79f.tar.bz2 mana-327db845912a5e3857438fc0ad5ed0543f25a79f.tar.xz mana-327db845912a5e3857438fc0ad5ed0543f25a79f.zip |
Made 'Unregister' and 'change password' functionnal, at least client-side.
Diffstat (limited to 'src/net/loginhandler.cpp')
-rw-r--r-- | src/net/loginhandler.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index 260c117d..349684bf 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -34,6 +34,7 @@ LoginHandler::LoginHandler() APMSG_LOGIN_RESPONSE, APMSG_REGISTER_RESPONSE, APMSG_RECONNECT_RESPONSE, + APMSG_PASSWORD_CHANGE_RESPONSE, 0 }; handledMessages = _messages; @@ -136,5 +137,35 @@ void LoginHandler::handleMessage(MessageIn &msg) } } break; + + case APMSG_PASSWORD_CHANGE_RESPONSE: + { + int errMsg = msg.readInt8(); + // Successful pass change + if (errMsg == ERRMSG_OK) + { + state = STATE_CHANGEPASSWORD; + } + // pass change failed + else + { + switch (errMsg) { + case ERRMSG_INVALID_ARGUMENT: + errorMessage = "New password incorrect"; + break; + case ERRMSG_FAILURE: + errorMessage = "Old password incorrect"; + break; + case ERRMSG_NO_LOGIN: + errorMessage = "Account not connected. Please login first."; + break; + default: + errorMessage = "Unknown error"; + break; + } + state = STATE_ACCOUNTCHANGE_ERROR; + } + } + break; } } |