summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-05-08 11:33:34 +0200
committerParménides GV <parmegv@sdf.org>2014-05-08 11:33:34 +0200
commitdaff611c70bb5e8b3bdc5f5c42bc776acb6e8e3e (patch)
treedd636ca1d76c4443555bb3509d4d72a21dd2b387 /app/src/main
parente08177035e65ea35249310bb963143a122a17ec7 (diff)
Automatically log in.
Functionality copied to the Release build.
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/Dashboard.java10
-rw-r--r--app/src/main/res/values/strings.xml1
2 files changed, 8 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
index 241286bb..f8db33f3 100644
--- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
+++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
@@ -373,7 +373,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPI_result_receiver);
mProgressBar.setVisibility(ProgressBar.VISIBLE);
- eipStatus.setText(R.string.authenticating_message);
+ eipStatus.setText(R.string.signingup_message);
//mProgressBar.setMax(4);
startService(provider_API_command);
}
@@ -421,7 +421,11 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
@Override
public void onReceiveResult(int resultCode, Bundle resultData) {
- if(resultCode == ProviderAPI.SRP_AUTHENTICATION_SUCCESSFUL){
+ if(resultCode == ProviderAPI.SRP_REGISTRATION_SUCCESSFUL){
+ authenticate(resultData.getString(LogInDialog.USERNAME), resultData.getString(LogInDialog.PASSWORD));
+ } else if(resultCode == ProviderAPI.SRP_REGISTRATION_FAILED){
+ signUpDialog(((ViewGroup)findViewById(android.R.id.content)).getChildAt(0), resultData);
+ } else if(resultCode == ProviderAPI.SRP_AUTHENTICATION_SUCCESSFUL){
String session_id_cookie_key = resultData.getString(ProviderAPI.SESSION_ID_COOKIE_KEY);
String session_id_string = resultData.getString(ProviderAPI.SESSION_ID_KEY);
setResult(RESULT_OK);
@@ -436,7 +440,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
//Cookie session_id = new BasicClientCookie(session_id_cookie_key, session_id_string);
downloadAuthedUserCertificate(/*session_id*/);
} else if(resultCode == ProviderAPI.SRP_AUTHENTICATION_FAILED) {
- logInDialog(getCurrentFocus(), resultData);
+ logInDialog(getCurrentFocus(), resultData);
} else if(resultCode == ProviderAPI.LOGOUT_SUCCESSFUL) {
authed_eip = false;
getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE).edit().putBoolean(EIP.AUTHED_EIP, authed_eip).commit();
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 5f0e2120..ac692a69 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -127,6 +127,7 @@
<string name="configuring_provider">Configuring provider</string>
<string name="incorrectly_downloaded_certificate_message">Your anon cert was not downloaded</string>
<string name="authenticating_message">Logging in</string>
+ <string name="signingup_message">Signing up</string>
<string name="logout_message">Logging out from this session.</string>
<string name="log_out_failed_message">Didn\'t logged out.</string>
<string name="succesful_authentication_message">Authentication succeeded.</string>