diff --git a/cache/timer.yaml b/cache/timer.yaml index a474e94..9ebc917 100644 --- a/cache/timer.yaml +++ b/cache/timer.yaml @@ -1,2 +1,2 @@ licenseupdate: 1751827655 -refreshnavi: 1752466762 +refreshnavi: 1752870527 diff --git a/system/typemill/Controllers/ControllerWebFrontend.php b/system/typemill/Controllers/ControllerWebFrontend.php index 7f77a76..7830ec8 100644 --- a/system/typemill/Controllers/ControllerWebFrontend.php +++ b/system/typemill/Controllers/ControllerWebFrontend.php @@ -343,6 +343,12 @@ class ControllerWebFrontend extends Controller $assets->addMeta('twitter_card',''); } + $notice = $this->missingRessources(); + if($notice !== false) + { + $contentHtml = $notice . $contentHtml; + } + $pagedata = [ 'home' => $home, 'navigation' => $liveNavigation, @@ -470,4 +476,18 @@ class ControllerWebFrontend extends Controller return $restrictionNotice; } + + private function missingRessources() + { + $prothemes = ['lume', 'guide', 'pilot']; + $theme = $this->settings['theme']; + $license = $this->settings['license'] ?? false; + if(in_array($theme, $prothemes) && !$license) + { + $notice = '

Resources are missing for this theme.

'; + return $notice; + } + + return false; + } } \ No newline at end of file diff --git a/system/typemill/Models/License.php b/system/typemill/Models/License.php index 4475bc8..32c8c4b 100644 --- a/system/typemill/Models/License.php +++ b/system/typemill/Models/License.php @@ -537,97 +537,6 @@ class License return $responseJson; } - private function callLicenseServerOld( $licensedata, $url ) - { - $authstring = $this->getPublicKeyPem(); - - if(!$authstring) - { - $this->message = Translations::translate('Please check if there is a readable file public_key.pem in your settings folder.'); - - return false; - } - - $authstring = hash('sha256', substr($authstring, 0, 50)); - - $postdata = http_build_query($licensedata); - - if(in_array('curl', get_loaded_extensions())) - { - $curl = curl_init($url); - if (defined('CURLSSLOPT_NATIVE_CA') && version_compare(curl_version()['version'], '7.71', '>=')) - { - curl_setopt($curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA); - } - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); - curl_setopt($curl, CURLOPT_HTTPHEADER, array( -# "Content-Type: application/x-www-form-urlencoded", - "Content-Type: application/json", - "Accept: application/json", - "Authorization: $authstring", - "Connection: close" - )); - - $response = curl_exec($curl); - - if (curl_errno($curl)) - { - $this->message = Translations::translate('We got a curl error: ') . curl_error($curl); - - return false; - } - - curl_close($curl); - } - else - { - $options = array ( - 'http' => array ( - 'method' => 'POST', - 'ignore_errors' => true, - 'header' => "Content-Type: application/x-www-form-urlencoded\r\n" . - "Accept: application/json\r\n" . - "Authorization: $authstring\r\n" . - "Connection: close\r\n", - 'content' => $postdata - ) - ); - - $context = stream_context_create($options); - - $response = file_get_contents($url, false, $context); - - if ($response === FALSE) - { - if (!empty($http_response_header)) - { - list($version, $status_code, $msg) = explode(' ', $http_response_header[0], 3); - - $this->message = Translations::translate('We got an error from file_get_contents: ') . $status_code . ' ' . $msg; - } - else - { - $this->message = Translations::translate('No HTTP response received or file_get_contents is blocked.'); - } - - return false; - } - } - - $responseJson = json_decode($response,true); - - if(isset($responseJson['code'])) - { - $this->message = $responseJson['code']; - - return false; - } - - return $responseJson; - } - public function hashMail(string $mail) { return hash('sha256', trim($mail) . 'TYla5xa8JUur');