details:   https://code.openbravo.com/erp/devel/pi/rev/4fd3512efec0
changeset: 13317:4fd3512efec0
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu Jul 28 08:22:30 2011 +0200
summary:   fixed bug 18101: Refreshed clone instance is not detected as new one

diffstat:

 src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (49 lines):

diff -r 6d392808664f -r 4fd3512efec0 
src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java
--- a/src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java       Thu Jul 
28 02:25:55 2011 +0200
+++ b/src/org/openbravo/erpCommon/obps/ActiveInstanceProcess.java       Thu Jul 
28 08:22:30 2011 +0200
@@ -30,6 +30,7 @@
 import org.openbravo.erpCommon.ad_forms.MaturityLevel;
 import org.openbravo.erpCommon.utility.HttpsUtils;
 import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.erpCommon.utility.SystemInfo;
 import org.openbravo.model.ad.domain.Preference;
 import org.openbravo.model.ad.module.Module;
 import org.openbravo.model.ad.system.System;
@@ -55,11 +56,17 @@
 
     String[] result = null;
 
+    System sys = OBDal.getInstance().get(System.class, "0");
+
     if (!HttpsUtils.isInternetAvailable()) {
       msg.setType("Error");
       msg.setMessage("@WSError@");
       return;
     } else {
+      if (!publicKey.equals(sys.getInstanceKey())) {
+        // Changing license, do not send instance number to get a new one
+        instanceNo = null;
+      }
       result = send(publicKey, purpose, instanceNo, activate);
     }
 
@@ -75,7 +82,7 @@
         msg.setType("Error");
         msg.setMessage("@LicenseWithoutAccessTo@ " + nonAllowedMods);
       } else {
-        System sys = OBDal.getInstance().get(System.class, "0");
+
         sys.setActivationKey(result[1]);
         sys.setInstanceKey(publicKey);
         ActivationKey.setInstance(ak);
@@ -148,6 +155,10 @@
       OBContext.restorePreviousMode();
     }
 
+    content += "&sysId=" + URLEncoder.encode(SystemInfo.getSystemIdentifier(), 
"utf-8");
+    content += "&dbId=" + URLEncoder.encode(SystemInfo.getDBIdentifier(), 
"utf-8");
+    content += "&macId=" + URLEncoder.encode(SystemInfo.getMacAddress(), 
"utf-8");
+
     URL url = new URL(BUTLER_URL);
     try {
       String result = HttpsUtils.sendSecure(url, content);

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to