Changes after CR
authorjabarros <jabarros@solidgear.es>
Tue, 9 Sep 2014 11:42:01 +0000 (13:42 +0200)
committerjabarros <jabarros@solidgear.es>
Tue, 9 Sep 2014 11:42:01 +0000 (13:42 +0200)
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/authentication/SsoWebViewClient.java
src/com/owncloud/android/ui/dialog/CredentialsDialogFragment.java

index 716bf7f..21aab72 100644 (file)
@@ -1697,14 +1697,6 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
         dialog.show(ft, UNTRUSTED_CERT_DIALOG_TAG);\r
     }\r
 \r
         dialog.show(ft, UNTRUSTED_CERT_DIALOG_TAG);\r
     }\r
 \r
-    /**\r
-     * Show authentication dialog \r
-     */\r
-    public void showAuthenticationDialog(WebView webView, HttpAuthHandler handler) {\r
-        // Show a dialog for the authentication\r
-        createAuthenticationDialog(webView, handler);\r
-        \r
-    }\r
 \r
     /**\r
      * Show untrusted cert dialog \r
 \r
     /**\r
      * Show untrusted cert dialog \r
@@ -1798,11 +1790,11 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
     }\r
 \r
     /**\r
     }\r
 \r
     /**\r
-     * Create dialog for request authentication to the user\r
+     * Create and show dialog for request authentication to the user\r
      * @param webView\r
      * @param handler\r
      */\r
      * @param webView\r
      * @param handler\r
      */\r
-    private void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) {\r
+    public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) {\r
 \r
         // Show a dialog with the certificate info\r
         CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler);\r
 \r
         // Show a dialog with the certificate info\r
         CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler);\r
index b9b7319..fb078bd 100644 (file)
@@ -198,7 +198,7 @@ public class SsoWebViewClient extends WebViewClient {
     public void onReceivedHttpAuthRequest (WebView view, HttpAuthHandler handler, String host, String realm) {
         Log_OC.d(TAG, "onReceivedHttpAuthRequest : " + host);
 
     public void onReceivedHttpAuthRequest (WebView view, HttpAuthHandler handler, String host, String realm) {
         Log_OC.d(TAG, "onReceivedHttpAuthRequest : " + host);
 
-        ((AuthenticatorActivity)mContext).showAuthenticationDialog(view, handler);
+        ((AuthenticatorActivity)mContext).createAuthenticationDialog(view, handler);
     }
 
     @Override
     }
 
     @Override
index 1b35057..080316b 100644 (file)
@@ -127,18 +127,18 @@ public class CredentialsDialogFragment extends SherlockDialogFragment
     public void onClick(DialogInterface dialog, int which) {
         if (which == AlertDialog.BUTTON_POSITIVE) { 
 
     public void onClick(DialogInterface dialog, int which) {
         if (which == AlertDialog.BUTTON_POSITIVE) { 
 
-            String username = mUsernameET.getText().toString().trim();
-            String password = mPasswordET.getText().toString().trim();
+            String username = mUsernameET.getText().toString();
+            String password = mPasswordET.getText().toString();
 
             // Proceed with the authentication
             mHandler.proceed(username, password);
 
             // Proceed with the authentication
             mHandler.proceed(username, password);
-            dialog.dismiss();
 
         } else if (which == AlertDialog.BUTTON_NEGATIVE) {
 
         } else if (which == AlertDialog.BUTTON_NEGATIVE) {
-            dialog.dismiss();
             mWebView.stopLoading();
             ((AuthenticatorActivity)getActivity()).doNegativeAuthenticatioDialogClick();
         }
             mWebView.stopLoading();
             ((AuthenticatorActivity)getActivity()).doNegativeAuthenticatioDialogClick();
         }
+
+        dialog.dismiss();
     }
     
     
     }