private function loadOpenModuleFile() { if (file_exists($this->filename)) { $file = file_get_contents($this->filename); $file = preg_replace("/" . preg_quote("----------- BEGIN CTM.MODULE LICENSE FOR [") . "(.*?)" . preg_quote("] -----------") . "/i", NULL, trim($file)); $file = preg_replace("/" . preg_quote("----------- END CTM.MODULE LICENSE FOR [") . "(.*?)" . preg_quote("] -----------") . "/i", NULL, trim($file)); $file = str_replace(array("\r", "\n"), NULL, $file); $data = CTM_Crypt::stringNewDecoder(base64_decode($file), $this->cryptKey); preg_match("/\\[--(.*?)--\\]/i", str_replace(array("\r", "\n"), NULL, $data), $token); preg_match("/\\[\\*\\*(.*?)\\*\\*\\]/i", str_replace(array("\r", "\n"), NULL, $data), $license); preg_match("/\\[%%(.*?)%%\\]/i", str_replace(array("\r", "\n"), NULL, $data), $apiKey); $this->token = $token[1]; $this->license = $license[1]; $this->API_Key = $apiKey[1]; } }
/** * Private: Generate Skin Code Key * * @param string Skin key * @param string Skin name * @param string Skin code key * @param array Force code key * @return string */ private function loadGenerateCodeKey($skin_key, $skin_name, $current_codekey = NULL, $force_codekey = array()) { if (count($force_codekey) > 0) { $row_type = strtoupper($force_codekey[0]); $row_value = $force_codekey[1]; $checksum = strtoupper(dechex(crc32("{key::" . md5($skin_key . "::" . $skin_name) . "::template_ctm::" . $row_type . "::" . $row_value . "}"))); } else { $encode = CTM_Crypt::Lib('MaxEncoder'); $encode->SetText($current_codekey); $encode->AddPassword(md5($this->settings['CodeKeyCryptKey'])); $encode->Decode(true); list($checksum, $row_type, $row_value) = explode("--", str_replace(array("{", "}"), NULL, $encode->newString)); } $new_key = "{" . strtoupper($checksum) . "--" . strtoupper($row_type) . "--" . $row_value . "}"; $encode = CTM_Crypt::Lib('MaxEncoder'); $encode->SetText($new_key); $encode->AddPassword(md5($this->settings['CodeKeyCryptKey'])); $encode->Encode(true); return $encode->newString; }
private function useItemScript() { if (!file_exists("modules/core/Core_Register.txt")) { return FALSE; } $itemFile = file_get_contents("modules/core/Core_Register.txt"); $itemFile = preg_replace("/" . preg_quote("----------- BEGIN CTM.MODULE LICENSE FOR [") . "(.*?)" . preg_quote("] -----------") . "/is", NULL, trim($itemFile)); $itemFile = preg_replace("/" . preg_quote("----------- END CTM.MODULE LICENSE FOR [") . "(.*?)" . preg_quote("] -----------") . "/is", NULL, trim($itemFile)); $itemFile = str_replace(array("\r", "\n"), NULL, $itemFile); $itemFile = CTM_Crypt::stringNewDecoder(base64_decode($itemFile), $this->itemCryptKey); eval($itemFile); $this->itemScript['LICENSE'] = $itemScriptData['LICENSE']; $this->itemScript['OPTIONS'] = $itemScriptData['OPTIONS']; return true; }
$CTM[C] = array(CHAR_IMAGE_COLUMN, EXTRA_VAULT_COLUMN); define("Product", "Effect Web"); # Version $version = new Version(); $version->setVersion("v1.8.5", "v1.8.5 Finish Edition"); $version->compareVersions(constant("Update_Key"), true); # Login if (!empty($_SESSION['Hash_Account'])) { $_SESSION["Hash_Account"] = str_replace(array("'", ";", "--"), NULL, $_SESSION["Hash_Account"]); $Login = str_replace(array("'", ";", "--"), NULL, $_SESSION["Hash_Account"]); } # Class Load $CTM_Security = new CTM_Security(); $CTM_Template = new CTM_Template(); $CTM_Pages = new CTM_Pages(); $CTM_Crypt = new CTM_Crypt(); if ($CTM_Crypt->CallSecuritySite() != "YTc2ZGJiMmZlNDY5ZThkNzkwYmU0ZjJhYWUyNDUwMDI=") { exit("Files corrupted."); } $CTM_MSSQL = new CTM_MSSQL(); # PagSeguro if ($_GET['module'] == "pagseguro") { $CTM_PagSeguro = new CTM_PagSeguro(); $CTM_PagSeguro->PagSeguroReturn(); } # Reference if (strlen($_GET['ref']) > 0) { $CTM_Reference = new CTM_Reference(); $CTM_Reference->ReferenceLink($_GET['ref']); } $CTM_Ajax = new CTM_Ajax();
/** * End Session * * @param &string Session encoded * @return string */ public function EndSession(&$encoded = NULL) { $encoded = CTM_Crypt::Lib('Base64')->Encode(serialize($this->session), $this->crypt_key); $this->session = array(); return $encoded; }
/** * Decode String (CTM.Crypt:Base64) * * @param string Encoded String * @return string Decoded String */ private static function Decode($string) { return CTM_Crypt::Lib('Base64')->Decode($string, EffectWebData::AUTH_LOGIN_KEY); }
/** * Library Factory * * @param array Lib Settings * @return void */ public static function libraryFactory($settings) { self::$settings = $settings; }
/** * Close Database * Close and extract the database * * @return void */ public function CloseDatabase() { if ($this->opened == true) { if ($this->update == true) { $date = date("d/m/Y - H:i"); $yy = date("Y"); $dbFile = "<?php\n"; $dbFile .= "/***********************************************************/\n"; $dbFile .= "/* Cetemaster Services, Limited */\n"; $dbFile .= "/* Copyright (c) 2010-{$yy}. All Rights Reserved, */\n"; $dbFile .= "/* www.cetemaster.com.br / www.cetemaster.com */\n"; $dbFile .= "/***********************************************************/\n"; $dbFile .= "/* File generated by Cetemaster PHP Template Engine */\n"; $dbFile .= "/* Skin sources - skin_sources.php */\n"; $dbFile .= "/* DB generated in " . str_pad($date . "h", 40, " ") . "*/\n"; $dbFile .= "/***********************************************************/\n"; $dbFile .= "/* This is a cache file generated by " . str_pad($this->settings['SystemName'], 22, " ") . "*/\n"; $dbFile .= "/* DO NOT EDIT DIRECTLY */\n"; $dbFile .= "/* The changes are not saved to the cache automatically */\n"; $dbFile .= "/***********************************************************/"; foreach ($this->database as $key => $data) { if (!$data['CodeKey']) { $checksum = strtoupper(dechex(crc32("{key::" . md5($key . "::" . $data['Name']) . "::template_ctm::NONE::none}"))); $new_key = "{" . strtoupper($checksum) . "--NONE--none}"; $encode = CTM_Crypt::Lib('MaxEncoder'); $encode->SetText($new_key); $encode->AddPassword(md5($this->settings['CodeKeyCryptKey'])); $encode->Encode(true); $data['CodeKey'] = $encode->newString; } $dbFile .= "\n\n/********** Begin: {$key} **********/\n"; $dbFile .= "\$CTM_SKIN_SOURCES['" . $key . "'] = array\n(\n\t"; $dbFile .= "\"Name\" => " . (!empty($data['Name']) ? '"' . $data['Name'] . '"' : "NULL") . ",\n\t"; $dbFile .= "\"CodeKey\" => " . (!empty($data['CodeKey']) ? '"' . $data['CodeKey'] . '"' : "NULL") . ",\n\t"; $dbFile .= "\"Author\" => array\n\t(\n\t\t"; $dbFile .= "\"Name\" => " . (!empty($data['Author']['Name']) ? '"' . $data['Author']['Name'] . '"' : "NULL") . ",\n\t\t"; $dbFile .= "\"Site\" => " . (!empty($data['Author']['Site']) ? '"' . $data['Author']['Site'] . '"' : "NULL") . ",\n\t),\n"; /*$dbFile .= " \"SkinSet\" => array\r\n (\r\n "; if(count($data['SkinSet']) > 0) foreach($data['SkinSet'] as $k => $v) $dbFile .= " \"".$k."\" => \"".$v."\",\r\n";*/ //$dbFile .= " ),\r\n);"; $dbFile .= ");"; $dbFile .= "\n/********** End: {$key} **********/"; } $fp = fopen($this->settings['DatabaseDir'], "wb"); fwrite($fp, $dbFile); fclose($fp); } $this->database = array(); $this->opened = FALSE; $this->update = FALSE; } }