mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-04 15:44:07 +01:00
* [DEV] New Plugin infraestructure (work in progress).
This commit is contained in:
@@ -29,9 +29,11 @@ use SP\Controller\RequestControllerTrait;
|
||||
use SP\Core\Exceptions\SPException;
|
||||
use SP\Core\Plugin\PluginDataStore;
|
||||
use SP\Core\Session as CoreSession;
|
||||
use SP\Core\Session;
|
||||
use SP\DataModel\PluginData;
|
||||
use SP\Http\Request;
|
||||
use SP\Mgmt\Plugins\Plugin;
|
||||
use SP\Util\Checks;
|
||||
use SP\Util\Json;
|
||||
|
||||
/**
|
||||
@@ -94,6 +96,11 @@ class ActionController implements ItemControllerInterface
|
||||
Json::returnJson($this->jsonResponse);
|
||||
}
|
||||
|
||||
if (Checks::demoIsEnabled()) {
|
||||
$this->jsonResponse->setDescription(_('Ey, esto es una DEMO!!'));
|
||||
Json::returnJson($this->jsonResponse);
|
||||
}
|
||||
|
||||
try {
|
||||
$data = $this->Plugin->getData();
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class AuthenticatorPlugin extends PluginBase
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
if ($this->data === null) {
|
||||
if (!is_array($this->data)) {
|
||||
$this->data = [];
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class PreferencesController
|
||||
$base = $this->Plugin->getThemeDir() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'userpreferences';
|
||||
|
||||
// Datos del plugin
|
||||
$pluginData = $this->Plugin->getData();
|
||||
$pluginData = $this->Plugin->getData() ?: [];
|
||||
|
||||
// Datos del usuario de la sesión
|
||||
$UserData = $this->Controller->getUserData();
|
||||
|
||||
@@ -135,6 +135,7 @@ class Acl implements ActionsInterface
|
||||
return ($curUserProfile->isMgmCategories() || $curUserProfile->isMgmCustomers());
|
||||
case self::ACTION_CFG:
|
||||
return ($curUserProfile->isConfigGeneral() || $curUserProfile->isConfigEncryption() || $curUserProfile->isConfigBackup() || $curUserProfile->isConfigImport());
|
||||
case self::ACTION_MGM_PLUGINS:
|
||||
case self::ACTION_CFG_GENERAL:
|
||||
return $curUserProfile->isConfigGeneral();
|
||||
case self::ACTION_CFG_IMPORT:
|
||||
|
||||
Reference in New Issue
Block a user