Browse Source

Added an option to disable sending of user credentials to the server.

pull/82/head
Eric Kok 11 years ago
parent
commit
221cfc3313
  1. 2
      core/res/values/strings.xml
  2. 5
      core/res/xml/pref_server.xml
  3. 6
      core/src/org/transdroid/core/app/settings/ApplicationSettings.java
  4. 2
      core/src/org/transdroid/core/gui/settings/ServerSettingsActivity.java

2
core/res/values/strings.xml

@ -245,6 +245,8 @@
<string name="pref_ftpurl">Base (S)FTP url</string> <string name="pref_ftpurl">Base (S)FTP url</string>
<string name="pref_ftpurl_into">For example ftp://me@server/downloads/</string> <string name="pref_ftpurl_into">For example ftp://me@server/downloads/</string>
<string name="pref_ftppass">(S)FTP password</string> <string name="pref_ftppass">(S)FTP password</string>
<string name="pref_disableauth">Disable authentication</string>
<string name="pref_disableauth_info">Don\'t send username and password</string>
<string name="pref_sslenable">Use SSL</string> <string name="pref_sslenable">Use SSL</string>
<string name="pref_sslenable_info">Connect using https</string> <string name="pref_sslenable_info">Connect using https</string>
<string name="pref_sslkey">Custom SSL thumbprint (SHA-1)</string> <string name="pref_sslkey">Custom SSL thumbprint (SHA-1)</string>

5
core/res/xml/pref_server.xml

@ -59,6 +59,11 @@
android:title="@string/pref_localnetwork" android:title="@string/pref_localnetwork"
android:summary="@string/pref_localnetwork_info" android:summary="@string/pref_localnetwork_info"
android:inputType="textNoSuggestions" /> android:inputType="textNoSuggestions" />
<CheckBoxPreference
android:key="server_disableauth"
android:title="@string/pref_disableauth"
android:summary="@string/pref_disableauth_info"
android:defaultValue="false" />
<EditTextPreference <EditTextPreference
android:key="server_folder" android:key="server_folder"
android:title="@string/pref_folder" android:title="@string/pref_folder"

6
core/src/org/transdroid/core/app/settings/ApplicationSettings.java

@ -107,7 +107,7 @@ public class ApplicationSettings {
prefs.getBoolean("server_ssltrustall_" + order, false), prefs.getBoolean("server_ssltrustall_" + order, false),
prefs.getString("server_ssltrustkey_" + order, null), prefs.getString("server_ssltrustkey_" + order, null),
prefs.getString("server_folder_" + order, null), prefs.getString("server_folder_" + order, null),
prefs.getBoolean("server_useauth_" + order, true), !prefs.getBoolean("server_disableauth_" + order, false),
prefs.getString("server_user_" + order, null), prefs.getString("server_user_" + order, null),
prefs.getString("server_pass_" + order, null), prefs.getString("server_pass_" + order, null),
prefs.getString("server_extrapass_" + order, null), prefs.getString("server_extrapass_" + order, null),
@ -145,7 +145,7 @@ public class ApplicationSettings {
edit.putBoolean("server_ssltrustall_" + i, prefs.getBoolean("server_ssltrustall_" + (i + 1), false)); edit.putBoolean("server_ssltrustall_" + i, prefs.getBoolean("server_ssltrustall_" + (i + 1), false));
edit.putString("server_ssltrustkey_" + i, prefs.getString("server_ssltrustkey_" + (i + 1), null)); edit.putString("server_ssltrustkey_" + i, prefs.getString("server_ssltrustkey_" + (i + 1), null));
edit.putString("server_folder_" + i, prefs.getString("server_folder_" + (i + 1), null)); edit.putString("server_folder_" + i, prefs.getString("server_folder_" + (i + 1), null));
edit.putBoolean("server_useauth_" + i, prefs.getBoolean("server_useauth_" + (i + 1), true)); edit.putBoolean("server_disableauth_" + i, prefs.getBoolean("server_disableauth_" + (i + 1), false));
edit.putString("server_user_" + i, prefs.getString("server_user_" + (i + 1), null)); edit.putString("server_user_" + i, prefs.getString("server_user_" + (i + 1), null));
edit.putString("server_pass_" + i, prefs.getString("server_pass_" + (i + 1), null)); edit.putString("server_pass_" + i, prefs.getString("server_pass_" + (i + 1), null));
edit.putString("server_extrapass_" + i, prefs.getString("server_extrapass_" + (i + 1), null)); edit.putString("server_extrapass_" + i, prefs.getString("server_extrapass_" + (i + 1), null));
@ -169,7 +169,7 @@ public class ApplicationSettings {
edit.remove("server_ssltrustall_" + max); edit.remove("server_ssltrustall_" + max);
edit.remove("server_ssltrustkey_" + max); edit.remove("server_ssltrustkey_" + max);
edit.remove("server_folder_" + max); edit.remove("server_folder_" + max);
edit.remove("server_useauth_" + max); edit.remove("server_disableauth_" + max);
edit.remove("server_user_" + max); edit.remove("server_user_" + max);
edit.remove("server_pass_" + max); edit.remove("server_pass_" + max);
edit.remove("server_extrapass_" + max); edit.remove("server_extrapass_" + max);

2
core/src/org/transdroid/core/gui/settings/ServerSettingsActivity.java

@ -67,9 +67,11 @@ public class ServerSettingsActivity extends KeyBoundPreferencesActivity {
downloadDir = initTextPreference("server_downloaddir"); downloadDir = initTextPreference("server_downloaddir");
initTextPreference("server_ftpurl"); initTextPreference("server_ftpurl");
initTextPreference("server_ftppass"); initTextPreference("server_ftppass");
initBooleanPreference("server_disableauth");
initBooleanPreference("server_sslenabled"); initBooleanPreference("server_sslenabled");
initBooleanPreference("server_ssltrustall", false, "server_sslenabled"); initBooleanPreference("server_ssltrustall", false, "server_sslenabled");
initTextPreference("server_ssltrustkey", null, "server_sslenabled"); initTextPreference("server_ssltrustkey", null, "server_sslenabled");
onPreferencesChanged();
} }

Loading…
Cancel
Save