CModule::AddAutoloadClasses($module,array(SIMAITemplateSchool=> classes/general/template.php,)); $opt=COption::GetOptionString($module,register,2); if((!strripos($opt,$_SERVER[SERVER_NAME]))){ require_once($_SERVER[DOCUMENT_ROOT] ./bitrix/license_key.php); $url=http://stat.simai.ru/reg.php; $info=date(F j, Y, g:i a) . . $module . .$_SERVER[SERVER_NAME]; $data=date= .urlencode(date(F j, Y, g:i a)) .&module= .urlencode($module) . &url= .urlencode($_SERVER[SERVER_NAME]) .&active= .md5($LICENSE_KEY); $context=stream_context_create(array(http=>array(header=> User-Agent: Brauzer 2/0 Connection: Close , method=> POST,content=> $data))); $contents=file_get_contents(http://stat.simai.ru/reg.php,false,$context); COption::SetOptionString($module,register,$info); } function encodeSchool($String,$Password){ $Salt=BGuxLWQtKweKEMV4; $StrLen=strlen($String); $Seq=$Password; $Gamma=; while(strlen($Gamma)<$StrLen){ $Seq=pack(H*,sha1($Gamma .$Seq .$Salt)); $Gamma.=substr($Seq,0,8);} return $String^$Gamma;} class SIMAISearchSchool{ static function GetInclude($path,$mode){ $path=substr(__DIR__,0,strripos(__DIR__,/bitrix)+1) .SITE_TEMPLATE_PATH . /framework/ .$path;if((!file_exists($path ./include.php))||$mode){ if($module=substr(__DIR__,strrpos(__DIR__,/)+1)){ $result=; file_put_contents($path ./include.php,$result,FILE_APPEND);}}} static function Search($path,$file){ $string=basename($file); if($string[0]!= _){ if(is_dir($file)){ $files=array(); $dir=opendir($file); while($item=readdir($dir)){ if($item == .|| $item == ..) continue; $files[]=$item;} closedir($dir); sort($files); foreach($files as $item){ self::Search($path,$file ./ .$item); } }else{ if(is_file($file)){ $ext=pathinfo(basename($file),PATHINFO_EXTENSION); if(file_exists($file ..php)){ $tmp=file_get_contents($file ..php,true); $newpath=substr($file,strripos($file,/bitrix),strlen($file)); $result=str_replace(CurrentPath,$newpath,$tmp); file_put_contents($path ./include.php,$result,FILE_APPEND); }else{ $file=substr($file,strripos($file,/bitrix),strlen($file)); if($ext== css){$result=$APPLICATION->SetAdditionalCss(" .$file .", true); ; file_put_contents($path ./include.php,$result,FILE_APPEND); }else if($ext== js){ $result=$APPLICATION->AddHeadScript(" .$file .", true); ; file_put_contents($path ./include.php, $result,FILE_APPEND); } } } } } } } if(defined($module ._DEMO)&& constant($module ._DEMO)== Y){ $date=COption::GetOptionString($module,XDKL7,); $date=base64_decode($date); $date=strtotime(encodeSchool($date,B*k1E9NO)*QY)); $sec=$date-time()+(30*24*60*60); $GLOBALS[DEMODAYS]=(int)($sec/(24*60*60));}"