diff --git a/plugins/housekeeper/DiskUsageDashlet.inc.php b/plugins/housekeeper/DiskUsageDashlet.inc.php index 32f7e56..ba0c402 100755 --- a/plugins/housekeeper/DiskUsageDashlet.inc.php +++ b/plugins/housekeeper/DiskUsageDashlet.inc.php @@ -38,165 +38,54 @@ class DiskUsageDashlet extends KTBaseDashlet { - private $dfCmd; - private $usage; - private $warningPercent; - private $urgentPercent; + private $usage; - function DiskUsageDashlet() - { - $this->sTitle = _kt('Storage Utilization'); - $this->sClass = "ktInfo"; - } - - function is_active($oUser) - { - $dfCmd = KTUtil::findCommand('externalBinary/df','df'); - if ($dfCmd === false) - { - return false; - } - $this->dfCmd = $dfCmd; - - $config = KTConfig::getSingleton(); - $this->warningPercent = $config->get('DiskUsage/warningThreshold', 15); - $this->urgentPercent = $config->get('DiskUsage/urgentThreshold', 5); - - $got_usage = $this->getUsage(); - - if ($got_usage == false) - { - return false; - } - - return Permission::userIsSystemAdministrator(); - } - - function getUsage($refresh=false) - { - if (isset($_SESSION['DiskUsage']['problem'])) - { - return false; - } - - $check = true; - // check if we have a cached result - if (isset($_SESSION['DiskUsage'])) - { - // we will only do the check every 5 minutes - if (time() - $_SESSION['DiskUsage']['time'] < 5 * 60) - { - $check = false; - $this->usage = $_SESSION['DiskUsage']['usage']; - } - } - - // we will only check if the result is not cached, or after 5 minutes - if ($check) - { - $cmd = $this->dfCmd; - - if (OS_WINDOWS) - { - $cmd = str_replace( '/','\\',$cmd); - $res = KTUtil::pexec("\"$cmd\" -B 1 2>&1"); - $result = implode("\r\n",$res['out']); - } - else - { - if(strtolower(PHP_OS) == 'darwin'){ - $result = shell_exec($cmd." -k 2>&1"); - }else{ - $result = shell_exec($cmd." -B 1 2>&1"); - } - } - - if (strpos($result, 'cannot read table of mounted file systems') !== false) - { - $_SESSION['DiskUsage']['problem'] = true; - return false; - } - - - $result = explode("\n", $result); - - unset($result[0]); // gets rid of headings - - $usage=array(); - foreach($result as $line) - { - if (empty($line)) continue; - preg_match('/(.*)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\%\s+(.*)/', $line, $matches); - list($line, $filesystem, $size, $used, $avail, $usedp, $mount) = $matches; - - if ($size === 0) continue; - - if(strtolower(PHP_OS) == 'darwin'){ - $size = $size * 1024; - $used = $used * 1024; - $avail = $avail * 1024; - } - - $colour = ''; - if ($usedp >= 100 - $this->urgentPercent) - { - $colour = 'red'; - } - elseif ($usedp >= 100 - $this->warningPercent) - { - $colour = 'orange'; - } - - $usage[] = array( - 'filesystem'=>$filesystem, - 'size'=>KTUtil::filesizeToString($size), - 'used'=>KTUtil::filesizeToString($used), - 'available'=>KTUtil::filesizeToString($avail), - 'usage'=>$usedp . '%', - 'mounted'=>$mount, - 'colour'=>$colour - ); - } - - $this->usage = $usage; - - $_SESSION['DiskUsage']['time'] = time(); - $_SESSION['DiskUsage']['usage'] = $this->usage; - } + function DiskUsageDashlet() + { + $this->sTitle = _kt('Storage Utilization'); + $this->sClass = "ktInfo"; + } - return true; - } + function is_active($oUser) + { + $usage = unserialize(KTUtil::getSystemSetting('DiskUsage','n/a')); + if ($usage == 'n/a') return false; + $this->usage = $usage; + return Permission::userIsSystemAdministrator(); + } - function render() - { - $oTemplating =& KTTemplating::getSingleton(); - $oTemplate = $oTemplating->loadTemplate('DiskUsage'); + function render() + { + $oTemplating =& KTTemplating::getSingleton(); + $oTemplate = $oTemplating->loadTemplate('DiskUsage'); - $oRegistry =& KTPluginRegistry::getSingleton(); - $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin'); + $oRegistry =& KTPluginRegistry::getSingleton(); + $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin'); - $config = KTConfig::getSingleton(); - $rootUrl = $config->get('KnowledgeTree/rootUrl'); + $config = KTConfig::getSingleton(); + $rootUrl = $config->get('KnowledgeTree/rootUrl'); - $dispatcherURL = $oPlugin->getURLPath('HouseKeeperDispatcher.php'); - if (!empty($rootUrl)) $dispatcherURL = $rootUrl . $dispatcherURL; - $dispatcherURL = str_replace( '\\', '/', $dispatcherURL); + $dispatcherURL = $oPlugin->getURLPath('HouseKeeperDispatcher.php'); + if (!empty($rootUrl)) $dispatcherURL = $rootUrl . $dispatcherURL; + $dispatcherURL = str_replace( '\\', '/', $dispatcherURL); if ( substr( $dispatcherURL, 0,1 ) != '/') - { - $dispatcherURL = '/'.$dispatcherURL; - } + { + $dispatcherURL = '/'.$dispatcherURL; + } + + $warningPercent = $config->get('DiskUsage/warningThreshold', 15); + $urgentPercent = $config->get('DiskUsage/urgentThreshold', 5); - $aTemplateData = array( - 'context' => $this, - 'usages'=>$this->usage, - 'warnPercent'=>$this->warningPercent, - 'urgentPercent'=>$this->urgentPercent, - 'dispatcherURL'=>$dispatcherURL - ); + $aTemplateData = array( + 'context' => $this, + 'usages'=> $this->usage, + 'warnPercent'=>$warningPercent, + 'urgentPercent'=>$urgentPercent, + 'dispatcherURL'=>$dispatcherURL + ); return $oTemplate->render($aTemplateData); } } - ?> diff --git a/plugins/housekeeper/FolderUsageDashlet.inc.php b/plugins/housekeeper/FolderUsageDashlet.inc.php index a8cfd6a..c3c4b7a 100755 --- a/plugins/housekeeper/FolderUsageDashlet.inc.php +++ b/plugins/housekeeper/FolderUsageDashlet.inc.php @@ -38,141 +38,48 @@ class FolderUsageDashlet extends KTBaseDashlet { - private $usage; + private $usage; - function FolderUsageDashlet() - { - $this->sTitle = _kt('System Folder Utilization'); - $this->sClass = "ktInfo"; - } + function FolderUsageDashlet() + { + $this->sTitle = _kt('System Folder Utilization'); + $this->sClass = "ktInfo"; + } - function is_active($oUser) - { - return Permission::userIsSystemAdministrator(); - } + function is_active($oUser) + { + return Permission::userIsSystemAdministrator(); + } - function scanPath($path,$pattern) - { - $files=0; - $filesize=0; + function render() + { + $oTemplating =& KTTemplating::getSingleton(); + $oTemplate = $oTemplating->loadTemplate('FolderUsage'); - if (is_dir($path) && ($dh = opendir($path))) - { - while (($file = readdir($dh)) !== false) - { - if (substr($file,0,1) == '.') - { - continue; - } + $oRegistry =& KTPluginRegistry::getSingleton(); + $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin'); - $full = $path . '/' . $file; + $config = KTConfig::getSingleton(); + $rootUrl = $config->get('KnowledgeTree/rootUrl'); - if (!is_readable($full) || !is_writable($full)) - { - continue; - } - - if (is_dir($full)) - { - $result = $this->scanPath($full,$pattern); - $files += $result['files']; - $filesize += $result['filesize']; - continue; - } - if ($pattern != '') - { - if (preg_match('/' . $pattern . '/', $file) === false) - { - continue; - } - } - - $files++; - $filesize += filesize($full); - } - closedir($dh); - } - return array('files'=>$files,'filesize'=>$filesize,'dir'=>$path); - } - - function getUsage() - { - $check = true; - // check if we have a cached result - if (isset($_SESSION['SystemFolderUsage'])) - { - // we will only do the check every 5 minutes - if (time() - $_SESSION['SystemFolderUsage']['time'] < 5 * 60) - { - $check = false; - $this->usage = $_SESSION['SystemFolderUsage']['usage']; - } - } - - // we will only check if the result is not cached, or after 5 minutes - if ($check) - { - $usage = array(); - - $oRegistry =& KTPluginRegistry::getSingleton(); - $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin'); - - $folders = $oPlugin->getDirectories(); - - foreach($folders as $folder) - { - $directory = $folder['folder']; - $pattern = $folder['pattern']; - $canClean = $folder['canClean']; - $name = $folder['name']; - - $temp = $this->scanPath($directory,$pattern); - - $usage[] = array( - 'description'=>$name, - 'folder'=>$directory, - 'files'=>number_format($temp['files'],0,'.',','), - 'filesize'=>KTUtil::filesizeToString($temp['filesize']), - 'action'=>$i, - 'canClean'=>$canClean - ); - $this->usage = $usage; - } - - $_SESSION['SystemFolderUsage']['time'] = time(); - $_SESSION['SystemFolderUsage']['usage'] = $this->usage; - } - } - - function render() - { - $oTemplating =& KTTemplating::getSingleton(); - $oTemplate = $oTemplating->loadTemplate('FolderUsage'); - - $oRegistry =& KTPluginRegistry::getSingleton(); - $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin'); - - $config = KTConfig::getSingleton(); - $rootUrl = $config->get('KnowledgeTree/rootUrl'); - - $dispatcherURL = $oPlugin->getURLPath('HouseKeeperDispatcher.php'); - if (!empty($rootUrl)) $dispatcherURL = $rootUrl . $dispatcherURL; + $dispatcherURL = $oPlugin->getURLPath('HouseKeeperDispatcher.php'); + if (!empty($rootUrl)) $dispatcherURL = $rootUrl . $dispatcherURL; $dispatcherURL = str_replace( '\\', '/', $dispatcherURL); if ( substr( $dispatcherURL, 0,1 ) != '/') - { - $dispatcherURL = '/'.$dispatcherURL; - } + { + $dispatcherURL = '/'.$dispatcherURL; + } - $this->getUsage(); + $usage = unserialize(KTUtil::getSystemSetting('KTUsage','n/a')); - $aTemplateData = array( - 'context' => $this, - 'usages'=>$this->usage, - 'dispatcherURL'=>$dispatcherURL - ); + $aTemplateData = array( + 'context' => $this, + 'usages'=>$usage, + 'dispatcherURL'=>$dispatcherURL + ); - return $oTemplate->render($aTemplateData); - } + return $oTemplate->render($aTemplateData); + } } diff --git a/plugins/housekeeper/HouseKeeper.inc.php b/plugins/housekeeper/HouseKeeper.inc.php new file mode 100644 index 0000000..4ed8830 --- /dev/null +++ b/plugins/housekeeper/HouseKeeper.inc.php @@ -0,0 +1,350 @@ +. + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * California 94120-7775, or email info@knowledgetree.com. + * + * The interactive user interfaces in modified source and object code versions + * of this program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU General Public License version 3. + * + * In accordance with Section 7(b) of the GNU General Public License version 3, + * these Appropriate Legal Notices must retain the display of the "Powered by + * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices + * must display the words "Powered by KnowledgeTree" and retain the original + * copyright notice. + * Contributor( s): ______________________________________ + * + */ + +class HouseKeeper +{ + public static + function getDiskUsageStats($update = true) + { + $config = KTConfig::getSingleton(); + + $cmd = KTUtil::findCommand('externalBinary/df','df'); + if ($cmd === false) + { + if ($update) + KTUtil::setSystemSetting('DiskUsage','n/a'); + return false; + } + + + $warningPercent = $config->get('DiskUsage/warningThreshold', 15); + $urgentPercent = $config->get('DiskUsage/urgentThreshold', 5); + + if (OS_WINDOWS) + { + $cmd = str_replace( '/','\\',$cmd); + $res = KTUtil::pexec("\"$cmd\" -B 1 2>&1"); + $result = implode("\r\n",$res['out']); + } + else + { + if(strtolower(PHP_OS) == 'darwin'){ + $result = shell_exec($cmd." -k 2>&1"); + }else{ + $result = shell_exec($cmd." -B 1 2>&1"); + } + } + + if (strpos($result, 'cannot read table of mounted file systems') !== false) + { + if ($update) + KTUtil::setSystemSetting('DiskUsage','n/a'); + return false; + } + + $result = explode("\n", $result); + + unset($result[0]); // gets rid of headings + + $usage=array(); + foreach($result as $line) + { + if (empty($line)) continue; + preg_match('/(.*)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\%\s+(.*)/', $line, $matches); + list($line, $filesystem, $size, $used, $avail, $usedp, $mount) = $matches; + + if ($size === 0) continue; + + if(strtolower(PHP_OS) == 'darwin'){ + $size = $size * 1024; + $used = $used * 1024; + $avail = $avail * 1024; + } + + $colour = ''; + if ($usedp >= 100 - $urgentPercent) + { + $colour = 'red'; + } + elseif ($usedp >= 100 - $warningPercent) + { + $colour = 'orange'; + } + + $usage[] = array( + 'filesystem'=>trim($filesystem), + 'size'=>KTUtil::filesizeToString($size), + 'used'=>KTUtil::filesizeToString($used), + 'available'=>KTUtil::filesizeToString($avail), + 'usage'=>$usedp . '%', + 'mounted'=>trim($mount), + 'colour'=>$colour + ); + } + + if ($update) + KTUtil::setSystemSetting('DiskUsage',serialize($usage)); + + return $usage; + } + + private static + function scanPath($path,$pattern) + { + $files=0; + $filesize=0; + + if (is_dir($path) && ($dh = opendir($path))) + { + while (($file = readdir($dh)) !== false) + { + if (substr($file,0,1) == '.') + { + continue; + } + + $full = $path . '/' . $file; + + if (!is_readable($full) || !is_writable($full)) + { + continue; + } + + if (is_dir($full)) + { + $result = self::scanPath($full,$pattern); + $files += $result['files']; + $filesize += $result['filesize']; + continue; + } + if ($pattern != '') + { + if (preg_match('/' . $pattern . '/', $file) === false) + { + continue; + } + } + + $files++; + $filesize += filesize($full); + } + closedir($dh); + } + return array('files'=>$files,'filesize'=>$filesize,'dir'=>$path); + } + + + + private static + function getDirectories() + { + $config = KTConfig::getSingleton(); + $cacheDir = $config->get('cache/cacheDirectory'); + + $tempDir = $config->get('urls/tmpDirectory'); + $logDir = $config->get('urls/logDirectory'); + $docsDir = $config->get('urls/documentRoot'); + + $indexer = Indexer::get(); + $luceneDir = $indexer->getIndexDirectory(); + + $systemDir = OS_UNIX?'/tmp':'c:/windows/temp'; + + $folders = array( + array( + 'name'=>_kt('Smarty Cache'), + 'folder'=>$tempDir, + 'pattern'=>'^%%.*', + 'canClean'=>true + ), + array( + 'name'=>_kt('System Cache'), + 'folder'=>$cacheDir, + 'pattern'=>'', + 'canClean'=>true + ), + array( + 'name'=>_kt('System Logs'), + 'folder'=>$logDir, + 'pattern'=>'.+\.txt$', + 'canClean'=>true + )); + + $folders[] = + array( + 'name'=>_kt('Temporary Folder'), + 'folder'=>$tempDir, + 'pattern'=>'', + 'canClean'=>true + ); + + $folders[] = + array( + 'name'=>_kt('System Temporary Folder'), + 'folder'=>$systemDir, + 'pattern'=>'(sess_.+)?(.+\.log$)?', + 'canClean'=>true + ); + + if (is_dir($docsDir)) + { + $folders[] = + array( + 'name'=>_kt('Documents'), + 'folder'=>$docsDir, + 'pattern'=>'', + 'canClean'=>false + ); + } + + if (is_dir($luceneDir)) + { + $folders[] = + array( + 'name'=>_kt('Document Index'), + 'folder'=>$luceneDir, + 'pattern'=>'', + 'canClean'=>false + ); + + } + return $folders; + } + + + public static + function getKTUsageStats($update = true) + { + $usage = array(); + + $oRegistry =& KTPluginRegistry::getSingleton(); + $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin'); + + $folders = self::getDirectories(); + + foreach($folders as $folder) + { + $directory = $folder['folder']; + $pattern = $folder['pattern']; + $canClean = $folder['canClean']; + $name = $folder['name']; + + $temp = self::scanPath($directory,$pattern); + + $usage[] = array( + 'description'=>$name, + 'folder'=>$directory, + 'files'=>number_format($temp['files'],0,'.',','), + 'filesize'=>KTUtil::filesizeToString($temp['filesize']), + 'action'=>$i, + 'canClean'=>$canClean + ); + } + + if ($update) + KTUtil::setSystemSetting('KTUsage',serialize($usage)); + return $usage; + } + + private static $folders = null; + + public static + function getDirectory($folder) + { + if (is_null(self::$folders)) + { + self::$folders = self::getDirectories(); + } + foreach(self::$folders as $dir) + { + if ($dir['folder'] == $folder) + { + return $dir; + } + } + return null; + } + + + public static + function cleanDirectory($path, $pattern) + { + if (!is_readable($path)) + { + return; + } + if ($dh = opendir($path)) + { + while (($file = readdir($dh)) !== false) + { + if (substr($file,0,1) == '.') + { + continue; + } + + $full = $path . '/' . $file; + if (is_dir($full)) + { + self::cleanDirectory($full,$pattern); + if (is_writable($full)) + { + @rmdir($full); + } + continue; + } + + if (!empty($pattern) && !preg_match('/' . $pattern . '/', $file)) + { + continue; + } + + if (is_writable($full)) + { + @unlink($full); + } + + } + closedir($dh); + } + } + +} + + +?> \ No newline at end of file diff --git a/plugins/housekeeper/HouseKeeperDispatcher.php b/plugins/housekeeper/HouseKeeperDispatcher.php index 1ef53cb..5c72849 100644 --- a/plugins/housekeeper/HouseKeeperDispatcher.php +++ b/plugins/housekeeper/HouseKeeperDispatcher.php @@ -7,31 +7,31 @@ * Document Management Made Simple * Copyright (C) 2008 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ */ @@ -41,85 +41,34 @@ session_start(); require_once("../../config/dmsDefaults.php"); require_once(KT_LIB_DIR . "/templating/templating.inc.php"); require_once(KT_LIB_DIR . "/dispatcher.inc.php"); +require_once('HouseKeeper.inc.php'); class HouseKeeperDispatcher extends KTStandardDispatcher { - function cleanDirectory($path, $pattern) - { - if (!is_readable($path)) - { - return; - } - if ($dh = opendir($path)) - { - while (($file = readdir($dh)) !== false) - { - if (substr($file,0,1) == '.') - { - continue; - } - - $full = $path . '/' . $file; - if (is_dir($full)) - { - $this->cleanDirectory($full,$pattern); - if (is_writable($full)) - { - @rmdir($full); - } - continue; - } - - if (!empty($pattern) && !preg_match('/' . $pattern . '/', $file)) - { - continue; - } - if (is_writable($full)) - { - @unlink($full); - } - - } - closedir($dh); - } - - } - - function do_cleanup() - { - $folder = KTUtil::arrayGet($_REQUEST, 'folder'); - if (is_null($folder)) - { - exit(redirect(generateControllerLink('dashboard'))); - } + function do_cleanup() + { + $folder = KTUtil::arrayGet($_REQUEST, 'folder'); + if (is_null($folder)) + { + exit(redirect(generateControllerLink('dashboard'))); + } - $oRegistry =& KTPluginRegistry::getSingleton(); - $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin'); + $oRegistry =& KTPluginRegistry::getSingleton(); + $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin'); // we must avoid doing anything to the documents folder at all costs! - $folder = $oPlugin->getDirectory($folder); + $folder = HouseKeeper::getDirectory($folder); if (is_null($folder) || !$folder['canClean']) { - exit(redirect(generateControllerLink('dashboard'))); + exit(redirect(generateControllerLink('dashboard'))); } - $this->cleanDirectory($folder['folder'], $folder['pattern']); - - $this->do_refreshFolderUsage(); - } - - function do_refreshDiskUsage() - { - session_unregister('DiskUsage'); - exit(redirect(generateControllerLink('dashboard'))); - } + HouseKeeper::cleanDirectory($folder['folder'], $folder['pattern']); + HouseKeeper::getKTUsageStats(); - function do_refreshFolderUsage() - { - session_unregister('SystemFolderUsage'); - exit(redirect(generateControllerLink('dashboard'))); - } + exit(redirect(generateControllerLink('dashboard'))); + } } $oDispatcher = new HouseKeeperDispatcher(); $oDispatcher->dispatch(); diff --git a/plugins/housekeeper/HouseKeeperPlugin.php b/plugins/housekeeper/HouseKeeperPlugin.php index bc99449..726988f 100755 --- a/plugins/housekeeper/HouseKeeperPlugin.php +++ b/plugins/housekeeper/HouseKeeperPlugin.php @@ -7,31 +7,31 @@ * Document Management Made Simple * Copyright (C) 2008 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ */ @@ -40,118 +40,26 @@ require_once(KT_LIB_DIR . '/plugins/plugin.inc.php'); require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php'); class HouseKeeperPlugin extends KTPlugin - { - var $autoRegister = true; - var $sNamespace = 'ktcore.housekeeper.plugin'; +{ + var $autoRegister = true; + var $sNamespace = 'ktcore.housekeeper.plugin'; - var $folders = array(); + var $folders = array(); - function HouseKeeperPlugin($sFilename = null) - { - parent::KTPlugin($sFilename); + function HouseKeeperPlugin($sFilename = null) + { + parent::KTPlugin($sFilename); $this->sFriendlyName = _kt('Housekeeper'); - - $config = KTConfig::getSingleton(); - $cacheDir = $config->get('cache/cacheDirectory'); - $cacheFile = $cacheDir . '/houseKeeper.folders'; - - if (is_file($cacheFile)) - { - $this->folders = unserialize(file_get_contents($cacheFile)); - return; - } - - $tempDir = $config->get('urls/tmpDirectory'); - $logDir = $config->get('urls/logDirectory'); - $docsDir = $config->get('urls/documentRoot'); - - $indexer = Indexer::get(); - $luceneDir = $indexer->getIndexDirectory(); - - $systemDir = OS_UNIX?'/tmp':'c:/windows/temp'; - - $this->folders = array( - array( - 'name'=>_kt('Smarty Cache'), - 'folder'=>$tempDir, - 'pattern'=>'^%%.*', - 'canClean'=>true - ), - array( - 'name'=>_kt('System Cache'), - 'folder'=>$cacheDir, - 'pattern'=>'', - 'canClean'=>true - ), - array( - 'name'=>_kt('System Logs'), - 'folder'=>$logDir, - 'pattern'=>'.+\.txt$', - 'canClean'=>true - )); - - $this->folders[] = - array( - 'name'=>_kt('System Temporary Folder'), - 'folder'=>$systemDir, - 'pattern'=>'(sess_.+)?(.+\.log$)?', - 'canClean'=>true - ); - - if (is_dir($docsDir)) - { - $this->folders[] = - array( - 'name'=>_kt('Documents'), - 'folder'=>$docsDir, - 'pattern'=>'', - 'canClean'=>false - ); - } - - if (is_dir($luceneDir)) - { - $this->folders[] = - array( - 'name'=>_kt('Document Index'), - 'folder'=>$luceneDir, - 'pattern'=>'', - 'canClean'=>false - ); - - // lets only cache this once it has been resolved! - file_put_contents($cacheFile, serialize($this->folders)); - } - - - - } - - function getDirectories() - { - return $this->folders; - } - - function getDirectory($folder) - { - foreach($this->folders as $dir) - { - if ($dir['folder'] == $folder) - { - return $dir; - } - } - return null; } function setup() { - $this->registerDashlet('DiskUsageDashlet', 'ktcore.diskusage.dashlet', 'DiskUsageDashlet.inc.php'); - $this->registerDashlet('FolderUsageDashlet', 'ktcore.folderusage.dashlet', 'FolderUsageDashlet.inc.php'); + $this->registerDashlet('DiskUsageDashlet', 'ktcore.diskusage.dashlet', 'DiskUsageDashlet.inc.php'); + $this->registerDashlet('FolderUsageDashlet', 'ktcore.folderusage.dashlet', 'FolderUsageDashlet.inc.php'); $oTemplating =& KTTemplating::getSingleton(); - $oTemplating->addLocation('housekeeper', '/plugins/housekeeper/templates'); + $oTemplating->addLocation('housekeeper', '/plugins/housekeeper/templates'); } } diff --git a/plugins/housekeeper/bin/UpdateStats.php b/plugins/housekeeper/bin/UpdateStats.php new file mode 100644 index 0000000..7b0a7db --- /dev/null +++ b/plugins/housekeeper/bin/UpdateStats.php @@ -0,0 +1,47 @@ +. + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * California 94120-7775, or email info@knowledgetree.com. + * + * The interactive user interfaces in modified source and object code versions + * of this program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU General Public License version 3. + * + * In accordance with Section 7(b) of the GNU General Public License version 3, + * these Appropriate Legal Notices must retain the display of the "Powered by + * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices + * must display the words "Powered by KnowledgeTree" and retain the original + * copyright notice. + * Contributor( s): ______________________________________ + * + */ + +chdir(dirname(__FILE__)); +require_once(realpath('../../../config/dmsDefaults.php')); +require_once('../HouseKeeper.inc.php'); + +HouseKeeper::getDiskUsageStats(); +HouseKeeper::getKTUsageStats(); + +?> \ No newline at end of file diff --git a/plugins/housekeeper/templates/DiskUsage.smarty b/plugins/housekeeper/templates/DiskUsage.smarty index 41a1d30..a5f43ad 100755 --- a/plugins/housekeeper/templates/DiskUsage.smarty +++ b/plugins/housekeeper/templates/DiskUsage.smarty @@ -43,5 +43,5 @@ {if $red==1} < {$urgentPercent} % {/if} -{i18n}refresh{/i18n} +  \ No newline at end of file diff --git a/plugins/housekeeper/templates/FolderUsage.smarty b/plugins/housekeeper/templates/FolderUsage.smarty index f948e54..cd1543a 100755 --- a/plugins/housekeeper/templates/FolderUsage.smarty +++ b/plugins/housekeeper/templates/FolderUsage.smarty @@ -30,7 +30,3 @@ function cleanupFolder(path) {/section}
- - - -
{i18n}refresh{/i18n}
diff --git a/sql/mysql/install/data.sql b/sql/mysql/install/data.sql index d8f7cab..d7c3977 100644 --- a/sql/mysql/install/data.sql +++ b/sql/mysql/install/data.sql @@ -121,13 +121,114 @@ UNLOCK TABLES; LOCK TABLES `config_settings` WRITE; /*!40000 ALTER TABLE `config_settings` DISABLE KEYS */; -INSERT INTO `config_settings`(`id`,`group_name`,`item`,`type`,`value`,`helptext`,`default_value`,`can_edit`) VALUES (1,'ui','appName','','KnowledgeTree','OEM application name','KnowledgeTree',1),(2,'KnowledgeTree','schedulerInterval','','30','','30',1),(3,'dashboard','alwaysShowYCOD','boolean','default','Display the \"Your Checked-out Documents\" dashlet even when empty.','0',1),(4,'urls','graphicsUrl','','${rootUrl}/graphics','','${rootUrl}/graphics',1),(5,'urls','uiUrl','','${rootUrl}/presentation/lookAndFeel/knowledgeTree','','${rootUrl}/presentation/lookAndFeel/knowledgeTree',1),(6,'tweaks','browseToUnitFolder','boolean','default','Whether to browse to the user\'s (first) unit when first going to the browse section.','0',1),(7,'tweaks','genericMetaDataRequired','boolean','1','','1',1),(8,'tweaks','developmentWindowLog','boolean','0','','0',1),(9,'tweaks','noisyBulkOperations','boolean','default','Whether bulk operations should generate a transaction notice on each ; item, or only on the folder. Default of \"false\" indicates that only the folder transaction should occur.','0',1),(10,'email','emailServer','','none','','none',1),(11,'email','emailPort','','default','','',1),(12,'email','emailAuthentication','boolean','0','Do you need auth to connect to SMTP?\r\n','0',1),(13,'email','emailUsername','','username','','username',1),(14,'email','emailPassword','','password','','password',1),(15,'email','emailFrom','','kt@example.org','','kt@example.org',1),(16,'email','emailFromName','','KnowledgeTree Document Management System','','KnowledgeTree Document Management System',1),(17,'email','allowAttachment','boolean','default','Set to true to allow users to send attachments from the document\r\n management system\r\n.','0',1),(18,'email','allowEmailAddresses','boolean','default','Set to true to allow users to send to any email address, as opposed to\r\n only users of the system\r\n.','0',1),(19,'email','sendAsSystem','boolean','default','Set to true to always send email from the emailFrom address listed above, even if there is an identifiable sending user\r\n.','0',1),(20,'email','onlyOwnGroups','boolean','default','Set to true to only allow users to send emails to those in the same\r\n groups as them\r\n.','0',1),(21,'user_prefs','passwordLength','','6','Minimum password length on password-setting\r\n','6',1),(22,'user_prefs','restrictAdminPasswords','boolean','default','Apply the minimum password length to admin while creating / editing accounts?\r\n default is set to \"false\" meaning that admins can create users with shorter passwords.\r\n','0',1), -(23,'user_prefs','restrictPreferences','boolean','0','Restrict users from accessing their preferences menus?\r\n','0',1),(24,'session','sessionTimeout','','1200','Session timeout (in seconds)\r\n','1200',1),(25,'session','allowAnonymousLogin','boolean','0','By default, do not auto-login users as anonymous.\r\n Set this to true if you UNDERSTAND the security system that KT\r\n uses, and have sensibly applied the roles \"Everyone\" and \"Authenticated Users\".\r\n','0',1),(26,'ui','companyLogo','','${rootUrl}/resources/companylogo.png','Add the logo of your company to the site\'s appearance. This logo MUST be 50px tall, and on a white background.\r\n','${rootUrl}/resources/companylogo.png',1),(27,'ui','companyLogoWidth','','313px','The logo\'s width in pixels\r\n','313px',1),(28,'ui','companyLogoTitle','','ACME Corporation','ALT text - for accessibility purposes.\r\n','ACME Corporation',1),(29,'ui','alwaysShowAll','boolean','0','Do not restrict to searches (e.g. always show_all) on users and groups pages.\r\n','0',1),(30,'ui','condensedAdminUI','boolean','0','Use a condensed admin ui\r\n?','0',1),(31,'ui','fakeMimetype','boolean','0','Allow \"open\" from downloads. Changing this to \"true\" will prevent (most)\r\n browsers from giving users the \"open\" option.\r\n','0',1),(32,'ui','metadata_sort','boolean','0','Sort the metadata fields alphabetically\r\n','1',1),(33,'i18n','useLike','boolean','default','If your language doesn\'t have distinguishable words (usually, doesn\'t\r\n have a space character), set useLike to true to use a search that can\r\n deal with this, but which is slower.\r\n','0',1),(34,'import','unzip','','unzip','Unzip command - will use execSearchPath to find if the path to the binary is not given\r\n.','unzip',1),(35,'export','zip','','zip','Zip command - will use execSearchPath to find if the path to the\r\n binary is not given\r\n.','zip',1),(36,'externalBinary','xls2csv','','xls2csv','','xls2csv',1), -(37,'externalBinary','pdftotext','','pdftotext','','pdftotext',1),(38,'externalBinary','catppt','','catppt','','catppt',1),(39,'externalBinary','pstotext','','pstotext','','pstotext',1),(40,'externalBinary','catdoc','','catdoc','','catdoc',1),(41,'externalBinary','antiword','','antiword','','antiword',1),(42,'externalBinary','python','','python','','python',1),(43,'externalBinary','java','','java','','java',1),(44,'externalBinary','php','','php','','php',1),(45,'externalBinary','df','','df','','df',1),(46,'cache','proxyCacheDirectory','','${varDirectory}/proxies','','${varDirectory}/proxies',1),(47,'cache','proxyCacheEnabled','boolean','1','','1',1),(48,'KTWebDAVSettings','debug','','off','This section is for KTWebDAV only, _LOTS_ of debug info will be logged if the following is \"on\"\r\n','off',1),(49,'KTWebDAVSettings','safemode','','on','To allow write access to WebDAV clients set safe mode to \"off\".','on',1),(50,'BaobabSettings','debug','','off','This section is for Baobab only\r\n, _LOTS_ of debug info will be logged if the following is \"on\"\r\n.','off',1),(51,'BaobabSettings','safemode','','on','To allow write access to WebDAV clients set safe mode to \"off\" below\r\n.','on',1),(52,'search','searchBasePath','','${fileSystemRoot}/search2','','${fileSystemRoot}/search2',1),(53,'search','fieldsPath','','${searchBasePath}/search/fields','','${searchBasePath}/search/fields',1),(54,'search','resultsDisplayFormat','','searchengine','The format in which to display the results\r\n options are searchengine or browseview defaults to searchengine\r\n.','searchengine',1),(55,'search','resultsPerPage','','50','The number of results per page\r\n, defaults to 25\r\n','25',1),(56,'search','dateFormat','','Y-m-d','The date format used when making queries using widgets\r\n, defaults to Y-m-d\r\n','Y-m-d',1),(57,'browse','previewActivation','','default','The document info box / preview is activated by mousing over or clicking on the icon\r\n. Options: mouse-over (default) or onclick\r\n.','mouse-over',1), -(58,'indexer','coreClass','','JavaXMLRPCLuceneIndexer','The core indexing class\r\n. Choices: JavaXMLRPCLuceneIndexer or PHPLuceneIndexer.','JavaXMLRPCLuceneIndexer',1),(59,'indexer','batchDocuments','','20','The number of documents to be indexed in a cron session, defaults to 20\r\n.','20',1),(60,'indexer','batchMigrateDocuments','','500','The number of documents to be migrated in a cron session, defaults to 500\r\n.','500',1),(61,'indexer','indexingBasePath','','${searchBasePath}/indexing','','${searchBasePath}/indexing',1),(62,'indexer','luceneDirectory','','${varDirectory}/indexes','The location of the lucene indexes\r\n.','${varDirectory}/indexes',1),(63,'indexer','extractorPath','','${indexingBasePath}/extractors','','${indexingBasePath}/extractors',1),(64,'indexer','extractorHookPath','','${indexingBasePath}/extractorHooks','','${indexingBasePath}/extractorHooks',1),(65,'indexer','javaLuceneURL','','http://127.0.0.1:8875','The url for the Java Lucene Server. This should match up the the Lucene Server configuration. Defaults to http://127.0.0.1:8875\r\n','http://127.0.0.1:8875',1),(66,'openoffice','host','','default','The host on which open office is installed\r\n. Defaults to 127.0.0.1\r\n','127.0.0.1',1),(67,'openoffice','port','','default','The port on which open office is listening. Defaults to 8100\r\n','8100',1),(68,'webservice','uploadDirectory','','${varDirectory}/uploads','Directory to which all uploads via webservices are persisted before moving into the repository\r\n.','${varDirectory}/uploads',1), -(69,'webservice','downloadUrl','','${rootUrl}/ktwebservice/download.php','Url which is sent to clients via web service calls so they can then download file via HTTP GET\r\n.','${rootUrl}/ktwebservice/download.php',1),(70,'webservice','uploadExpiry','','30','Period indicating how long a file should be retained in the uploads directory.\r\n','30',1),(71,'webservice','downloadExpiry','','30','Period indicating how long a download link will be available.','30',1),(72,'webservice','randomKeyText','','bkdfjhg23yskjdhf2iu','Random text used to construct a hash. This can be customised on installations so there is less chance of overlap between installations.\r\n','bkdfjhg23yskjdhf2iu',1),(73,'webservice','validateSessionCount','boolean','0','Validating session counts can interfere with access. It is best to leave this disabled, unless very strict access is required.\r\n','0',1),(74,'webservice','useDefaultDocumentTypeIfInvalid','boolean','1','If the document type is invalid when adding a document, we can be tollerant and just default to the Default document type.\r\n','1',1),(75,'webservice','debug','boolean','0','The web service debugging if the logLevel is set to DEBUG. We can set the value to 4 or 5 to get more verbose web service logging.\r\n Level 4 logs the name of functions being accessed. Level 5 logs the SOAP XML requests and responses.\r\n','0',1),(76,'clientToolPolicies','explorerMetadataCapture','boolean','1','This setting is one of two which control whether or not the client is prompted for metadata when a\r\n document is added to knowledgetree via KTtools. It defaults to true.\r\n','1',1),(77,'clientToolPolicies','officeMetadataCapture','boolean','1','This setting is one of two which control whether or not the client is prompted for metadata when a document is added to knowledgetree via KTtools. It defaults to true.','1',1), -(78,'clientToolPolicies','captureReasonsDelete','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1),(79,'clientToolPolicies','captureReasonsCheckin','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1),(80,'clientToolPolicies','captureReasonsCheckout','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1),(81,'clientToolPolicies','captureReasonsCancelCheckout','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1),(82,'clientToolPolicies','captureReasonsCopyInKT','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1),(83,'clientToolPolicies','captureReasonsMoveInKT','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1), -(84,'clientToolPolicies','allowRememberPassword','boolean','1','This setting governs whether the password can be stored on the client or not.','1',1),(85,'DiskUsage','warningThreshold','','10','When free space in a mount point is less than this percentage, the disk usage dashlet will highlight the mount in ORANGE\r\n.','10',1),(86,'DiskUsage','urgentThreshold','','5','When free space in a mount point is less than this percentage, the disk usage dashlet will highlight the mount in RED\r\n.','5',1),(87,'KnowledgeTree','useNewDashboard','','default','','1',1),(88,'i18n','defaultLanguage','','en','Default language for the interface\r\n.','en',1),(89,'CustomErrorMessages','customerrormessages','','off','Turn custom error messages on or off here','on',1),(90,'CustomErrorMessages','customerrorpagepath','','customerrorpage.php','Name or url of custom error page\r\n.','customerrorpage.php',1),(91,'CustomErrorMessages','customerrorhandler','','off','Turn custom error handler on or off','on',1),(92,'ui','morphEnabled','boolean','0','Enable Morph','0',1),(93,'ui','morphTo','','blue','Morph Theme\r\n','blue',1),(94,'KnowledgeTree','logLevel','','default','Choice: INFO or DEBUG','INFO',1),(95,'storage','manager','','default','','KTOnDiskHashedStorageManager',1),(96,'ui','ieGIF','boolean','0','','1',1),(97,'ui','automaticRefresh','boolean','0','','0',1),(98,'ui','dot','','dot','','dot',1),(99,'tweaks','phpErrorLogFile','boolean','default','If you want to enable PHP error logging to the log/php_error_log file, change this setting to true\r\n.','0',1),(100,'urls','logDirectory','','default','','${varDirectory}/log',1),(101,'urls','uiDirectory','','default','','${fileSystemRoot}/presentation/lookAndFeel/knowledgeTree',1),(102,'urls','tmpDirectory','','default','','${varDirectory}/tmp',1),(103,'urls','stopwordsFile','','default','','${fileSystemRoot}/config/stopwords.txt',1),(104,'cache','cacheEnabled','boolean','default','','0',1),(105,'cache','cacheDirectory','','default','','${varDirectory}/cache',1),(106,'cache','cachePlugins','boolean','default','','1',1),(107,'urls','varDirectory','','default','','${fileSystemRoot}/var',1); +INSERT INTO `config_settings`(`id`,`group_name`,`item`,`type`,`value`,`helptext`,`default_value`,`can_edit`) VALUES +(1,'ui','appName','','KnowledgeTree','OEM application name','KnowledgeTree',1), +(2,'KnowledgeTree','schedulerInterval','','30','','30',1), +(3,'dashboard','alwaysShowYCOD','boolean','default','Display the \"Your Checked-out Documents\" dashlet even when empty.','0',1), +(4,'urls','graphicsUrl','','${rootUrl}/graphics','','${rootUrl}/graphics',1), +(5,'urls','uiUrl','','${rootUrl}/presentation/lookAndFeel/knowledgeTree','','${rootUrl}/presentation/lookAndFeel/knowledgeTree',1), +(6,'tweaks','browseToUnitFolder','boolean','default','Whether to browse to the user\'s (first) unit when first going to the browse section.','0',1), +(7,'tweaks','genericMetaDataRequired','boolean','1','','1',1), +(8,'tweaks','developmentWindowLog','boolean','0','','0',1), +(9,'tweaks','noisyBulkOperations','boolean','default','Whether bulk operations should generate a transaction notice on each ; item, or only on the folder. Default of \"false\" indicates that only the folder transaction should occur.','0',1), +(10,'email','emailServer','','none','','none',1), +(11,'email','emailPort','','default','','',1), +(12,'email','emailAuthentication','boolean','0','Do you need auth to connect to SMTP?\r\n','0',1), +(13,'email','emailUsername','','username','','username',1), +(14,'email','emailPassword','','password','','password',1), +(15,'email','emailFrom','','kt@example.org','','kt@example.org',1), +(16,'email','emailFromName','','KnowledgeTree Document Management System','','KnowledgeTree Document Management System',1), +(17,'email','allowAttachment','boolean','default','Set to true to allow users to send attachments from the document\r\n management system\r\n.','0',1), +(18,'email','allowEmailAddresses','boolean','default','Set to true to allow users to send to any email address, as opposed to\r\n only users of the system\r\n.','0',1),(19,'email','sendAsSystem','boolean','default','Set to true to always send email from the emailFrom address listed above, even if there is an identifiable sending user\r\n.','0',1), +(20,'email','onlyOwnGroups','boolean','default','Set to true to only allow users to send emails to those in the same\r\n groups as them\r\n.','0',1), +(21,'user_prefs','passwordLength','','6','Minimum password length on password-setting\r\n','6',1), +(22,'user_prefs','restrictAdminPasswords','boolean','default','Apply the minimum password length to admin while creating / editing accounts?\r\n default is set to \"false\" meaning that admins can create users with shorter passwords.\r\n','0',1), +(23,'user_prefs','restrictPreferences','boolean','0','Restrict users from accessing their preferences menus?\r\n','0',1), +(24,'session','sessionTimeout','','1200','Session timeout (in seconds)\r\n','1200',1), +(25,'session','allowAnonymousLogin','boolean','0','By default, do not auto-login users as anonymous.\r\n Set this to true if you UNDERSTAND the security system that KT\r\n uses, and have sensibly applied the roles \"Everyone\" and \"Authenticated Users\".\r\n','0',1), +(26,'ui','companyLogo','','${rootUrl}/resources/companylogo.png','Add the logo of your company to the site\'s appearance. This logo MUST be 50px tall, and on a white background.\r\n','${rootUrl}/resources/companylogo.png',1), +(27,'ui','companyLogoWidth','','313px','The logo\'s width in pixels\r\n','313px',1), +(28,'ui','companyLogoTitle','','ACME Corporation','ALT text - for accessibility purposes.\r\n','ACME Corporation',1), +(29,'ui','alwaysShowAll','boolean','0','Do not restrict to searches (e.g. always show_all) on users and groups pages.\r\n','0',1), +(30,'ui','condensedAdminUI','boolean','0','Use a condensed admin ui\r\n?','0',1), +(31,'ui','fakeMimetype','boolean','0','Allow \"open\" from downloads. Changing this to \"true\" will prevent (most)\r\n browsers from giving users the \"open\" option.\r\n','0',1), +(32,'ui','metadata_sort','boolean','0','Sort the metadata fields alphabetically\r\n','1',1), +(33,'i18n','useLike','boolean','default','If your language doesn\'t have distinguishable words (usually, doesn\'t\r\n have a space character), set useLike to true to use a search that can\r\n deal with this, but which is slower.\r\n','0',1), +(34,'import','unzip','','unzip','Unzip command - will use execSearchPath to find if the path to the binary is not given\r\n.','unzip',1), +(35,'export','zip','','zip','Zip command - will use execSearchPath to find if the path to the\r\n binary is not given\r\n.','zip',1), +(36,'externalBinary','xls2csv','','xls2csv','','xls2csv',1), +(37,'externalBinary','pdftotext','','pdftotext','','pdftotext',1), +(38,'externalBinary','catppt','','catppt','','catppt',1), +(39,'externalBinary','pstotext','','pstotext','','pstotext',1), +(40,'externalBinary','catdoc','','catdoc','','catdoc',1), +(41,'externalBinary','antiword','','antiword','','antiword',1), +(42,'externalBinary','python','','python','','python',1), +(43,'externalBinary','java','','java','','java',1), +(44,'externalBinary','php','','php','','php',1), +(45,'externalBinary','df','','df','','df',1), +(46,'cache','proxyCacheDirectory','','${varDirectory}/proxies','','${varDirectory}/proxies',1), +(47,'cache','proxyCacheEnabled','boolean','1','','1',1), +(48,'KTWebDAVSettings','debug','','off','This section is for KTWebDAV only, _LOTS_ of debug info will be logged if the following is \"on\"\r\n','off',1), +(49,'KTWebDAVSettings','safemode','','on','To allow write access to WebDAV clients set safe mode to \"off\".','on',1), +(50,'BaobabSettings','debug','','off','This section is for Baobab only\r\n, _LOTS_ of debug info will be logged if the following is \"on\"\r\n.','off',1), +(51,'BaobabSettings','safemode','','on','To allow write access to WebDAV clients set safe mode to \"off\" below\r\n.','on',1), +(52,'search','searchBasePath','','${fileSystemRoot}/search2','','${fileSystemRoot}/search2',1), +(53,'search','fieldsPath','','${searchBasePath}/search/fields','','${searchBasePath}/search/fields',1), +(54,'search','resultsDisplayFormat','','searchengine','The format in which to display the results\r\n options are searchengine or browseview defaults to searchengine\r\n.','searchengine',1), +(55,'search','resultsPerPage','','50','The number of results per page\r\n, defaults to 25\r\n','25',1), +(56,'search','dateFormat','','Y-m-d','The date format used when making queries using widgets\r\n, defaults to Y-m-d\r\n','Y-m-d',1), +(57,'browse','previewActivation','','default','The document info box / preview is activated by mousing over or clicking on the icon\r\n. Options: mouse-over (default) or onclick\r\n.','mouse-over',1), +(58,'indexer','coreClass','','JavaXMLRPCLuceneIndexer','The core indexing class\r\n. Choices: JavaXMLRPCLuceneIndexer or PHPLuceneIndexer.','JavaXMLRPCLuceneIndexer',1), +(59,'indexer','batchDocuments','','20','The number of documents to be indexed in a cron session, defaults to 20\r\n.','20',1), +(60,'indexer','batchMigrateDocuments','','500','The number of documents to be migrated in a cron session, defaults to 500\r\n.','500',1), +(61,'indexer','indexingBasePath','','${searchBasePath}/indexing','','${searchBasePath}/indexing',1), +(62,'indexer','luceneDirectory','','${varDirectory}/indexes','The location of the lucene indexes\r\n.','${varDirectory}/indexes',1), +(63,'indexer','extractorPath','','${indexingBasePath}/extractors','','${indexingBasePath}/extractors',1), +(64,'indexer','extractorHookPath','','${indexingBasePath}/extractorHooks','','${indexingBasePath}/extractorHooks',1), +(65,'indexer','javaLuceneURL','','http://127.0.0.1:8875','The url for the Java Lucene Server. This should match up the the Lucene Server configuration. Defaults to http://127.0.0.1:8875\r\n','http://127.0.0.1:8875',1), +(66,'openoffice','host','','default','The host on which open office is installed\r\n. Defaults to 127.0.0.1\r\n','127.0.0.1',1), +(67,'openoffice','port','','default','The port on which open office is listening. Defaults to 8100\r\n','8100',1), +(68,'webservice','uploadDirectory','','${varDirectory}/uploads','Directory to which all uploads via webservices are persisted before moving into the repository\r\n.','${varDirectory}/uploads',1), +(69,'webservice','downloadUrl','','${rootUrl}/ktwebservice/download.php','Url which is sent to clients via web service calls so they can then download file via HTTP GET\r\n.','${rootUrl}/ktwebservice/download.php',1), +(70,'webservice','uploadExpiry','','30','Period indicating how long a file should be retained in the uploads directory.\r\n','30',1), +(71,'webservice','downloadExpiry','','30','Period indicating how long a download link will be available.','30',1), +(72,'webservice','randomKeyText','','bkdfjhg23yskjdhf2iu','Random text used to construct a hash. This can be customised on installations so there is less chance of overlap between installations.\r\n','bkdfjhg23yskjdhf2iu',1), +(73,'webservice','validateSessionCount','boolean','0','Validating session counts can interfere with access. It is best to leave this disabled, unless very strict access is required.\r\n','0',1), +(74,'webservice','useDefaultDocumentTypeIfInvalid','boolean','1','If the document type is invalid when adding a document, we can be tollerant and just default to the Default document type.\r\n','1',1), +(75,'webservice','debug','boolean','0','The web service debugging if the logLevel is set to DEBUG. We can set the value to 4 or 5 to get more verbose web service logging.\r\n Level 4 logs the name of functions being accessed. Level 5 logs the SOAP XML requests and responses.\r\n','0',1), +(76,'clientToolPolicies','explorerMetadataCapture','boolean','1','This setting is one of two which control whether or not the client is prompted for metadata when a\r\n document is added to knowledgetree via KTtools. It defaults to true.\r\n','1',1), +(77,'clientToolPolicies','officeMetadataCapture','boolean','1','This setting is one of two which control whether or not the client is prompted for metadata when a document is added to knowledgetree via KTtools. It defaults to true.','1',1), +(78,'clientToolPolicies','captureReasonsDelete','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1), +(79,'clientToolPolicies','captureReasonsCheckin','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1), +(80,'clientToolPolicies','captureReasonsCheckout','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1), +(81,'clientToolPolicies','captureReasonsCancelCheckout','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1), +(82,'clientToolPolicies','captureReasonsCopyInKT','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1), +(83,'clientToolPolicies','captureReasonsMoveInKT','boolean','1','This setting is one of six which govern whether reasons are asked for in KTtools\r\n.','1',1), +(84,'clientToolPolicies','allowRememberPassword','boolean','1','This setting governs whether the password can be stored on the client or not.','1',1), +(85,'DiskUsage','warningThreshold','','10','When free space in a mount point is less than this percentage, the disk usage dashlet will highlight the mount in ORANGE\r\n.','10',1), +(86,'DiskUsage','urgentThreshold','','5','When free space in a mount point is less than this percentage, the disk usage dashlet will highlight the mount in RED\r\n.','5',1), +(87,'KnowledgeTree','useNewDashboard','','default','','1',1), +(88,'i18n','defaultLanguage','','en','Default language for the interface\r\n.','en',1), +(89,'CustomErrorMessages','customerrormessages','','off','Turn custom error messages on or off here','on',1), +(90,'CustomErrorMessages','customerrorpagepath','','customerrorpage.php','Name or url of custom error page\r\n.','customerrorpage.php',1), +(91,'CustomErrorMessages','customerrorhandler','','off','Turn custom error handler on or off','on',1), +(92,'ui','morphEnabled','boolean','0','Enable Morph','0',1), +(93,'ui','morphTo','','blue','Morph Theme\r\n','blue',1), +(94,'KnowledgeTree','logLevel','','default','Choice: INFO or DEBUG','INFO',1), +(95,'storage','manager','','default','','KTOnDiskHashedStorageManager',1), +(96,'ui','ieGIF','boolean','0','','1',1), +(97,'ui','automaticRefresh','boolean','0','','0',1), +(98,'ui','dot','','dot','','dot',1), +(99,'tweaks','phpErrorLogFile','boolean','default','If you want to enable PHP error logging to the log/php_error_log file, change this setting to true\r\n.','0',1), +(100,'urls','logDirectory','','default','','${varDirectory}/log',1), +(101,'urls','uiDirectory','','default','','${fileSystemRoot}/presentation/lookAndFeel/knowledgeTree',1), +(102,'urls','tmpDirectory','','default','','${varDirectory}/tmp',1), +(103,'urls','stopwordsFile','','default','','${fileSystemRoot}/config/stopwords.txt',1), +(104,'cache','cacheEnabled','boolean','default','','0',1), +(105,'cache','cacheDirectory','','default','','${varDirectory}/cache',1), +(106,'cache','cachePlugins','boolean','default','','1',1), +(107,'urls','varDirectory','','default','','${fileSystemRoot}/var',1), +(108,'urls','documentRoot','','default','','${varDirectory}/Documents',0); /*!40000 ALTER TABLE `config_settings` ENABLE KEYS */; UNLOCK TABLES; @@ -830,8 +931,8 @@ INSERT INTO `scheduler_tasks` VALUES (4,'Periodic Document Expunge','bin/expungeall.php','',0,'weekly','2007-10-01',NULL,0,'disabled'), (5,'Database Maintenance','bin/dbmaint.php','optimize',0,'monthly','2007-10-01',NULL,0,'disabled'), (6,'Open Office test','bin/checkopenoffice.php','',0,'1min','2007-10-01',NULL,0,'enabled'), -(7,'Cleanup Temporary Directory','search2/bin/cronCleanup.php','',0,'1min','2007-10-01',NULL,0,'enabled'); - +(7,'Cleanup Temporary Directory','search2/bin/cronCleanup.php','',0,'1min','2007-10-01',NULL,0,'enabled'), +(8,'Disk Usage and Folder Utilisation Statistics','plugins/housekeeper/bin/UpdateStats.php','',0,'5mins','2007-10-01',NULL,0,'enabled'); /*!40000 ALTER TABLE `scheduler_tasks` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/mysql/upgrade/3.5.2/zdashboard_tasks.sql b/sql/mysql/upgrade/3.5.2/zdashboard_tasks.sql new file mode 100644 index 0000000..0ce5c90 --- /dev/null +++ b/sql/mysql/upgrade/3.5.2/zdashboard_tasks.sql @@ -0,0 +1,4 @@ +select @id:=max(id)+1 from scheduler_tasks; +INSERT INTO `scheduler_tasks` VALUES (@id,'Disk Usage and Folder Utilisation Statistics','plugins/housekeeper/bin/UpdateStats.php','',0,'5mins','2007-10-01',NULL,0,'enabled'); + +UPDATE zseq_scheduler_tasks set id=@id; \ No newline at end of file