mirror of
https://codeberg.org/SeedDMS/paperless
synced 2025-06-18 03:09:02 +00:00
check if jwt secret is set and issue a warning if not
This commit is contained in:
parent
d07399d8b0
commit
a13b19bf34
|
@ -22,12 +22,37 @@ class SeedDMS_ExtPaperless extends SeedDMS_ExtBase { /* {{{ */
|
||||||
*/
|
*/
|
||||||
function init() { /* {{{ */
|
function init() { /* {{{ */
|
||||||
$GLOBALS['SEEDDMS_HOOKS']['initRestAPI'][] = new SeedDMS_ExtPaperless_RestAPI;
|
$GLOBALS['SEEDDMS_HOOKS']['initRestAPI'][] = new SeedDMS_ExtPaperless_RestAPI;
|
||||||
|
$GLOBALS['SEEDDMS_HOOKS']['view']['settings'][] = new SeedDMS_ExtPaperless_Settings;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function main() { /* {{{ */
|
function main() { /* {{{ */
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class containing method for checking the configuration
|
||||||
|
*
|
||||||
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
||||||
|
* @package SeedDMS
|
||||||
|
* @subpackage paperless
|
||||||
|
*/
|
||||||
|
class SeedDMS_ExtPaperless_Settings { /* {{{ */
|
||||||
|
/**
|
||||||
|
* Hook for checking the configuration
|
||||||
|
*
|
||||||
|
* This hook is not called if the extension isn't enabled
|
||||||
|
*/
|
||||||
|
function checkConfig($view, $extname, $conf) {
|
||||||
|
$settings = $view->getParam('settings');
|
||||||
|
if($extname != 'paperless')
|
||||||
|
return;
|
||||||
|
if(empty($settings->_extensions['paperless']['jwtsecret'])) {
|
||||||
|
echo $view->contentSubHeading(getMLText($extname));
|
||||||
|
echo $view->warningMsg(getMLText('paperless_jwtsecret_not_set'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user