Skip to content

Commit 0a212b1

Browse files
committed
Tiny optimization when tpl needs to be loaded in both jailkit plugins.
1 parent cccde33 commit 0a212b1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

server/plugins-available/cron_jailkit_plugin.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ function _setup_jailkit_chroot()
261261
{
262262
global $app, $conf;
263263

264-
$app->load('tpl');
265264

266265
if (isset($this->jailkit_config) && isset($this->jailkit_config['jailkit_hardlinks'])) {
267266
if ($this->jailkit_config['jailkit_hardlinks'] == 'yes') {
@@ -286,6 +285,8 @@ function _setup_jailkit_chroot()
286285
if (!is_dir($this->parent_domain['document_root'].'/etc/jailkit'))
287286
{
288287

288+
$app->load('tpl');
289+
289290
$app->system->create_jailkit_chroot($this->parent_domain['document_root'], $this->jailkit_config['jailkit_chroot_app_sections'], $options);
290291
$app->log("Added jailkit chroot", LOGLEVEL_DEBUG);
291292

server/plugins-available/shelluser_jailkit_plugin.inc.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,6 @@ function _setup_jailkit_chroot()
358358
{
359359
global $app, $conf;
360360

361-
$app->load('tpl');
362-
363361
if (isset($this->jailkit_config) && isset($this->jailkit_config['jailkit_hardlinks'])) {
364362
if ($this->jailkit_config['jailkit_hardlinks'] == 'yes') {
365363
$options = array('hardlink');
@@ -389,6 +387,9 @@ function _setup_jailkit_chroot()
389387
// check if the chroot environment is created yet if not create it with a list of program sections from the config
390388
if (!is_dir($this->data['new']['dir'].'/etc/jailkit'))
391389
{
390+
391+
$app->load('tpl');
392+
392393
$app->system->create_jailkit_chroot($this->data['new']['dir'], $this->jailkit_config['jailkit_chroot_app_sections'], $options);
393394
$app->log("Added jailkit chroot", LOGLEVEL_DEBUG);
394395

0 commit comments

Comments
 (0)