Skip to content

Commit

Permalink
fix error when user not login
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmanramsi committed Oct 31, 2024
1 parent cc192dd commit 65294ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 2.0.9.2 : 31 Octover 2024
- Fix error when user not login

### 2.0.9.1 : 31 October 2024
- Allow Journal Manager to enable/disable plugin

Expand Down
5 changes: 4 additions & 1 deletion OjtPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ function getCanEnable() {
function getCanDisable() {
if($this->isCurrentUserAreJournalManager()) return true;

return $this->getRequest()->getUser()->hasRole([ROLE_ID_SITE_ADMIN], CONTEXT_SITE);
$currentUser = $this->getRequest()->getUser();
if(!$currentUser) return false;

return $currentUser->hasRole([ROLE_ID_SITE_ADMIN], CONTEXT_SITE);
}

public function isCurrentUserAreJournalManager()
Expand Down
2 changes: 1 addition & 1 deletion version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<version>
<application>ojtPlugin</application>
<type>plugins.generic</type>
<release>2.0.9.1</release>
<release>2.0.9.2</release>
<date>2024-10-31</date>
<lazy-load>0</lazy-load>
<class>OjtPlugin</class>
Expand Down

0 comments on commit 65294ba

Please sign in to comment.