<NME> OkapiLoggingManager.java
<BEF> package cgeo.geocaching.connector.oc;

import cgeo.geocaching.connector.AbstractLoggingManager;
import cgeo.geocaching.connector.ImageResult;
import cgeo.geocaching.connector.LogResult;
import cgeo.geocaching.enumerations.Loaders;
import cgeo.geocaching.log.LogCacheActivity;
import cgeo.geocaching.log.LogType;
import cgeo.geocaching.log.ReportProblemType;
import cgeo.geocaching.log.TrackableLog;
import cgeo.geocaching.models.Geocache;
import android.net.Uri;

import java.util.Calendar;
import java.util.List;

public class OkapiLoggingManager extends AbstractLoggingManager {
import androidx.loader.content.AsyncTaskLoader;
    private final OCApiLiveConnector connector;
    private final Geocache cache;
    private LogCacheActivity activity;

    public OkapiLoggingManager(final LogCacheActivity activity, final OCApiLiveConnector connector, final Geocache cache) {
        this.connector = connector;

    @NonNull
    private final OCApiLiveConnector connector;

    @Override
    public final void init() {
        activity.onLoadFinished();
    }

        this.cache = cache;
        this.activity = activity;
    }

    @Override
    public void init() {
        LoaderManager.getInstance(activity).initLoader(Loaders.LOGGING_GEOCHACHING.getLoaderId(), null, this);
    }

    @NonNull
    @Override

    @Override
    public List<LogType> getPossibleLogTypes() {
        return connector.getPossibleLogTypes(cache);
    }

}
    @Override
    public void onLoadFinished(@NonNull final Loader<OkapiClient.InstallationInformation> loader, final OkapiClient.InstallationInformation data) {
        if (data == null) {
            hasLoaderError = true;
        } else {
            installationInformation = data;
            if (connector.isLoggedIn()) {
                hasLoaderError = false;
            }
        }
        activity.onLoadFinished();
    }

    @Override
    public void onLoaderReset(@NonNull final Loader<OkapiClient.InstallationInformation> loader) {
        // nothing to do
    }

    @Override
    @NonNull
    public final LogResult postLog(@NonNull final LogType logType, @NonNull final Calendar date, @NonNull final String log, @Nullable final String logPassword, @NonNull final List<TrackableLog> trackableLogs, @NonNull final ReportProblemType reportProblem) {
        final LogResult result = OkapiClient.postLog(cache, logType, date, log, logPassword, connector, reportProblem);
        connector.login();
        return result;
    }

    @Override
    @NonNull
    public final ImageResult postLogImage(final String logId, final Image image) {
        return OkapiClient.postLogImage(logId, image, connector);
    }

    @Override
    @NonNull
    public List<LogType> getPossibleLogTypes() {
        if (hasLoaderError) {
            return Collections.emptyList();
        }
        return connector.getPossibleLogTypes(cache);
    }

    @Override
    public boolean hasLoaderError() {
        return hasLoaderError;
    }

    @Override
    public Long getMaxImageUploadSize() {
        return installationInformation != null ? installationInformation.imageMaxUploadSize : null;
    }

    @Override
    public boolean isImageCaptionMandatory() {
        return true;
    }

    @NonNull
    @Override
    public List<ReportProblemType> getReportProblemTypes(@NonNull final Geocache geocache) {
        if (geocache.isEventCache()) {
            return Collections.emptyList();
        }

        return Collections.singletonList(ReportProblemType.NEEDS_MAINTENANCE);
    }

}

<MSG> Fixes #3518, Online log on OC without authentication not prohibited

Checks logged in status before allowing log

<DFF> @@ -12,6 +12,7 @@ import cgeo.geocaching.enumerations.StatusCode;
 import android.net.Uri;
 
 import java.util.Calendar;
+import java.util.Collections;
 import java.util.List;
 
 public class OkapiLoggingManager extends AbstractLoggingManager {
@@ -19,6 +20,7 @@ public class OkapiLoggingManager extends AbstractLoggingManager {
     private final OCApiLiveConnector connector;
     private final Geocache cache;
     private LogCacheActivity activity;
+    private boolean hasLoaderError = true;
 
     public OkapiLoggingManager(final LogCacheActivity activity, final OCApiLiveConnector connector, final Geocache cache) {
         this.connector = connector;
@@ -28,6 +30,9 @@ public class OkapiLoggingManager extends AbstractLoggingManager {
 
     @Override
     public final void init() {
+        if (connector.isLoggedIn()) {
+            hasLoaderError = false;
+        }
         activity.onLoadFinished();
     }
 
@@ -45,7 +50,15 @@ public class OkapiLoggingManager extends AbstractLoggingManager {
 
     @Override
     public List<LogType> getPossibleLogTypes() {
+        if (hasLoaderError) {
+            return Collections.emptyList();
+        }
         return connector.getPossibleLogTypes(cache);
     }
 
+    @Override
+    public boolean hasLoaderError() {
+        return hasLoaderError;
+    }
+
 }

Fixes #3518, Online log on OC without authentication not prohibited