mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 18:29:23 +02:00
fixed basic auth
This commit is contained in:
parent
dec2e84b5f
commit
557d938a55
3 changed files with 25 additions and 12 deletions
|
@ -138,18 +138,25 @@ public class AuthenticationActivity extends Activity {
|
|||
setContentView(R.layout.authentication);
|
||||
|
||||
final Intent intent = getIntent();
|
||||
myLink = Util.linkByIntent(intent);
|
||||
if (myLink == null) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
setResult(RESULT_CANCELED, Util.intentByLink(new Intent(), myLink));
|
||||
|
||||
final String host = intent.getStringExtra(HOST_KEY);
|
||||
final String area = intent.getStringExtra(AREA_KEY);
|
||||
final String username = intent.getStringExtra(USERNAME_KEY);
|
||||
final String error = intent.getStringExtra(ERROR_KEY);
|
||||
myCustomAuthentication = intent.getBooleanExtra(CUSTOM_AUTH_KEY, false);
|
||||
|
||||
if (myCustomAuthentication) {
|
||||
myLink = Util.linkByIntent(intent);
|
||||
if (myLink == null) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
setResult(RESULT_CANCELED, Util.intentByLink(new Intent(), myLink));
|
||||
} else {
|
||||
myLink = null;
|
||||
setResult(RESULT_CANCELED);
|
||||
}
|
||||
|
||||
myOnSuccessRunnable = ourOnSuccessRunnableMap.remove(intent.getLongExtra(RUNNABLE_KEY, -1));
|
||||
|
||||
myResource = ZLResource.resource("dialog").getResource("AuthenticationDialog");
|
||||
|
@ -201,9 +208,11 @@ public class AuthenticationActivity extends Activity {
|
|||
public void onClick(View v) {
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
final NetworkAuthenticationManager mgr = myLink.authenticationManager();
|
||||
if (mgr.mayBeAuthorised(false)) {
|
||||
mgr.logOut();
|
||||
if (myLink != null) {
|
||||
final NetworkAuthenticationManager mgr = myLink.authenticationManager();
|
||||
if (mgr.mayBeAuthorised(false)) {
|
||||
mgr.logOut();
|
||||
}
|
||||
}
|
||||
final NetworkLibrary library = NetworkLibrary.Instance();
|
||||
library.invalidateVisibility();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue