Your IP : 216.73.216.176


Current Path : /home/semix18/public_html/pogtech.pl/app/core/
Upload File :
Current File : /home/semix18/public_html/pogtech.pl/app/core/license.class.php

<?php /*windu.org core - changing the file or deactivating licenses violate our copyright!*/ class license { public static $buyLicensesLinkPL = 'http://www.windu.org/pobierz-cms'; public static $buyLicensesLinkEN = 'http://www.en.windu.org/download-cms'; private static function _getVariableData() { $variableData = array(); $variableData[updateManagerAbstract::LICENCEIDKEY] = updateManagerAbstract::getLicenceKey(); $variableData[updateManagerAbstract::REVISIONNUMBERKEY] = config::get('revision'); updateManagerAbstract::attachDomainName( $variableData ); updateManagerAbstract::attachSessionToken( $variableData ); return $variableData; } public static function check($strict = false,$activateKey = false) { if (updateManagerAbstract::getLicenceKey()==null) { return FALSE; } $curlObject = new downloadCurl(); if ($activateKey==true) { $curlObject->setUrl( updateManagerAbstract::UPDATEURL . updateManagerAbstract::DOMAINACTIVATIONACTIONANDRESETNAME . '/'); }else{ $curlObject->setUrl( updateManagerAbstract::UPDATEURL . updateManagerAbstract::DOMAINACTIVATIONACTIONNAME . '/'); } $curlObject->setPostData( self::_getVariableData() ); $response = $curlObject->execute(); if( $response === FALSE ){ /*curl unable to retrieve message from server*/ if ($strict or $activateKey) { return FALSE; } return TRUE; }elseif( $response == '1' ){ $licenseType = self::getLicenceType(); if ($licenseType!=null) { config::set(md5('licence'.self::getDomainLink()),$licenseType); } config::set(md5('licenceCheckErrors'.self::getDomainLink()),0); return TRUE; }elseif( $response == '0' ){ $errors = intval(config::get(md5('licenceCheckErrors'.self::getDomainLink()))); if ($errors >3 or $strict or $activateKey){ self::deactivate(); notifyDB::add('admin.notify.activation.filed',notifyDB::STATUS_DANGER,'admin/system/licence/'); config::set(md5('licenceCheckErrors'.self::getDomainLink()),0); } config::set(md5('licenceCheckErrors'.self::getDomainLink()),$errors+1); return FALSE; }elseif ($strict or $activateKey){ return FALSE; }else{ return TRUE; } } public static function noWinduLinkNotify() { if (updateManagerAbstract::getLicenceKey()==null) { return FALSE; } $curlObject = new downloadCurl(); $curlObject->setUrl( updateManagerAbstract::UPDATEURL . updateManagerAbstract::NOWINDULINKNOTIFY . '/'); $curlObject->setPostData( self::_getVariableData() ); return $curlObject->execute(); } public static function getUpdateServerMessage() { if (updateManagerAbstract::getLicenceKey()==null) { return FALSE; } $curlObject = new downloadCurl(); $curlObject->setUrl( updateManagerAbstract::UPDATEURL . updateManagerAbstract::GETUPDATESERVERMESSAGE . '/'); $curlObject->setPostData( self::_getVariableData() ); return $curlObject->execute(); } public static function getFreeLicences() { if (updateManagerAbstract::getLicenceKey()==null) { return FALSE; } $curlObject = new downloadCurl(); $curlObject->setUrl( updateManagerAbstract::UPDATEURL . updateManagerAbstract::FREELICENCESACTIONNAME . '/'); $curlObject->setPostData( self::_getVariableData() ); return $curlObject->execute(); } public static function getLicenceType() { if (updateManagerAbstract::getLicenceKey()==null) { return FALSE; } $curlObject = new downloadCurl(); $curlObject->setUrl( updateManagerAbstract::UPDATEURL . updateManagerAbstract::LICENCETYPEACTIONNAME . '/'); $curlObject->setPostData( self::_getVariableData() ); $response = $curlObject->execute(); if( stripos( $response, 'pro') !== FALSE ) { return 'pro'; } if( stripos( $response, 'plus') !== FALSE ) { return 'plus'; } return 'free'; } public static function getDomainLink() { return str_replace('www.', '', strtolower(HOME)); } public static function get() { $licence = config::get(md5('licence'.self::getDomainLink()),true); return $licence; } public static function hasPro($type = null){ $licence = self::get(); $licenceKey = config::get(md5('licenceKey'.self::getDomainLink()),true); if (count($licenceKey)>0 and is_numeric($licenceKey)) { if($type==null and ($licence=='plus' or $licence=='pro')){ return true; } elseif($licence==$type){ return true; } } return false; } public static function activate($licenseKey) { config::set(md5('licenceKey'.self::getDomainLink()),$licenseKey); if (self::check(true,true)) { return true; } return false; } public static function deactivate() { config::set(md5('licenceKey'.self::getDomainLink()), ''); config::set(md5('licence'.self::getDomainLink()),''); config::set('license', ''); notifyDB::add('admin.notify.deactivation', notifyDB::STATUS_DANGER); } public static function checkWinduLink() { $pageMainContent = str_replace(' ', '', strtolower(file::getExternalFileContent(HOME))); $pattern = '/windu.org/'; if(preg_match_all($pattern, $pageMainContent,$matches)){ return true; }elseif ($pageMainContent==''){ return true; }else{ return false; } } } ?>