add an option to force settings to users

This commit is contained in:
Simon Vieille 2020-09-24 14:26:25 +02:00
commit c7f9fd1b8b
Signed by untrusted user: deblan
GPG key ID: 03383D15A1D31745
10 changed files with 197 additions and 152 deletions

View file

@ -84,19 +84,20 @@ class JsController extends Controller
$topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]');
$targetBlankApps = $this->config->getAppValueArray('target-blank-apps', '[]');
$useAvatar = $this->config->getAppValueBool('use-avatar', '0');
$isForced = $this->config->getAppValueBool('force', '0');
$avatar = null;
if ($this->user) {
$userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]');
if (!empty($userTopMenuApps)) {
if (!empty($userTopMenuApps) && !$isForced) {
$topMenuApps = $userTopMenuApps;
}
$userTargetBlankMode = $this->config->getUserValueInt($this->user, 'target-blank-mode', '1');
$userTargetBlankApps = $this->config->getUserValueArray($this->user, 'target-blank-apps', '[]');
if (2 === $userTargetBlankMode) {
if (2 === $userTargetBlankMode && !$isForced) {
$targetBlankApps = $userTargetBlankApps;
}