aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2013-01-19 12:13:04 +0100
committerSamuel Tardieu <sam@rfc1149.net>2013-01-19 12:13:04 +0100
commit14796b42b2b14f799294ba955504bc0064ef5d11 (patch)
tree5f27d9e615533cb7afe257892aaa9059ddbef572
parent97cb0325fbb353b6b0b8989678333a085652c5e5 (diff)
downloadcgeo-14796b42b2b14f799294ba955504bc0064ef5d11.zip
cgeo-14796b42b2b14f799294ba955504bc0064ef5d11.tar.gz
cgeo-14796b42b2b14f799294ba955504bc0064ef5d11.tar.bz2
fix #2412: login fail with unhelpful message on unvalidated account
-rw-r--r--main/res/values/strings.xml1
-rw-r--r--main/src/cgeo/geocaching/connector/gc/Login.java5
-rw-r--r--main/src/cgeo/geocaching/enumerations/StatusCode.java1
3 files changed, 7 insertions, 0 deletions
diff --git a/main/res/values/strings.xml b/main/res/values/strings.xml
index 6384bbd..e68ee8b 100644
--- a/main/res/values/strings.xml
+++ b/main/res/values/strings.xml
@@ -139,6 +139,7 @@
<string name="err_wrong">Login information incorrect</string>
<string name="err_maintenance">Geocaching.com is down for maintenance. c:geo works offline with Stored caches.</string>
<string name="err_license">You have not agreed to Geocaching.com license agreement, so c:geo can\'t load cache coordinates.</string>
+ <string name="err_unvalidated_account">You must validate your account on Geocaching.com web site first.</string>
<string name="err_unpublished">The requested cache is unpublished.</string>
<string name="err_premium_only">This Cache is only available to Geocaching.com Premium Members.</string>
<string name="err_store">c:geo can\'t store the cache.</string>
diff --git a/main/src/cgeo/geocaching/connector/gc/Login.java b/main/src/cgeo/geocaching/connector/gc/Login.java
index c3f29cc..8bb9866 100644
--- a/main/src/cgeo/geocaching/connector/gc/Login.java
+++ b/main/src/cgeo/geocaching/connector/gc/Login.java
@@ -132,6 +132,11 @@ public abstract class Login {
return StatusCode.WRONG_LOGIN_DATA; // wrong login
}
+ if (loginData.contains("You must validate your account before you can log in.")) {
+ Log.i("Failued to log in Geocaching.com as " + login.left + " because account needs to be validated first");
+ return StatusCode.UNVALIDATED_ACCOUNT;
+ }
+
Log.i("Failed to log in Geocaching.com as " + login.left + " for some unknown reason");
if (retry) {
Login.switchToEnglish(loginData);
diff --git a/main/src/cgeo/geocaching/enumerations/StatusCode.java b/main/src/cgeo/geocaching/enumerations/StatusCode.java
index 1a1f05d..dc62225 100644
--- a/main/src/cgeo/geocaching/enumerations/StatusCode.java
+++ b/main/src/cgeo/geocaching/enumerations/StatusCode.java
@@ -16,6 +16,7 @@ public enum StatusCode {
COMMUNICATION_ERROR(R.string.err_comm),
WRONG_LOGIN_DATA(R.string.err_wrong),
UNAPPROVED_LICENSE(R.string.err_license),
+ UNVALIDATED_ACCOUNT(R.string.err_unvalidated_account),
UNPUBLISHED_CACHE(R.string.err_unpublished),
PREMIUM_ONLY(R.string.err_premium_only),
MAINTENANCE(R.string.err_maintenance),