fixed security issue where auth key was accidentaly on disk, fixed download info bug

pull/5/head
Felix Prahl-Kamps 2018-07-19 20:54:36 +02:00
parent c488106230
commit 93f4c5b1a9
4 changed files with 13 additions and 28 deletions

View File

@ -164,7 +164,10 @@ public class CredentialsActivity extends AppCompatActivity implements View.OnCli
}
if (myUser != null) {
myUser.clearForStorage();
preferenceManager.setMyUser(myUser);
}
if (myOrganisation != null) {
@ -243,20 +246,13 @@ public class CredentialsActivity extends AppCompatActivity implements View.OnCli
private void downloadOrgInfo() {
if (myOrganisation != null) {
DialogInterface.OnClickListener pos = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
downloadOrgInfo();
}
};
new DialogFactory(this).createOverrideDialog(pos, null).show();
} else {
downloadOrgInfo();
}
if (!validCredentials()) {

View File

@ -91,7 +91,7 @@ public class MainActivity extends AppCompatActivity {
emptyPartnerListView = findViewById(R.id.empty);
syncedPartnerRecyclerView = findViewById(R.id.recyclerView);
syncedPartnerAdapter = new SyncedPartnerAdapter(this, syncedPartnerList);
syncedPartnerAdapter = new SyncedPartnerAdapter(syncedPartnerList);
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
syncedPartnerRecyclerView.setLayoutManager(mLayoutManager);
syncedPartnerRecyclerView.setItemAnimator(new DefaultItemAnimator());

View File

@ -36,13 +36,11 @@ public class Organisation {
private int createdBy;
private int userCount;
public Organisation() {
}
public Organisation() {}
public Organisation(JSONObject json) throws JSONException {
fromJSON(json);
}
public void fromJSON(JSONObject org) throws JSONException {
id = org.optInt(ID_KEY, -1);
@ -65,7 +63,6 @@ public class Organisation {
public JSONObject toJSON() {
return toJSON(false);
}
public JSONObject toJSON(boolean minimal) {
JSONObject org = new JSONObject();
@ -99,7 +96,6 @@ public class Organisation {
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
@ -107,7 +103,6 @@ public class Organisation {
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@ -115,7 +110,6 @@ public class Organisation {
public String getSector() {
return sector;
}
public void setSector(String sector) {
this.sector = sector;
}
@ -123,7 +117,6 @@ public class Organisation {
public String getNationality() {
return nationality;
}
public void setNationality(String nationality) {
this.nationality = nationality;
}
@ -131,7 +124,6 @@ public class Organisation {
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@ -139,7 +131,6 @@ public class Organisation {
public String getDateCreated() {
return dateCreated;
}
public void setDateCreated(String dateCreated) {
this.dateCreated = dateCreated;
}
@ -147,7 +138,6 @@ public class Organisation {
public String getDateModified() {
return dateModified;
}
public void setDateModified(String dateModified) {
this.dateModified = dateModified;
}
@ -155,7 +145,6 @@ public class Organisation {
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@ -163,7 +152,6 @@ public class Organisation {
public String getContacts() {
return contacts;
}
public void setContacts(String contacts) {
this.contacts = contacts;
}
@ -171,7 +159,6 @@ public class Organisation {
public boolean isLocal() {
return local;
}
public void setLocal(boolean local) {
this.local = local;
}
@ -179,7 +166,6 @@ public class Organisation {
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
@ -187,7 +173,6 @@ public class Organisation {
public String getRestrictedToDomain() {
return restrictedToDomain;
}
public void setRestrictedToDomain(String restrictedToDomain) {
this.restrictedToDomain = restrictedToDomain;
}
@ -195,7 +180,6 @@ public class Organisation {
public int getCreatedBy() {
return createdBy;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
@ -203,7 +187,6 @@ public class Organisation {
public int getUserCount() {
return userCount;
}
public void setUserCount(int userCount) {
this.userCount = userCount;
}

View File

@ -63,8 +63,8 @@ public class User {
private String dateCreated;
private String dateModified;
public User() {
}
public User() {}
public User(JSONObject user) throws JSONException {
fromJSON(user);
}
@ -138,6 +138,12 @@ public class User {
return user;
}
public void clearForStorage() {
setAuthkey("");
setGpgKey("");
setCertifPublic("");
}
public int getId() {
return id;