Auto expire a site if they move to a different web host

All licenses are created by domain. That means that if your client decides to move the files and database to another host without letting you know, they will work on that new host. If you'd like to decrease the chance that your clients will steal the site code, you can add a block to the site.

Version 2.81+

  1. Open the stconfig.php file of the site.

  2. Change the line:

    $ipblock = "";

    to:

    $ipblock = "123.45.67.890";

    Where 123.45.67.890 is the IP address of your server. If a customer moves the files to another server, the IP addresses will not match and this will trigger the error checking.

  3. Optional! Change the line:

    $blockdisableslock = "no";

    to:

    $blockdisableslock = "yes";

    Only if you want the system to pull out the unlock code if someone tries to move the site to another server. Keep in mind that this completely disables the site if the IP addresses change, so please use with caution and make sure your web host does not change IP addresses.

  4. Optional! Change the line:

    $expiredays = 0;

    to:

    $expiredays = 30;

    Changing 30 to the days in which the site will expire after entering the first item.

  5. Save the file.

Version 2.72

You will need to add code to show an error message and/or remove the license code if the client tries to move the files to another host.

  1. Open the stconfig.php file of the site.

  2. Add the following code all the way at the bottom of the page, right before the ?> tag:

    // Enter IP address of server to restrict to that IP.
    $ipblock = "";
    // Change to "yes" to remove unlock code if expired or IP is incorrect.
    // Use with caution - this will disable the store until unlock is reentered.
    $blockdisableslock = "no";
    $ipdiemsg = "";
    if (!empty($ipblock) AND $_SERVER['SERVER_ADDR'] != $ipblock)
    $expipdiemsg = "Incor" ."rect ser" ."ver. Ple" ."ase cont" ."act admi" ."nistrator.";
    if ($blockdisableslock == "yes" AND !empty($expipdiemsg))
    {
    $randupdquery = "UPDATE " .SB_DB_PREFIX ."_vars SET OpenSet='" .md5(rand(5, 20)) ."'";
    $randupdresult = mysql_query($randupdquery, $dblink);
    }
    if (!empty($ipdiemsg))
    die($ipdiemsg);
  3. Change the line:

    $ipblock = "";

    to:

    $ipblock = "123.45.67.890";

    Where 123.45.67.890 is the IP address of your server. If a customer moves the files to another server, the IP addresses will not match and this will trigger the error checking.

  4. Optional! Change the line:

    $blockdisableslock = "no";

    to:

    $blockdisableslock = "yes";

    Only if you want the system to pull out the unlock code if someone tries to move the site to another server. Keep in mind that this completely disables the site if the IP addresses change, so please use with caution and make sure your web host does not change IP addresses.

  5. Save the file.

Please note that this is not a fool proof method of stopping someone from moving files. However, it will keep most clients from moving the code to a new site without your permission.