issue #313 closed

parent fe325bdc
......@@ -82,7 +82,7 @@ public final class PCBcontext {
@Override
public void change(User updatedStudent, JSONObject license) {
try {
if (!license.getBoolean("isValid")) {
if (!license.getBoolean("isValid") && license.getBoolean("isTrial")) {
AlertDialog.Builder builder1 = new AlertDialog.Builder(activityContext);
builder1.setMessage(R.string.loginNoLicenseMsg);
builder1.setPositiveButton(
......
......@@ -101,7 +101,7 @@ public class StudentFragmentGrid extends Fragment {
else {
// 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());
builder1.setMessage(R.string.loginNoLicenseMsg);
builder1.setPositiveButton(
......@@ -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
// Checks if license is trial or pro (not expired)
if(!st.getJSONObject("license").getBoolean("isValid"))
licenseStudents[i] = "expired";
else if(st.getJSONObject("license").getBoolean("isTrial"))
licenseStudents[i] = "trial";
else if(st.getJSONObject("license").getBoolean("isOfficial"))
licenseStudents[i] = "pro";
Log.i("Test", licenseStudents[i]);
licenseStudents[i] = !st.getJSONObject("license").getBoolean("isValid")
? (st.getJSONObject("license").getBoolean("isTrial")
? "expired_trial"
: "expired_official")
: st.getJSONObject("license").getBoolean("isTrial")
? "trial"
: "pro";
} catch (JSONException e) {
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