Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show "account is disabled" when account is disabled #14187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/main/java/com/nextcloud/client/NominatimClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.google.gson.annotations.SerializedName
import com.owncloud.android.MainApp
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.internal.http.HTTP_OK
import java.net.HttpURLConnection.HTTP_OK
import java.net.URLEncoder

class NominatimClient constructor(geocoderBaseUrl: String, email: String) {
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/com/owncloud/android/db/UploadResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public enum UploadResult {
CANNOT_CREATE_FILE(20),
LOCAL_STORAGE_NOT_COPIED(21),
QUOTA_EXCEEDED(22),
SAME_FILE_CONFLICT(23);
SAME_FILE_CONFLICT(23),
USER_DISABLED(24);

private final int value;

Expand Down Expand Up @@ -101,6 +102,8 @@ public static UploadResult fromValue(int value) {
return QUOTA_EXCEEDED;
case 23:
return SAME_FILE_CONFLICT;
case 24:
return USER_DISABLED;
}
return UNKNOWN;
}
Expand Down Expand Up @@ -161,6 +164,8 @@ public static UploadResult fromOperationResult(RemoteOperationResult result) {
return CANNOT_CREATE_FILE;
case QUOTA_EXCEEDED:
return QUOTA_EXCEEDED;
case USER_DISABLED:
return USER_DISABLED;
default:
return UNKNOWN;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,10 @@ public void onReceive(Context context, Intent intent) {
case MAINTENANCE_MODE:
showInfoBox(R.string.maintenance_mode);
break;

case USER_DISABLED:
showInfoBox(R.string.disabled_user);
break;

case NO_NETWORK_CONNECTION:
showInfoBox(R.string.offline_mode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ private String getUploadFailedStatusText(UploadResult result) {
case MAINTENANCE_MODE:
status = parentActivity.getString(R.string.maintenance_mode);
break;
case USER_DISABLED:
status = parentActivity.getString(R.string.disabled_user);
break;
case SSL_RECOVERABLE_PEER_UNVERIFIED:
status =
parentActivity.getString(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ String getMessageForResult(RemoteOperationResult result, Resources res) {
} else if (result.getCode() == ResultCode.QUOTA_EXCEEDED) {
message = res.getString(R.string.upload_quota_exceeded);

} else if (result.getCode() == ResultCode.USER_DISABLED) {
message = res.getString(R.string.disabled_user);
}

else if (!TextUtils.isEmpty(result.getHttpPhrase())) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@
<string name="confirmation_remove_files_alert">Do you really want to delete the selected items?</string>
<string name="confirmation_remove_folders_alert">Do you really want to delete the selected items and their contents?</string>
<string name="maintenance_mode">Server is in maintenance mode</string>
<string name="disabled_user">Account is disabled</string>
<string name="offline_mode">No internet connection</string>
<string name="offline_mode_info_title">You\'re Offline, But Work Continues</string>
<string name="offline_mode_info_description">Even without an internet connection, you can organize your folders, create files. Once you\'re back online, your pending actions will automatically sync.</string>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
buildscript {
ext {
androidLibraryVersion ="638326e14bc234ca3285852af461d41e6e08d1aa"
androidLibraryVersion ="d46ecea34cec32a0a4cd43a0be7a1aa42ea6bd5b"
androidPluginVersion = '8.7.3'
androidxMediaVersion = '1.4.1'
androidxTestVersion = "1.6.1"
Expand Down
Loading