Commit 6b7e5c6ea52a34dd9a838171adcc0decbe03c6b9

Authored by donald_jackson
1 parent 19508f02

"knowledge tree explorer not logging in after 3.5.4 upgrade(SUP-1214)"

KTS-3945
Merged clean-up code from trunk.

Committed by: Donald Jackson
Reviewed by: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/branches/RB_3.5.4a@9624 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/upgrades/UpgradeFunctions.inc.php
... ... @@ -62,9 +62,10 @@ class UpgradeFunctions {
62 62 '3.5.0' => array('cleanupOldKTAdminVersionNotifier', 'updateConfigFile35', 'registerIndexingTasks'),
63 63 '3.5.2' => array('setStorageEngine','dropForeignKeys','dropPrimaryKeys','dropIndexes','createPrimaryKeys','createForeignKeys','createIndexes', 'removeSlashesFromObjects'),
64 64 '3.5.3' => array('moveConfigSettingsToDB','removeAdminVersionNotifier','removeOldSearchPlugins','addAutoIncrementToTables', 'addAutoIncrementToTables2'),
65   - '3.5.4' => array('createIndexes', 'updateServerConfigSettings')
  65 + '3.5.4' => array('createIndexes'),
  66 + '3.5.4' => array('createIndexes', 'updateServerConfigSettings','removeOldFilesAndFolders354')
66 67 );
67   -
  68 +
68 69 var $descriptions = array(
69 70 "rebuildSearchPermissions" => "Rebuild search permissions with updated algorithm",
70 71 "setPermissionFolder" => "Set permission folder for each folder for simplified permissions management",
... ... @@ -97,6 +98,7 @@ class UpgradeFunctions {
97 98 'removeAdminVersionNotifier' => 'Remove the old Admin Version Notifier Plugin.',
98 99 'removeOldSearchPlugins' => 'Remove the old Search Plugins.',
99 100 'addAutoIncrementToTables' => 'Update all current db tables to use auto_increment.',
  101 + 'removeOldFilesAndFolders354' => 'Remove old files and folders that are no longer needed.',
100 102 'addAutoIncrementToTables2' => 'Update all new db tables to use auto_increment.',
101 103 'updateServerConfigSettings' => 'Update the configuration settings for the server with the correct port'
102 104 );
... ... @@ -1364,6 +1366,20 @@ class UpgradeFunctions {
1364 1366 return true;
1365 1367 }
1366 1368  
  1369 + // {{{ removeOldFilesAndFolders354
  1370 + function removeOldFilesAndFolders354() {
  1371 + global $default;
  1372 + $oldFile = KT_DIR . "/lib/sanitize.inc";
  1373 + if(file_exists($oldFile)) unlink($oldFile);
  1374 +
  1375 + // Files MUST be removed before folders and folders MUST be empty
  1376 + $oldPath1 = KT_DIR . "/plugins/toolsdashlet/";
  1377 + UpgradeFunctions::rm_recursive($oldPath1);
  1378 +
  1379 + // FIXME: We should check that they all worked
  1380 + return true;
  1381 + }
  1382 +
1367 1383 function updateServerConfigSettings() {
1368 1384 global $default;
1369 1385 $port = $_SERVER['SERVER_PORT']+0;
... ... @@ -1375,6 +1391,7 @@ class UpgradeFunctions {
1375 1391 }
1376 1392 }
1377 1393  
  1394 +
1378 1395 function rm_recursive($filepath)
1379 1396 {
1380 1397 if (is_dir($filepath) && !is_link($filepath))
... ...