Skip to content

Commit

Permalink
Version 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
magenizr committed Mar 1, 2024
1 parent 0b94d30 commit c9b0b43
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @category Magenizr
* @package Magenizr_Envbar
* @copyright Copyright (c) 2020 Magenizr (https://www.Magenizr.com)
* @copyright Copyright (c) 2020 Magenizr (https://www.magenizr.com.au)
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ If you experience any issues, don't hesitate to open an issue on [Github](https:
Follow us on [GitHub](https://github.com/magenizr), [Twitter](https://twitter.com/magenizr) and [Facebook](https://www.facebook.com/magenizr).

## History
===== 1.0.6 =====
* Fix member function isSuperUser() on null

===== 1.0.5 =====
* October CMS 3.0 compatibility

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"license": "MIT",
"authors": [
{
"name": "Tobias Forkel",
"email": "tobias@magenizr.com"
"name": "Magenizr",
"email": "support@magenizr.com.au"
}
],
"require": {
Expand Down
2 changes: 1 addition & 1 deletion lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @category Magenizr
* @package Magenizr_Envbar
* @copyright Copyright (c) 2020 Magenizr (https://www.Magenizr.com)
* @copyright Copyright (c) 2020 Magenizr (https://www.magenizr.com.au)
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/

Expand Down
22 changes: 10 additions & 12 deletions models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @category Magenizr
* @package Magenizr_Envbar
* @copyright Copyright (c) 2020 Magenizr (https://www.Magenizr.com)
* @copyright Copyright (c) 2020 Magenizr (https://www.magenizr.com.au)
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/

Expand Down Expand Up @@ -98,7 +98,7 @@ public function afterSave()
*/
public function renderCss()
{
if (! $this->checkPermissions()) {
if (!$this->checkPermissions()) {
return false;
}

Expand All @@ -123,7 +123,7 @@ public function renderCss()
Cache::forever($cacheStyle, $customCss);

} catch (Exception $ex) {
$customCss = '/* '.$ex->getMessage().' */';
$customCss = '/* ' . $ex->getMessage() . ' */';
}

return $customCss;
Expand All @@ -136,20 +136,19 @@ public function renderCss()
*/
private function checkPermissions()
{
if (! $this->enabled) {
if (!$this->enabled) {
return false;
}

if ($this->superuser) {

$isSuperUser = BackendAuth::getUser()->isSuperUser();

if (! $isSuperUser) {
$backendUser = BackendAuth::getUser();
if ($backendUser && !$backendUser->isSuperUser()) {
return false;
}
}

if (! $this->getEnv()) {
if (!$this->getEnv()) {
return false;
}

Expand Down Expand Up @@ -284,11 +283,10 @@ private function compileCss()
'color' => self::get('magenizr_envbar.color', $this->getEnv('color')),
]);

$parser->parse(File::get($lessPath.'/style.less'));
$parser->parse(File::get($lessPath . '/style.less'));

if(!File::exists($this->getPathTemp()))
{
File::makeDirectory( $this->getPathTemp() );
if (!File::exists($this->getPathTemp())) {
File::makeDirectory($this->getPathTemp());
}

return File::put($this->getCssPath(), $parser->getCss());
Expand Down
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ plugin:
description: 'magenizr.envbar::lang.plugin.description'
author: 'Magenizr'
icon: oc-icon-bullhorn
homepage: 'https://www.magenizr.com'
homepage: 'https://www.magenizr.com.au'
4 changes: 4 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
- 'Automatically clear cached styles ( colors ) if `.env` file has been updated.'
1.0.4:
- 'Create temp folder if not exists.'
1.0.5:
- 'October CMS 3.0 compatibility'
1.0.6:
- 'Fix member function isSuperUser() on null'

0 comments on commit c9b0b43

Please sign in to comment.