mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 21:51:32 +00:00
more settings to disable import and download of extensions
This commit is contained in:
parent
9f618c5437
commit
da0f5d3053
|
@ -4,6 +4,7 @@
|
||||||
- fix sending of some notification mails to groups
|
- fix sending of some notification mails to groups
|
||||||
- major overhaul of notifications
|
- major overhaul of notifications
|
||||||
- check view access for FolderAccess and DocumentAccess
|
- check view access for FolderAccess and DocumentAccess
|
||||||
|
- more settings to disable import and download of extensions
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.23
|
Changes in version 5.1.23
|
||||||
|
|
|
@ -218,6 +218,12 @@ class Settings { /* {{{ */
|
||||||
var $_calendarDefaultView = "y";
|
var $_calendarDefaultView = "y";
|
||||||
// first day of the week (0=sunday, 1=monday, 6=saturday)
|
// first day of the week (0=sunday, 1=monday, 6=saturday)
|
||||||
var $_firstDayOfWeek = 0;
|
var $_firstDayOfWeek = 0;
|
||||||
|
// enable/disable download of extensions
|
||||||
|
var $_enableExtensionDownload = true;
|
||||||
|
// enable/disable import of extensions
|
||||||
|
var $_enableExtensionImport = true;
|
||||||
|
// enable/disable import of extensions from repository
|
||||||
|
var $_enableExtensionImportFromRepository = true;
|
||||||
// enable/disable display of the clipboard
|
// enable/disable display of the clipboard
|
||||||
var $_enableClipboard = true;
|
var $_enableClipboard = true;
|
||||||
// enable/disable list of tasks in main menu
|
// enable/disable list of tasks in main menu
|
||||||
|
@ -521,7 +527,7 @@ class Settings { /* {{{ */
|
||||||
$this->_expandFolderTree = intval($tab["expandFolderTree"]);
|
$this->_expandFolderTree = intval($tab["expandFolderTree"]);
|
||||||
$this->_defaultDocPosition = strval($tab["defaultDocPosition"]);
|
$this->_defaultDocPosition = strval($tab["defaultDocPosition"]);
|
||||||
|
|
||||||
// XML Path: /configuration/site/calendar
|
// XML Path: /configuration/site/webdav
|
||||||
$node = $xml->xpath('/configuration/site/webdav');
|
$node = $xml->xpath('/configuration/site/webdav');
|
||||||
if($node) {
|
if($node) {
|
||||||
$tab = $node[0]->attributes();
|
$tab = $node[0]->attributes();
|
||||||
|
@ -537,6 +543,15 @@ class Settings { /* {{{ */
|
||||||
$this->_firstDayOfWeek = intval($tab["firstDayOfWeek"]);
|
$this->_firstDayOfWeek = intval($tab["firstDayOfWeek"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XML Path: /configuration/site/extensionmgr
|
||||||
|
$node = $xml->xpath('/configuration/site/extensionmgr');
|
||||||
|
if($node) {
|
||||||
|
$tab = $node[0]->attributes();
|
||||||
|
$this->_enableExtensionDownload = Settings::boolVal($tab["enableExtensionDownload"]);
|
||||||
|
$this->_enableExtensionImport = Settings::boolVal($tab["enableExtensionImport"]);
|
||||||
|
$this->_enableExtensionImportFromRepository = Settings::boolVal($tab["enableExtensionImportFromRepository"]);
|
||||||
|
}
|
||||||
|
|
||||||
// XML Path: /configuration/system/server
|
// XML Path: /configuration/system/server
|
||||||
$node = $xml->xpath('/configuration/system/server');
|
$node = $xml->xpath('/configuration/system/server');
|
||||||
if($node) {
|
if($node) {
|
||||||
|
@ -890,7 +905,7 @@ class Settings { /* {{{ */
|
||||||
$this->setXMLAttributValue($node, "sortFoldersDefault", $this->_sortFoldersDefault);
|
$this->setXMLAttributValue($node, "sortFoldersDefault", $this->_sortFoldersDefault);
|
||||||
$this->setXMLAttributValue($node, "defaultDocPosition", $this->_defaultDocPosition);
|
$this->setXMLAttributValue($node, "defaultDocPosition", $this->_defaultDocPosition);
|
||||||
|
|
||||||
// XML Path: /configuration/site/calendar
|
// XML Path: /configuration/site/webdav
|
||||||
$node = $this->getXMLNode($xml, '/configuration/site', 'webdav');
|
$node = $this->getXMLNode($xml, '/configuration/site', 'webdav');
|
||||||
$this->setXMLAttributValue($node, "enableWebdavReplaceDoc", $this->_enableWebdavReplaceDoc);
|
$this->setXMLAttributValue($node, "enableWebdavReplaceDoc", $this->_enableWebdavReplaceDoc);
|
||||||
|
|
||||||
|
@ -900,6 +915,12 @@ class Settings { /* {{{ */
|
||||||
$this->setXMLAttributValue($node, "calendarDefaultView", $this->_calendarDefaultView);
|
$this->setXMLAttributValue($node, "calendarDefaultView", $this->_calendarDefaultView);
|
||||||
$this->setXMLAttributValue($node, "firstDayOfWeek", $this->_firstDayOfWeek);
|
$this->setXMLAttributValue($node, "firstDayOfWeek", $this->_firstDayOfWeek);
|
||||||
|
|
||||||
|
// XML Path: /configuration/site/extensionmgr
|
||||||
|
$node = $this->getXMLNode($xml, '/configuration/site', 'extensionmgr');
|
||||||
|
$this->setXMLAttributValue($node, "enableExtensionDownload", $this->_enableExtensionDownload);
|
||||||
|
$this->setXMLAttributValue($node, "enableExtensionImport", $this->_enableExtensionImport);
|
||||||
|
$this->setXMLAttributValue($node, "enableExtensionImportFromRepository", $this->_enableExtensionImportFromRepository);
|
||||||
|
|
||||||
// XML Path: /configuration/system/server
|
// XML Path: /configuration/system/server
|
||||||
$this->getXMLNode($xml, '/configuration', 'system');
|
$this->getXMLNode($xml, '/configuration', 'system');
|
||||||
$node = $this->getXMLNode($xml, '/configuration/system', 'server');
|
$node = $this->getXMLNode($xml, '/configuration/system', 'server');
|
||||||
|
|
|
@ -45,6 +45,9 @@ else $currenttab=NULL;
|
||||||
|
|
||||||
// Download extension -------------------------------------------------------
|
// Download extension -------------------------------------------------------
|
||||||
if ($action == "download") { /* {{{ */
|
if ($action == "download") { /* {{{ */
|
||||||
|
if(!$settings->_enableExtensionDownload) {
|
||||||
|
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||||
|
}
|
||||||
if (!isset($_POST["extname"])) {
|
if (!isset($_POST["extname"])) {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
|
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
|
||||||
}
|
}
|
||||||
|
@ -72,6 +75,9 @@ elseif ($action == "refresh") { /* {{{ */
|
||||||
header("Location:../out/out.ExtensionMgr.php?currenttab=".$currenttab);
|
header("Location:../out/out.ExtensionMgr.php?currenttab=".$currenttab);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
elseif ($action == "upload") { /* {{{ */
|
elseif ($action == "upload") { /* {{{ */
|
||||||
|
if(!$settings->_enableExtensionImport) {
|
||||||
|
UI::exitError(getMLText("admin_tools"),getMLText("extension_mgr_upload_disabled"));
|
||||||
|
}
|
||||||
if(!$extMgr->isWritableExtDir()) {
|
if(!$extMgr->isWritableExtDir()) {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("extension_mgr_no_upload"));
|
UI::exitError(getMLText("admin_tools"),getMLText("extension_mgr_no_upload"));
|
||||||
}
|
}
|
||||||
|
@ -92,6 +98,9 @@ elseif ($action == "upload") { /* {{{ */
|
||||||
header("Location:../out/out.ExtensionMgr.php?currenttab=".$currenttab);
|
header("Location:../out/out.ExtensionMgr.php?currenttab=".$currenttab);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
elseif ($action == "import") { /* {{{ */
|
elseif ($action == "import") { /* {{{ */
|
||||||
|
if(!$settings->_enableExtensionImportFromRepository) {
|
||||||
|
UI::exitError(getMLText("admin_tools"),getMLText("extension_mgr_upload_disabled"));
|
||||||
|
}
|
||||||
if(!$_POST['url']) {
|
if(!$_POST['url']) {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,6 +158,11 @@ if ($action == "saveSettings")
|
||||||
setStrValue("calendarDefaultView");
|
setStrValue("calendarDefaultView");
|
||||||
setIntValue("firstDayOfWeek");
|
setIntValue("firstDayOfWeek");
|
||||||
|
|
||||||
|
// SETTINGS - SITE - EXTENSIONMGR
|
||||||
|
setBoolValue("enableExtensionDownload");
|
||||||
|
setBoolValue("enableExtensionImport");
|
||||||
|
setBoolValue("enableExtensionImportFromRepository");
|
||||||
|
|
||||||
// SETTINGS - SYSTEM - SERVER
|
// SETTINGS - SYSTEM - SERVER
|
||||||
setDirValue("rootDir");
|
setDirValue("rootDir");
|
||||||
setStrValue("httpRoot");
|
setStrValue("httpRoot");
|
||||||
|
|
|
@ -218,7 +218,8 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
|
||||||
}
|
}
|
||||||
if($extconf['config'])
|
if($extconf['config'])
|
||||||
echo "<a href=\"../out/out.Settings.php?currenttab=extensions#".$extname."\" title=\"".getMLText('configure_extension')."\"><i class=\"fa fa-cogs\"></i></a>";
|
echo "<a href=\"../out/out.Settings.php?currenttab=extensions#".$extname."\" title=\"".getMLText('configure_extension')."\"><i class=\"fa fa-cogs\"></i></a>";
|
||||||
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$extname."-download\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"download\" /><input type=\"hidden\" name=\"extname\" value=\"".$extname."\" /><a class=\"download\" data-extname=\"".$extname."\" title=\"".getMLText('download_extension')."\"><i class=\"fa fa-download\"></i></a></form>";
|
if($settings->_enableExtensionDownload)
|
||||||
|
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$extname."-download\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"download\" /><input type=\"hidden\" name=\"extname\" value=\"".$extname."\" /><a class=\"download\" data-extname=\"".$extname."\" title=\"".getMLText('download_extension')."\"><i class=\"fa fa-download\"></i></a></form>";
|
||||||
if(!$settings->extensionIsDisabled($extname)) {
|
if(!$settings->extensionIsDisabled($extname)) {
|
||||||
echo ' <a href="#" class="toggle" data-extname="'.$extname.'" title="'.getMLText('disable_extension').'"><i class="fa fa-check"</i></a>';
|
echo ' <a href="#" class="toggle" data-extname="'.$extname.'" title="'.getMLText('disable_extension').'"><i class="fa fa-check"</i></a>';
|
||||||
} else {
|
} else {
|
||||||
|
@ -250,7 +251,7 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
|
||||||
$this->contentHeading(getMLText("extension_manager"));
|
$this->contentHeading(getMLText("extension_manager"));
|
||||||
$this->rowStart();
|
$this->rowStart();
|
||||||
$this->columnStart(4);
|
$this->columnStart(4);
|
||||||
if($extmgr->isWritableExtDir()) {
|
if($settings->_enableExtensionImport && $extmgr->isWritableExtDir()) {
|
||||||
?>
|
?>
|
||||||
<form class="form-horizontal" method="post" enctype="multipart/form-data" action="../op/op.ExtensionMgr.php">
|
<form class="form-horizontal" method="post" enctype="multipart/form-data" action="../op/op.ExtensionMgr.php">
|
||||||
<?= createHiddenFieldWithKey('extensionmgr') ?>
|
<?= createHiddenFieldWithKey('extensionmgr') ?>
|
||||||
|
@ -265,7 +266,10 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
echo "<div class=\"alert alert-warning\">".getMLText('extension_mgr_no_upload')."</div>";
|
if($settings->_enableExtensionImport)
|
||||||
|
echo "<div class=\"alert alert-warning\">".getMLText('extension_mgr_no_upload')."</div>";
|
||||||
|
else
|
||||||
|
echo "<div class=\"alert alert-warning\">".getMLText('extension_mgr_upload_disabled')."</div>";
|
||||||
}
|
}
|
||||||
$this->columnEnd();
|
$this->columnEnd();
|
||||||
$this->columnStart(8);
|
$this->columnStart(8);
|
||||||
|
@ -324,7 +328,7 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
|
||||||
echo "<div class=\"list-action\">";
|
echo "<div class=\"list-action\">";
|
||||||
echo $this->getModalBoxLink(array('target'=>'extensionInfo', 'remote'=>'out.ExtensionMgr.php?action=info_versions&extensionname='.$re['name'], 'class'=>'', 'title'=>'<i class="fa fa-list-ol"></i>'));
|
echo $this->getModalBoxLink(array('target'=>'extensionInfo', 'remote'=>'out.ExtensionMgr.php?action=info_versions&extensionname='.$re['name'], 'class'=>'', 'title'=>'<i class="fa fa-list-ol"></i>'));
|
||||||
echo $this->getModalBoxLink(array('target'=>'extensionChangelog', 'remote'=>'out.ExtensionMgr.php?action=info_changelog&extensionname='.$re['name'], 'class'=>'', 'title'=>'<i class="fa fa-reorder"></i>'));
|
echo $this->getModalBoxLink(array('target'=>'extensionChangelog', 'remote'=>'out.ExtensionMgr.php?action=info_changelog&extensionname='.$re['name'], 'class'=>'', 'title'=>'<i class="fa fa-reorder"></i>'));
|
||||||
if(!$checkmsgs && $extmgr->isWritableExtDir())
|
if(!$checkmsgs && $settings->_enableExtensionImportFromRepository && $extmgr->isWritableExtDir())
|
||||||
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$re['name']."-import\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"import\" /><input type=\"hidden\" name=\"currenttab\" value=\"repository\" /><input type=\"hidden\" name=\"url\" value=\"".$re['filename']."\" /><a class=\"import\" data-extname=\"".$re['name']."\" title=\"".getMLText('import_extension')."\"><i class=\"fa fa-download\"></i></a></form>";
|
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$re['name']."-import\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"import\" /><input type=\"hidden\" name=\"currenttab\" value=\"repository\" /><input type=\"hidden\" name=\"url\" value=\"".$re['filename']."\" /><a class=\"import\" data-extname=\"".$re['name']."\" title=\"".getMLText('import_extension')."\"><i class=\"fa fa-download\"></i></a></form>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
|
|
|
@ -371,6 +371,14 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
||||||
<?php $this->showConfigCheckbox('settings_enableCalendar', 'enableCalendar'); ?>
|
<?php $this->showConfigCheckbox('settings_enableCalendar', 'enableCalendar'); ?>
|
||||||
<?php $this->showConfigOption('settings_calendarDefaultView', 'calendarDefaultView', array('w'=>'week_view', 'm'=>'month_view', 'y'=>'year_view'), false, true); ?>
|
<?php $this->showConfigOption('settings_calendarDefaultView', 'calendarDefaultView', array('w'=>'week_view', 'm'=>'month_view', 'y'=>'year_view'), false, true); ?>
|
||||||
<?php $this->showConfigOption('settings_firstDayOfWeek', 'firstDayOfWeek', array(' 0'=>'sunday', ' 1'=>'monday', ' 2'=>'tuesday', ' 3'=>'wednesday', ' 4'=>'thursday', ' 5'=>'friday', ' 6'=>'saturday'), false, true); ?>
|
<?php $this->showConfigOption('settings_firstDayOfWeek', 'firstDayOfWeek', array(' 0'=>'sunday', ' 1'=>'monday', ' 2'=>'tuesday', ' 3'=>'wednesday', ' 4'=>'thursday', ' 5'=>'friday', ' 6'=>'saturday'), false, true); ?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
-- SETTINGS - SITE - EXTENSIONMGR
|
||||||
|
-->
|
||||||
|
<?php $this->showConfigHeadline('settings_ExtensionMgr'); ?>
|
||||||
|
<?php $this->showConfigCheckbox('settings_enableExtensionDownload', 'enableExtensionDownload'); ?>
|
||||||
|
<?php $this->showConfigCheckbox('settings_enableExtensionImport', 'enableExtensionImport'); ?>
|
||||||
|
<?php $this->showConfigCheckbox('settings_enableExtensionImportFromRepository', 'enableExtensionImportFromRepository'); ?>
|
||||||
<?php
|
<?php
|
||||||
$this->showEndPaneContent('site', $currenttab);
|
$this->showEndPaneContent('site', $currenttab);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user