Skip to content

Commit

Permalink
Fixed issue: [security]Admin user without permissions can still see p…
Browse files Browse the repository at this point in the history
…lugins page - kindly reported by Pavol Michalec & Frederik Koľbík
  • Loading branch information
c-schmitz committed Aug 27, 2019
1 parent 287e52e commit c3f0156
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/controllers/admin/PluginManagerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public function init()
*/
public function index()
{
if (!Permission::model()->hasGlobalPermission('settings', 'read')) {
Yii::app()->setFlashMessage(gT("No permission"), 'error');
$this->getController()->redirect(array('/admin'));
}
$oPluginManager = App()->getPluginManager();

// Scan the plugins folder.
Expand Down Expand Up @@ -73,10 +77,6 @@ function ($installedPlugin) {
$aData['fullpagebar']['returnbutton']['text'] = gT('Return to admin home');
$aData['data'] = $data;
$this->_renderWrappedTemplate('pluginmanager', 'index', $aData);
if (!Permission::model()->hasGlobalPermission('settings', 'read')) {
Yii::app()->setFlashMessage(gT("No permission"), 'error');
$this->getController()->redirect(array('/admin'));
}
}

/**
Expand Down

0 comments on commit c3f0156

Please sign in to comment.