Advertisement
johnburn

Decoded for: adlan@waraxe.us

Sep 20th, 2011
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 35.29 KB | None | 0 0
  1. <?php
  2.  
  3. function check_template_license($licensekey, $localkey = "") {
  4.     $whmcsurl = "http://www.nextinspire.com/portal/";
  5.     $licensing_secret_key = "2009^0101^%inspi#Re0271";
  6.     $checkdate = date("Ymd");
  7.     $usersip = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
  8.     $localkeydays = 15;
  9.     $allowcheckfaildays = 7;
  10.     $localkeyvalid = false;
  11.     if ($localkey) {
  12.         $localkey = str_replace("\n", "", $localkey);
  13.         $localdata = substr($localkey, 0, strlen($localkey) - 32);
  14.         $md5hash = substr($localkey, strlen($localkey) - 32);
  15.         if ($md5hash == md5($localdata . $licensing_secret_key)) {
  16.             $localdata = strrev($localdata);
  17.             $md5hash = substr($localdata, 0, 32);
  18.             $localdata = substr($localdata, 32);
  19.             $localdata = base64_decode($localdata);
  20.             $localkeyresults = unserialize($localdata);
  21.             $originalcheckdate = $localkeyresults['checkdate'];
  22.             if ($md5hash == md5($originalcheckdate . $licensing_secret_key)) {
  23.                 $localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - $localkeydays, date("Y")));
  24.                 if ($localexpiry < $originalcheckdate) {
  25.                     $localkeyvalid = true;
  26.                     $results = $localkeyresults;
  27.                     $validdomains = explode(",", $results['validdomain']);
  28.                     if (!in_array($_SERVER['SERVER_NAME'], $validdomains)) {
  29.                         $localkeyvalid = false;
  30.                         $localkeyresults['status'] = "Invalid";
  31.                         $results = array();
  32.                     }
  33.                     $validips = explode(",", $results['validip']);
  34.                     if (!in_array($usersip, $validips)) {
  35.                         $localkeyvalid = false;
  36.                         $localkeyresults['status'] = "Invalid";
  37.                         $results = array();
  38.                     }
  39.                     if ($results['validdirectory'] != dirname(__FILE__)) {
  40.                         $localkeyvalid = false;
  41.                         $localkeyresults['status'] = "Invalid";
  42.                         $results = array();
  43.                     }
  44.                 }
  45.             }
  46.         }
  47.     }
  48.     if (!$localkeyvalid) {
  49.         $postfields['licensekey'] = $licensekey;
  50.         $postfields['domain'] = $_SERVER['SERVER_NAME'];
  51.         $postfields['ip'] = $usersip;
  52.         $postfields['dir'] = dirname(__FILE__);
  53.         if (function_exists("curl_exec")) {
  54.             $ch = curl_init();
  55.             curl_setopt($ch, CURLOPT_URL, $whmcsurl . "modules/servers/licensing/verify.php");
  56.             curl_setopt($ch, CURLOPT_POST, 1);
  57.             curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
  58.             curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  59.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  60.             $data = curl_exec($ch);
  61.             curl_close($ch);
  62.         } else {
  63.             $fp = fsockopen($whmcsurl, 80, $errno, $errstr, 5);
  64.             if ($fp) {
  65.                 $querystring = "";
  66.                 foreach($postfields as $k => $v) {
  67.                     $querystring.= "{$k}=" . urlencode($v) . "&";
  68.                 }
  69.                 $header = "POST " . $whmcsurl . "modules/servers/licensing/verify.php HTTP/1.0\r\n";
  70.                 $header.= "Host: " . $whmcsurl . "\r\n";
  71.                 $header.= "Content-type: application/x-www-form-urlencoded\r\n";
  72.                 $header.= "Content-length: " . @strlen(@$querystring) . "\r\n";
  73.                 $header.= "Connection: close\r\n\r\n";
  74.                 $header.= $querystring;
  75.                 $data = "";
  76.                 @stream_set_timeout(@$fp, 20);
  77.                 @fputs(@$fp, @$header);
  78.                 $status = @socket_get_status(@$fp);
  79.                 while (!feof(@$fp) && $status) {
  80.                     $data.= @fgets(@$fp, 1024);
  81.                     $status = @socket_get_status(@$fp);
  82.                 }
  83.                 @fclose(@$fp);
  84.             }
  85.         }
  86.         if (!$data) {
  87.             $localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - ($localkeydays + $allowcheckfaildays), date("Y")));
  88.             if ($localexpiry < $originalcheckdate) {
  89.                 $results = $localkeyresults;
  90.             } else {
  91.                 $results['status'] = "Remote Check Failed";
  92.                 return $results;
  93.             }
  94.         }
  95.         preg_match_all("/<(.*?)>([^<]+)<\\/\\1>/i", $data, $matches);
  96.         $results = array();
  97.         foreach($matches[1] as $k => $v) {
  98.             $results[$v] = $matches[2][$k];
  99.         }
  100.         if ($results['status'] == "Active") {
  101.             $results['checkdate'] = $checkdate;
  102.             $data_encoded = serialize($results);
  103.             $data_encoded = base64_encode($data_encoded);
  104.             $data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;
  105.             $data_encoded = strrev($data_encoded);
  106.             $data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);
  107.             $data_encoded = wordwrap($data_encoded, 80, "\n", true);
  108.             $results['localkey'] = $data_encoded;
  109.         }
  110.         $results['remotecheck'] = true;
  111.     }
  112.     unset($postfields);
  113.     unset($data);
  114.     unset($matches);
  115.     unset($whmcsurl);
  116.     unset($licensing_secret_key);
  117.     unset($checkdate);
  118.     unset($usersip);
  119.     unset($localkeydays);
  120.     unset($allowcheckfaildays);
  121.     unset($md5hash);
  122.     return $results;
  123. }
  124. ini_set("display_errors", 0);
  125. include ("templates/" . $this->_tpl_vars['template'] . "/load_config.php");
  126. if (file_exists("nextinspire/{$template_id}/db_connect.php")) {
  127.     include ("nextinspire/{$template_id}/db_connect.php");
  128. }
  129. $result = mysql_query("SELECT * FROM tblconfiguration WHERE setting='version'");
  130. while ($row = mysql_fetch_array($result)) {
  131.     $whmcs_version = $row['value'];
  132. }
  133. assign("whmcs_version", $whmcs_version);
  134. $result = mysql_query("SELECT * FROM nextinspire_template WHERE id={$template_id}");
  135. while ($row = mysql_fetch_array($result)) {
  136.     $licensekey = $row['license_key'];
  137.     $localkey = $row['local_key'];
  138. }
  139. $results = check_template_license($licensekey, $localkey);
  140. $template_status = $results['status'];
  141. mysql_query("UPDATE nextinspire_template SET template_status = '{$template_status}' WHERE id = {$template_id}");
  142. if ($results['status'] == "Active") {
  143.     if ($results['productid'] == $template_id || $results['productid'] == $site_license) {
  144.         require_once (SMARTY_CORE_DIR . "core.load_plugins.php");
  145.         smarty_core_load_plugins(array("plugins" => array(array("function", "config_load"), array("modifier", "lower", $this->_tpl_vars['template'] . "/header.tpl", 1, false), array("modifier", "file_exists", $this->_tpl_vars['template'] . "/header.tpl", 115, false), array("modifier", "date_format", $this->_tpl_vars['template'] . "/header.tpl", 152, false), array("modifier", "replace", $this->_tpl_vars['template'] . "/header.tpl", 2, false))), $this);
  146.         include ("templates/" . $this->_tpl_vars['template'] . "/specific/config.php");
  147.         if ($template_rev == "01") {
  148.             assign("theme_language", is_array($_tmp = $this->_tpl_vars['language']) ? _run_mod_handler("lower", true, $_tmp) : smarty_modifier_lower($_tmp));
  149.         }
  150.         assign("scheme_language", is_array($_tmp = $this->_tpl_vars['language']) ? _run_mod_handler("lower", true, $_tmp) : smarty_modifier_lower($_tmp));
  151.         if ($default_home != true) {
  152.             $default_home = "default";
  153.         }
  154.         if ($default_support != true) {
  155.             $default_support = "index";
  156.         }
  157.         if ($this->_tpl_vars['filename'] == "cart") {
  158.             assign("orderform_lang", $this->_tpl_vars['gid'] . "\"_\"" . $this->_tpl_vars['scheme_language']);
  159.             assign("orderform_lang", is_array($_tmp = $this->_tpl_vars['orderform_lang']) ? _run_mod_handler("replace", true, $_tmp, "\"_\"", "_") : smarty_modifier_replace($_tmp, "\"_\"", "_"));
  160.             if ((is_array($_tmp = "templates/" . $this->_tpl_vars['template'] . "/extras/products_gid_" . $this->_tpl_vars['orderform_lang'] . ".tpl") ? _run_mod_handler("file_exists", true, $_tmp) : file_exists($_tmp)) || (is_array($_tmp = "templates/" . $this->_tpl_vars['template'] . "/extras/products_gid_" . $this->_tpl_vars['gid'] . ".tpl") ? _run_mod_handler("file_exists", true, $_tmp) : file_exists($_tmp))) {
  161.                 assign("custom_orderform", "1");
  162.             }
  163.             $_from = $this->_tpl_vars['products'];
  164.             if (!is_array($_from) && !is_object($_from)) {
  165.                 settype($_from, "array");
  166.             }
  167.             $this->_foreach['items'] = array("total" => count($_from), "iteration" => 0);
  168.             if (0 < $this->_foreach['items']['total']) {
  169.                 foreach($_from as $Var_6240 => $Var_6312) {
  170.                     ++$this->_foreach['items']['iteration'];
  171.                     if ($this->_foreach['items']['iteration'] == $this->_foreach['items']['total']) {
  172.                         assign("product_count", $this->_foreach['items']['total']);
  173.                     }
  174.                 }
  175.             }
  176.             unset($_from);
  177.         }
  178.         if ($template_rev == "01") {
  179.             if ($this->_tpl_vars['filename'] == $default_home) {
  180.                 assign("theme_division", "home");
  181.                 assign("homepage", true);
  182.             } else if ($this->_tpl_vars['pagetitle'] == $this->_tpl_vars['LANG']['globalsystemname'] || $this->_tpl_vars['filename'] == $default_support) {
  183.                 assign("theme_division", "common");
  184.                 assign("supporthome", true);
  185.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_globalsystemtitle']);
  186.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_globalsystemdescription']);
  187.                 assign("headline_image", "headline_supporthome.jpg");
  188.             } else if ($this->_tpl_vars['filename'] == "announcements") {
  189.                 assign("theme_division", "common");
  190.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_announcementstitle']);
  191.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_announcementsdescription']);
  192.                 assign("headline_image", "headline_announcements.jpg");
  193.             } else if ($this->_tpl_vars['filename'] == "knowledgebase") {
  194.                 assign("theme_division", "common");
  195.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_knowledgebasetitle']);
  196.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_knowledgebasedescription']);
  197.                 assign("headline_image", "headline_knowledgebase.jpg");
  198.             } else if ($this->_tpl_vars['filename'] == "downloads") {
  199.                 assign("theme_division", "common");
  200.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_downloadstitle']);
  201.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_downloadsdescription']);
  202.                 assign("headline_image", "headline_downloads.jpg");
  203.             } else if ($this->_tpl_vars['filename'] == "tutorials") {
  204.                 assign("theme_division", "common");
  205.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_tutorialstitle']);
  206.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_tutorialsdescription']);
  207.                 assign("headline_image", "headline_tutorials.jpg");
  208.             } else if ($this->_tpl_vars['filename'] == "serverstatus") {
  209.                 assign("theme_division", "common");
  210.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_serverstatustitle']);
  211.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_serverstatusdescription']);
  212.                 assign("headline_image", "headline_serverstatus.jpg");
  213.             } else if ($this->_tpl_vars['filename'] == "networkissues") {
  214.                 assign("theme_division", "common");
  215.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_networkissuestitle']);
  216.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_networkissuesdescription']);
  217.                 assign("headline_image", "headline_networkissues.jpg");
  218.             } else if ($this->_tpl_vars['filename'] == "contact") {
  219.                 assign("theme_division", "common");
  220.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_contacttitle']);
  221.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_contactdescription']);
  222.                 assign("headline_image", "headline_contact.jpg");
  223.             } else if ($this->_tpl_vars['filename'] == "pwreset") {
  224.                 assign("theme_division", "common");
  225.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_pwresettitle']);
  226.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_pwresetdescription']);
  227.                 assign("headline_image", "headline_pwreset.jpg");
  228.             } else if ($this->_tpl_vars['filename'] == "register") {
  229.                 assign("theme_division", "common");
  230.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_registertitle']);
  231.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_registerdescription']);
  232.                 assign("headline_image", "headline_register.jpg");
  233.             } else if ($this->_tpl_vars['pagetitle'] == $this->_tpl_vars['LANG']['carttitle'] && $this->_tpl_vars['incorrect']) {
  234.                 assign("theme_division", "clientarea");
  235.             } else if ($this->_tpl_vars['filename'] == "clientarea") {
  236.                 assign("theme_division", "clientarea");
  237.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_clientareatitle']);
  238.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_clientareadescription']);
  239.                 assign("headline_image", "headline_clientarea.jpg");
  240.             } else if ($this->_tpl_vars['filename'] == "logout") {
  241.                 assign("theme_division", "clientarea");
  242.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_logouttitle']);
  243.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_logoutdescription']);
  244.                 assign("headline_image", "headline_logout.jpg");
  245.             } else if ($this->_tpl_vars['filename'] == "banned") {
  246.                 assign("theme_division", "clientarea");
  247.                 assign("headline_title", $this->_tpl_vars['LANG']['globalsystemname']);
  248.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_globalsystemdescription']);
  249.                 assign("headline_image", "headline_supporthome.jpg");
  250.             } else if ($this->_tpl_vars['filename'] == "configuressl") {
  251.                 assign("theme_division", "clientarea");
  252.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_configuressltitle']);
  253.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_configuressldescription']);
  254.                 assign("headline_image", "headline_configuressl.jpg");
  255.             } else if ($this->_tpl_vars['filename'] == "affiliates") {
  256.                 assign("theme_division", "clientarea");
  257.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_affiliatestitle']);
  258.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_affiliatesdescription']);
  259.                 assign("headline_image", "headline_affiliates.jpg");
  260.             } else if ($this->_tpl_vars['filename'] == "domainchecker") {
  261.                 assign("theme_division", "order");
  262.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_domaincheckertitle']);
  263.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_domaincheckerdescription']);
  264.                 assign("headline_image", "headline_domainchecker.jpg");
  265.             } else if ($this->_tpl_vars['filename'] == "cart" || $this->_tpl_vars['filename'] == "creditcard" || $this->_tpl_vars['filename'] == "upgrade") {
  266.                 assign("theme_division", "order");
  267.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_ordertitle']);
  268.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_orderdescription']);
  269.                 assign("headline_image", "headline_order.jpg");
  270.             } else if ($this->_tpl_vars['filename'] == "submitticket") {
  271.                 assign("theme_division", "common");
  272.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_supportticketstitle']);
  273.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_supportticketsdescription']);
  274.                 assign("headline_image", "headline_supporttickets.jpg");
  275.             } else if ($this->_tpl_vars['filename'] == "supporttickets" || $this->_tpl_vars['filename'] == "viewticket") {
  276.                 if ($this->_tpl_vars['loggedin']) {
  277.                     assign("theme_division", "clientarea");
  278.                 } else {
  279.                     assign("theme_division", "support");
  280.                 }
  281.                 assign("headline_title", $this->_tpl_vars['LANG']['ii_supportticketstitle']);
  282.                 assign("headline_description", $this->_tpl_vars['LANG']['ii_supportticketsdescription']);
  283.                 assign("headline_image", "headline_supporttickets.jpg");
  284.             }
  285.             if (!(is_array($_tmp = "templates/" . $this->_tpl_vars['template'] . "/images/" . $this->_tpl_vars['headline_image']) ? _run_mod_handler("file_exists", true, $_tmp) : file_exists($_tmp))) {
  286.                 assign("headline_image", "headline_default.jpg");
  287.             }
  288.             if ($this->_tpl_vars['formaction']) {
  289.                 assign("theme_division", "clientarea");
  290.             }
  291.         } else {
  292.             if ($template_rev == "02" || $template_rev == "03" || $template_rev == "04") {
  293.                 if ($this->_tpl_vars['filename'] == $default_home) {
  294.                     assign("page_group", "home");
  295.                     assign("homepage", true);
  296.                 } else if ($this->_tpl_vars['pagetitle'] == $this->_tpl_vars['LANG']['globalsystemname'] || $this->_tpl_vars['filename'] == $default_support) {
  297.                     assign("page_group", "support");
  298.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_globalsystemtitle']);
  299.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_globalsystemdescription']);
  300.                     assign("headline_image", "headline_supporthome.jpg");
  301.                     assign("supporthome", true);
  302.                 } else if ($this->_tpl_vars['filename'] == "announcements") {
  303.                     assign("page_group", "support");
  304.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_announcementstitle']);
  305.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_announcementsdescription']);
  306.                     assign("headline_image", "headline_announcements.jpg");
  307.                 } else if ($this->_tpl_vars['filename'] == "knowledgebase") {
  308.                     assign("page_group", "support");
  309.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_knowledgebasetitle']);
  310.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_knowledgebasedescription']);
  311.                     assign("headline_image", "headline_knowledgebase.jpg");
  312.                 } else if ($this->_tpl_vars['filename'] == "downloads") {
  313.                     assign("page_group", "support");
  314.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_downloadstitle']);
  315.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_downloadsdescription']);
  316.                     assign("headline_image", "headline_downloads.jpg");
  317.                 } else if ($this->_tpl_vars['filename'] == "tutorials") {
  318.                     assign("page_group", "support");
  319.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_tutorialstitle']);
  320.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_tutorialsdescription']);
  321.                     assign("headline_image", "headline_tutorials.jpg");
  322.                 } else if ($this->_tpl_vars['filename'] == "serverstatus") {
  323.                     assign("page_group", "support");
  324.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_serverstatustitle']);
  325.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_serverstatusdescription']);
  326.                     assign("headline_image", "headline_serverstatus.jpg");
  327.                 } else if ($this->_tpl_vars['filename'] == "networkissues") {
  328.                     assign("page_group", "support");
  329.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_networkissuestitle']);
  330.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_networkissuesdescription']);
  331.                     assign("headline_image", "headline_networkissues.jpg");
  332.                 } else if ($this->_tpl_vars['filename'] == "contact") {
  333.                     assign("page_group", "support");
  334.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_contacttitle']);
  335.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_contactdescription']);
  336.                     assign("headline_image", "headline_contact.jpg");
  337.                 } else if ($this->_tpl_vars['filename'] == "pwreset") {
  338.                     assign("page_group", "support");
  339.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_pwresettitle']);
  340.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_pwresetdescription']);
  341.                     assign("headline_image", "headline_pwreset.jpg");
  342.                 } else if ($this->_tpl_vars['filename'] == "register") {
  343.                     assign("page_group", "support");
  344.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_registertitle']);
  345.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_registerdescription']);
  346.                     assign("headline_image", "headline_register.jpg");
  347.                 } else if ($this->_tpl_vars['pagetitle'] == $this->_tpl_vars['LANG']['carttitle'] && $this->_tpl_vars['incorrect']) {
  348.                     assign("page_group", "clientarea");
  349.                 } else if ($this->_tpl_vars['filename'] == "clientarea") {
  350.                     assign("page_group", "clientarea");
  351.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_clientareatitle']);
  352.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_clientareadescription']);
  353.                     assign("headline_image", "headline_clientarea.jpg");
  354.                 } else if ($this->_tpl_vars['filename'] == "logout") {
  355.                     assign("page_group", "clientarea");
  356.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_logouttitle']);
  357.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_logoutdescription']);
  358.                     assign("headline_image", "headline_logout.jpg");
  359.                 } else if ($this->_tpl_vars['filename'] == "banned") {
  360.                     assign("page_group", "clientarea");
  361.                     assign("headline_title", $this->_tpl_vars['LANG']['globalsystemname']);
  362.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_globalsystemdescription']);
  363.                     assign("headline_image", "headline_supporthome.jpg");
  364.                 } else if ($this->_tpl_vars['filename'] == "configuressl") {
  365.                     assign("page_group", "clientarea");
  366.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_configuressltitle']);
  367.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_configuressldescription']);
  368.                     assign("headline_image", "headline_configuressl.jpg");
  369.                 } else if ($this->_tpl_vars['filename'] == "affiliates") {
  370.                     assign("page_group", "clientarea");
  371.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_affiliatestitle']);
  372.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_affiliatesdescription']);
  373.                     assign("headline_image", "headline_affiliates.jpg");
  374.                 } else if ($this->_tpl_vars['filename'] == "domainchecker") {
  375.                     assign("page_group", "order");
  376.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_domaincheckertitle']);
  377.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_domaincheckerdescription']);
  378.                     assign("headline_image", "headline_domainchecker.jpg");
  379.                 } else if ($this->_tpl_vars['filename'] == "cart" || $this->_tpl_vars['filename'] == "creditcard" || $this->_tpl_vars['filename'] == "upgrade") {
  380.                     assign("page_group", "order");
  381.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_ordertitle']);
  382.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_orderdescription']);
  383.                     assign("headline_image", "headline_order.jpg");
  384.                 } else if ($this->_tpl_vars['filename'] == "submitticket") {
  385.                     assign("page_group", "support");
  386.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_supportticketstitle']);
  387.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_supportticketsdescription']);
  388.                     assign("headline_image", "headline_supporttickets.jpg");
  389.                 } else if ($this->_tpl_vars['filename'] == "supporttickets" || $this->_tpl_vars['filename'] == "viewticket") {
  390.                     if ($this->_tpl_vars['loggedin']) {
  391.                         assign("page_group", "clientarea");
  392.                     } else {
  393.                         assign("page_group", "support");
  394.                     }
  395.                     assign("headline_title", $this->_tpl_vars['LANG']['ii_supportticketstitle']);
  396.                     assign("headline_description", $this->_tpl_vars['LANG']['ii_supportticketsdescription']);
  397.                     assign("headline_image", "headline_supporttickets.jpg");
  398.                 }
  399.                 if ($this->_tpl_vars['formaction']) {
  400.                     assign("page_group", "clientarea");
  401.                 }
  402.             } else {
  403.                 if ($this->_tpl_vars['filename'] == $default_home) {
  404.                     assign("page_group", "home");
  405.                     assign("homepage", true);
  406.                 } else if ($this->_tpl_vars['filename'] == $default_support) {
  407.                     assign("page_group", "support");
  408.                     assign("supporthome", true);
  409.                 } else if ($this->_tpl_vars['filename'] == "announcements") {
  410.                     assign("page_group", "support");
  411.                 } else if ($this->_tpl_vars['filename'] == "knowledgebase") {
  412.                     assign("page_group", "support");
  413.                 } else if ($this->_tpl_vars['filename'] == "downloads") {
  414.                     assign("page_group", "support");
  415.                 } else if ($this->_tpl_vars['filename'] == "tutorials") {
  416.                     assign("page_group", "support");
  417.                 } else if ($this->_tpl_vars['filename'] == "serverstatus") {
  418.                     assign("page_group", "support");
  419.                 } else if ($this->_tpl_vars['filename'] == "networkissues") {
  420.                     assign("page_group", "support");
  421.                 } else if ($this->_tpl_vars['filename'] == "contact") {
  422.                     assign("page_group", "support");
  423.                 } else if ($this->_tpl_vars['filename'] == "pwreset") {
  424.                     assign("page_group", "support");
  425.                 } else if ($this->_tpl_vars['filename'] == "register") {
  426.                     assign("page_group", "clientarea");
  427.                 } else if ($this->_tpl_vars['incorrect']) {
  428.                     assign("page_group", "clientarea");
  429.                 } else if ($this->_tpl_vars['filename'] == "clientarea") {
  430.                     assign("page_group", "clientarea");
  431.                 } else if ($this->_tpl_vars['filename'] == "logout") {
  432.                     assign("page_group", "clientarea");
  433.                 } else if ($this->_tpl_vars['filename'] == "banned") {
  434.                     assign("page_group", "clientarea");
  435.                 } else if ($this->_tpl_vars['filename'] == "configuressl") {
  436.                     assign("page_group", "clientarea");
  437.                 } else if ($this->_tpl_vars['filename'] == "affiliates") {
  438.                     assign("page_group", "clientarea");
  439.                 } else if ($this->_tpl_vars['filename'] == "domainchecker") {
  440.                     assign("page_group", "order");
  441.                 } else if ($this->_tpl_vars['filename'] == "cart" || $this->_tpl_vars['filename'] == "creditcard" || $this->_tpl_vars['filename'] == "upgrade") {
  442.                     assign("page_group", "order");
  443.                 } else if ($this->_tpl_vars['filename'] == "submitticket") {
  444.                     assign("page_group", "support");
  445.                 } else if ($this->_tpl_vars['filename'] == "supporttickets" || $this->_tpl_vars['filename'] == "viewticket") {
  446.                     if ($this->_tpl_vars['loggedin']) {
  447.                         assign("page_group", "clientarea");
  448.                     } else {
  449.                         assign("page_group", "support");
  450.                     }
  451.                 }
  452.                 if ($this->_tpl_vars['formaction']) {
  453.                     assign("page_group", "clientarea");
  454.                 }
  455.             }
  456.         }
  457.         if ($template_rev == "01") {
  458.             if ($this->_tpl_vars['theme_division'] == "common") {
  459.                 assign("themecolor", $themecolor_common);
  460.             } else if ($this->_tpl_vars['theme_division'] == "clientarea") {
  461.                 assign("themecolor", $themecolor_clientarea);
  462.             } else if ($this->_tpl_vars['theme_division'] == "order") {
  463.                 assign("themecolor", $themecolor_order);
  464.             } else if (!$this->_tpl_vars['themecolor']) {
  465.                 assign("themecolor", $themecolor_other);
  466.             }
  467.             assign("scheme_path", "schemes/" . $this->_tpl_vars['themecolor']);
  468.         } else {
  469.             if ($default_scheme) {
  470.                 assign("scheme_color", $default_scheme);
  471.             } else if ($this->_tpl_vars['page_group'] == "support") {
  472.                 assign("scheme_color", $scheme_color_support);
  473.             } else if ($this->_tpl_vars['page_group'] == "clientarea") {
  474.                 assign("scheme_color", $scheme_color_clientarea);
  475.             } else if ($this->_tpl_vars['page_group'] == "order") {
  476.                 assign("scheme_color", $scheme_color_order);
  477.             } else if (!$this->_tpl_vars['scheme_color']) {
  478.                 assign("scheme_color", $scheme_color_other);
  479.             }
  480.             assign("scheme_path", "schemes/" . $this->_tpl_vars['scheme_color']);
  481.         }
  482.         assign("site_root", $site_root);
  483.         assign("companyaddress", $companyaddress);
  484.         assign("url_root", $url_root);
  485.         assign("url_whmcs", $url_whmcs);
  486.         assign("url_cart", $url_cart);
  487.         assign("use_ajax_orderform", $use_ajax_orderform);
  488.         assign("load_header", "1");
  489.         assign("load_default_headline", "1");
  490.         assign("load_default_sidemenu", "1");
  491.         assign("load_stylesheet", "templates/" . $this->_tpl_vars['template'] . "/load_stylesheet.php");
  492.         assign("load_headline", "templates/" . $this->_tpl_vars['template'] . "/load_headline.php");
  493.         assign("load_sidemenu", "templates/" . $this->_tpl_vars['template'] . "/load_sidemenu.php");
  494.         assign("load_menuclientinfo", $this->_tpl_vars['template'] . "/nlsmenu/menu_clientinfo.tpl");
  495.         assign("load_menuproductdetails", $this->_tpl_vars['template'] . "/nlsmenu/menu_productdetails.tpl");
  496.         assign("load_menudomaindetails", $this->_tpl_vars['template'] . "/nlsmenu/menu_domaindetails.tpl");
  497.         assign("load_menuaffiliates", $this->_tpl_vars['template'] . "/nlsmenu/menu_affiliates.tpl");
  498.         if ($rtl == "true" || $this->_tpl_vars['scheme_language'] == "arabic" || $this->_tpl_vars['scheme_language'] == "hebrew" || $this->_tpl_vars['scheme_language'] == "persian") {
  499.             assign("rtl", true);
  500.         }
  501.         if (0 <= (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) && (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) <= 11) {
  502.             assign("greeting", $this->_tpl_vars['LANG']['ii_goodmorning']);
  503.         }
  504.         if (12 <= (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) && (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) <= 18) {
  505.             assign("greeting", $this->_tpl_vars['LANG']['ii_goodafternoon']);
  506.         }
  507.         if (19 <= (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) && (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) <= 23) {
  508.             assign("greeting", $this->_tpl_vars['LANG']['ii_goodevening']);
  509.         }
  510.         if (file_exists("nextinspire/{$template_id}/load_{$template_name}.php")) {
  511.             include ("nextinspire/{$template_id}/load_{$template_name}.php");
  512.         }
  513.         if (file_exists("nextinspire/{$template_id}/load_extend.php")) {
  514.             include ("nextinspire/{$template_id}/load_extend.php");
  515.         }
  516.         if (file_exists("nextinspire/{$template_id}/load_customize.php")) {
  517.             include ("nextinspire/{$template_id}/load_customize.php");
  518.         }
  519.         if ($results['localkey']) {
  520.             $localkeydata = $results['localkey'];
  521.             mysql_query("UPDATE nextinspire_template SET local_key = '{$localkeydata}' WHERE id = {$template_id}");
  522.         }
  523.         if (file_exists("nextinspire/{$template_id}/install.php")) {
  524.             echo "<body style=\"margin:0;\"><div style=\"background:#C00; font:700 11px/1.8 Tahoma, Geneva, sans-serif; color:#FFF; text-align:center; padding:10px;\">Security Warning !!<br />The following file needs to be deleted for security reasons before using this template<br />---<br />" . $results['validdirectory'] . "/install.php</div></body>";
  525.             break;
  526.         }
  527.         $_smarty_tpl_vars = $this->_tpl_vars;
  528.         _smarty_include(array("smarty_include_tpl_file" => $this->_tpl_vars['template'] . "/specific/site_header.tpl", "smarty_include_vars" => array()));
  529.         $this->_tpl_vars = $_smarty_tpl_vars;
  530.         unset($_smarty_tpl_vars);
  531.     } else {
  532.         mysql_query("UPDATE nextinspire_template SET template_status = 'Not Match' WHERE id = {$template_id}");
  533.         header("Location: nextinspire/{$template_id}/index.php");
  534.         break;
  535.     }
  536. }
  537. if ($results['status'] == "Invalid") {
  538.     header("Location: nextinspire/{$template_id}/index.php");
  539.     break;
  540. }
  541. if ($results['status'] == "Expired") {
  542.     header("Location: nextinspire/{$template_id}/index.php");
  543.     break;
  544. }
  545. if ($results['status'] == "Suspended") {
  546.     header("Location: nextinspire/{$template_id}/index.php");
  547.     break;
  548. }
  549. if ($results['status'] == "Remote Check Failed") {
  550.     echo "Connection is temporarily interrupted!";
  551.     break;
  552. }
  553. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement