issue #313 closed

parent fe325bdc
...@@ -82,7 +82,7 @@ public final class PCBcontext { ...@@ -82,7 +82,7 @@ public final class PCBcontext {
@Override @Override
public void change(User updatedStudent, JSONObject license) { public void change(User updatedStudent, JSONObject license) {
try { try {
if (!license.getBoolean("isValid")) { if (!license.getBoolean("isValid") && license.getBoolean("isTrial")) {
AlertDialog.Builder builder1 = new AlertDialog.Builder(activityContext); AlertDialog.Builder builder1 = new AlertDialog.Builder(activityContext);
builder1.setMessage(R.string.loginNoLicenseMsg); builder1.setMessage(R.string.loginNoLicenseMsg);
builder1.setPositiveButton( builder1.setPositiveButton(
......
...@@ -101,7 +101,7 @@ public class StudentFragmentGrid extends Fragment { ...@@ -101,7 +101,7 @@ public class StudentFragmentGrid extends Fragment {
else { else {
// checks if license is valid for this user // checks if license is valid for this user
if(licenseStudents[i].equals("expired")){ if(licenseStudents[i].equals("expired_trial")){
AlertDialog.Builder builder1 = new AlertDialog.Builder(getActivity()); AlertDialog.Builder builder1 = new AlertDialog.Builder(getActivity());
builder1.setMessage(R.string.loginNoLicenseMsg); builder1.setMessage(R.string.loginNoLicenseMsg);
builder1.setPositiveButton( builder1.setPositiveButton(
...@@ -267,13 +267,14 @@ public class StudentFragmentGrid extends Fragment { ...@@ -267,13 +267,14 @@ public class StudentFragmentGrid extends Fragment {
imgs.add(new Img(st_id, st_pic, Img.STUDENT)); //it's required to download student's images imgs.add(new Img(st_id, st_pic, Img.STUDENT)); //it's required to download student's images
// Checks if license is trial or pro (not expired) // Checks if license is trial or pro (not expired)
if(!st.getJSONObject("license").getBoolean("isValid")) licenseStudents[i] = !st.getJSONObject("license").getBoolean("isValid")
licenseStudents[i] = "expired"; ? (st.getJSONObject("license").getBoolean("isTrial")
else if(st.getJSONObject("license").getBoolean("isTrial")) ? "expired_trial"
licenseStudents[i] = "trial"; : "expired_official")
else if(st.getJSONObject("license").getBoolean("isOfficial")) : st.getJSONObject("license").getBoolean("isTrial")
licenseStudents[i] = "pro"; ? "trial"
Log.i("Test", licenseStudents[i]); : "pro";
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment