mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-11 10:56:58 +01:00
* [MOD] Code refactoring
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
/**
|
||||
* sysPass
|
||||
*
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org
|
||||
*
|
||||
* This file is part of sysPass.
|
||||
@@ -137,13 +137,10 @@ class ConfigManagerController extends ControllerBase
|
||||
$template->setBase('config');
|
||||
$template->addTemplate('general');
|
||||
|
||||
$userData = $this->session->getUserData();
|
||||
|
||||
$template->assign('langs', SelectItemAdapter::factory(Language::getAvailableLanguages())->getItemsFromArraySelected([$this->configData->getSiteLang()]));
|
||||
$template->assign('themes', SelectItemAdapter::factory($this->theme->getThemesAvailable())->getItemsFromArraySelected([$this->configData->getSiteTheme()]));
|
||||
$template->assign('isDemoMode', $this->configData->isDemoEnabled() && !$userData->getIsAdminApp());
|
||||
$template->assign('isDisabled', $this->configData->isDemoEnabled() && !$userData->getIsAdminApp() ? 'disabled' : '');
|
||||
$template->assign('configData', $this->configData);
|
||||
$template->assign('isDemoMode', $this->configData->isDemoEnabled() && !$this->userData->getIsAdminApp());
|
||||
$template->assign('isDisabled', $this->configData->isDemoEnabled() && !$this->userData->getIsAdminApp() ? 'disabled' : '');
|
||||
|
||||
$template->assign('users', SelectItemAdapter::factory(UserService::getItemsBasic())->getItemsFromModel());
|
||||
$template->assign('userGroups', SelectItemAdapter::factory(UserGroupService::getItemsBasic())->getItemsFromModel());
|
||||
@@ -161,8 +158,6 @@ class ConfigManagerController extends ControllerBase
|
||||
$template->setBase('config');
|
||||
$template->addTemplate('accounts');
|
||||
|
||||
$template->assign('configData', $this->configData);
|
||||
|
||||
return new DataTab(__('Cuentas'), $template);
|
||||
}
|
||||
|
||||
@@ -175,8 +170,6 @@ class ConfigManagerController extends ControllerBase
|
||||
$template->setBase('config');
|
||||
$template->addTemplate('wiki');
|
||||
|
||||
$template->assign('configData', $this->configData);
|
||||
|
||||
return new DataTab(__('Wiki'), $template);
|
||||
}
|
||||
|
||||
@@ -192,7 +185,6 @@ class ConfigManagerController extends ControllerBase
|
||||
$template->addTemplate('ldap');
|
||||
|
||||
$template->assign('ldapIsAvailable', Checks::ldapIsAvailable());
|
||||
$template->assign('configData', $this->configData);
|
||||
$template->assign('userGroups', SelectItemAdapter::factory(UserGroupService::getItemsBasic())->getItemsFromModel());
|
||||
$template->assign('userProfiles', SelectItemAdapter::factory(UserProfileService::getItemsBasic())->getItemsFromModel());
|
||||
|
||||
@@ -211,7 +203,6 @@ class ConfigManagerController extends ControllerBase
|
||||
$template->addTemplate('mail');
|
||||
|
||||
$template->assign('mailSecurity', ['SSL', 'TLS']);
|
||||
$template->assign('configData', $this->configData);
|
||||
$template->assign('userGroups', SelectItemAdapter::factory(UserGroupService::getItemsBasic())->getItemsFromModel());
|
||||
$template->assign('userProfiles', SelectItemAdapter::factory(UserProfileService::getItemsBasic())->getItemsFromModel());
|
||||
|
||||
@@ -231,8 +222,6 @@ class ConfigManagerController extends ControllerBase
|
||||
$template->addTemplate('encryption');
|
||||
|
||||
$template->assign('mailSecurity', ['SSL', 'TLS']);
|
||||
$template->assign('configData', $this->configData);
|
||||
|
||||
$template->assign('numAccounts', $this->dic->get(AccountService::class)->getTotalNumAccounts()->num);
|
||||
$template->assign('taskId', Task::genTaskId('masterpass'));
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
/**
|
||||
* sysPass
|
||||
*
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org
|
||||
*
|
||||
* This file is part of sysPass.
|
||||
@@ -170,8 +170,6 @@ abstract class ControllerBase
|
||||
$this->userProfileData = $this->session->getUserProfile();
|
||||
|
||||
$this->view->assign('timeStart', $this->router->request()->server()->get('REQUEST_TIME_FLOAT'));
|
||||
$this->view->assign('icons', $this->icons);
|
||||
$this->view->assign('SessionUserData', $this->userData);
|
||||
$this->view->assign('queryTimeStart', microtime());
|
||||
$this->view->assign('userId', $this->userData->getId());
|
||||
$this->view->assign('userGroupId', $this->userData->getUserGroupId());
|
||||
@@ -179,6 +177,8 @@ abstract class ControllerBase
|
||||
$this->view->assign('userIsAdminAcc', $this->userData->getIsAdminAcc());
|
||||
$this->view->assign('themeUri', $this->view->getTheme()->getThemeUri());
|
||||
$this->view->assign('isDemo', $this->configData->isDemoEnabled());
|
||||
$this->view->assign('icons', clone $this->icons);
|
||||
$this->view->assign('configData', clone $this->configData);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -97,7 +97,7 @@ class Language
|
||||
$this->session = $session;
|
||||
$this->configData = $config->getConfigData();
|
||||
|
||||
sort(self::$langs);
|
||||
ksort(self::$langs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
/**
|
||||
* sysPass
|
||||
*
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @copyright 2012-2018, Rubén Domínguez nuxsmin@$syspass.org
|
||||
*
|
||||
* This file is part of sysPass.
|
||||
@@ -61,7 +61,7 @@ class SelectItem
|
||||
*/
|
||||
public function __construct($id, $name, $item = null)
|
||||
{
|
||||
$this->id = (int)$id;
|
||||
$this->id = is_numeric($id) ? (int)$id : $id;
|
||||
$this->name = (string)$name;
|
||||
$this->item = $item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user