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 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; }