diff --git a/conf_only.php.template b/conf_only.php.template
deleted file mode 100644
index b1a8db3ab..000000000
--- a/conf_only.php.template
+++ /dev/null
@@ -1,65 +0,0 @@
-
- *
dsn datasource setting
- * tblNamePrefix prefix for table names in the database
- * authCookieName secret token cookie name
- * StationPrefsGr name of station preferences group
- * AllGr name of 'all users' group
- * storageDir main directory for storing binary media files
- * bufferDir directory for temporary files
- * transDir directory for incomplete transferred files
- * accessDir directory for symlinks to accessed files
- * isArchive local/central flag
- * validate enable/disable validator
- * storageUrlPathpath-URL-part of storageServer base dir
- * storageXMLRPCXMLRPC server script address relative to storageUrlPath
- * storageUrlHost, storageUrlPorthost and port of storageServer
- * archiveUrlPathpath-URL-part of archiveServer base dir
- * archiveXMLRPCXMLRPC server script address relative to archiveUrlPath
- * archiveUrlHost, archiveUrlPorthost and port of archiveServer
- * archiveAccountLogin, archiveAccountPass account info
- * for login to archive
- *
- */
-$CC_CONFIG = array(
- /* ================================================== basic configuration */
- 'dsn' => array(
- 'username' => 'ls_dbuser',
- 'password' => 'ls_dbpassword',
- 'hostspec' => 'ls_dbserver',
- 'phptype' => 'pgsql',
- 'database' => 'ls_database',
- ),
-
- /* ==================================================== URL configuration */
- 'storageUrlPath' => 'ls_storageUrlPath',
- 'storageXMLRPC' => 'xmlrpc/xrLocStor.php',
- 'storageUrlHost' => 'ls_php_host',
- 'storageUrlPort' => ls_php_port,
-
- /* ================================================ archive configuration */
- 'archiveUrlPath' => 'ls_storageUrlPath',
- 'archiveXMLRPC' => 'xmlrpc/xrLocStor.php',
- 'archiveUrlHost' => 'ls_php_host',
- 'archiveUrlPort' => ls_php_port,
- 'archiveAccountLogin' => 'root',
- 'archiveAccountPass' => 'q',
-
- /* ============================================== scheduler configuration */
- 'schedulerUrlPath' => 'ls_scheduler_urlPrefix',
- 'schedulerXMLRPC' => 'ls_scheduler_xmlRpcPrefix',
- 'schedulerUrlHost' => 'ls_scheduler_host',
- 'schedulerUrlPort' => ls_scheduler_port,
- 'schedulerPass' => 'ls_scheduler_storage_pass',
-
- /* =================================================== cron configuration */
- //'cronUserName' => 'www-data',
- 'cronUserName' => $developer_name,
-
-);
-?>
\ No newline at end of file
diff --git a/htmlUI/install/install.php b/install/install_twitter_plugin.php
similarity index 100%
rename from htmlUI/install/install.php
rename to install/install_twitter_plugin.php
diff --git a/install/uninstall.php b/install/uninstall.php
index 26ac94efb..bef99bb8c 100644
--- a/install/uninstall.php
+++ b/install/uninstall.php
@@ -1,7 +1,6 @@
/dev/null";
-@exec($command, $output, $results);
+//$command = "sudo -u postgres dropdb {$CC_CONFIG['dsn']['database']}";
+@exec($command, $output, $dbDeleteFailed);
+//------------------------------------------------------------------------
+// Delete DB tables
+// We do this if dropping the database fails above.
+//------------------------------------------------------------------------
+if ($dbDeleteFailed) {
+ echo " * Couldn't delete the database, so deleting all the DB tables...\n";
+ campcaster_db_connect(true);
+ if (!PEAR::isError($CC_DBC)) {
+ if (camp_db_table_exists($CC_CONFIG['prefTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['prefTable']."...";
+ $sql = "DROP TABLE ".$CC_CONFIG['prefTable'];
+ camp_install_query($sql, false);
-//campcaster_db_connect(true);
-//$CC_DBC->disconnect();
+ $CC_DBC->dropSequence($CC_CONFIG['prefTable']."_id");
+ echo "done.\n";
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['prefTable']."\n";
+ }
+ }
+
+ if (camp_db_table_exists($CC_CONFIG['transTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['transTable']."...";
+ $sql = "DROP TABLE ".$CC_CONFIG['transTable'];
+ camp_install_query($sql, false);
+
+ $CC_DBC->dropSequence($CC_CONFIG['transTable']."_id");
+ echo "done.\n";
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['transTable']."\n";
+ }
+
+ if (camp_db_table_exists($CC_CONFIG['filesTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['filesTable']."...";
+ $sql = "DROP TABLE ".$CC_CONFIG['filesTable']." CASCADE";
+ camp_install_query($sql);
+ $CC_DBC->dropSequence($CC_CONFIG['filesTable']."_id");
+
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['filesTable']."\n";
+ }
+
+ if (camp_db_table_exists($CC_CONFIG['playListTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['playListTable']."...";
+ $sql = "DROP TABLE ".$CC_CONFIG['playListTable']." CASCADE";
+ camp_install_query($sql);
+ $CC_DBC->dropSequence($CC_CONFIG['playListTable']."_id");
+
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['playListTable']."\n";
+ }
+
+ if (camp_db_table_exists($CC_CONFIG['playListContentsTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['playListContentsTable']."...";
+ $sql = "DROP TABLE ".$CC_CONFIG['playListContentsTable'];
+ camp_install_query($sql);
+ $CC_DBC->dropSequence($CC_CONFIG['playListContentsTable']."_id");
+
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['playListContentsTable']."\n";
+ }
+
+ //if (camp_db_sequence_exists($CC_CONFIG['filesSequence'])) {
+ // $sql = "DROP SEQUENCE ".$CC_CONFIG['filesSequence'];
+ // camp_install_query($sql);
+ //}
+ //
+ if (camp_db_table_exists($CC_CONFIG['accessTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['accessTable']."...";
+ $sql = "DROP TABLE ".$CC_CONFIG['accessTable'];
+ camp_install_query($sql);
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['accessTable']."\n";
+ }
+
+ if (camp_db_table_exists($CC_CONFIG['permTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['permTable']."...";
+ $sql = "DROP TABLE ".$CC_CONFIG['permTable'];
+ camp_install_query($sql, false);
+
+ $CC_DBC->dropSequence($CC_CONFIG['permTable']."_id");
+ echo "done.\n";
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['permTable']."\n";
+ }
+
+ if (camp_db_table_exists($CC_CONFIG['sessTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['sessTable']."...";
+ $sql = "DROP TABLE ".$CC_CONFIG['sessTable'];
+ camp_install_query($sql);
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['sessTable']."\n";
+ }
+
+ if (camp_db_table_exists($CC_CONFIG['subjTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['subjTable']."...";
+ $CC_DBC->dropSequence($CC_CONFIG['subjTable']."_id");
+
+ $sql = "DROP TABLE ".$CC_CONFIG['subjTable']." CASCADE";
+ camp_install_query($sql, false);
+
+ echo "done.\n";
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['subjTable']."\n";
+ }
+
+ if (camp_db_table_exists($CC_CONFIG['smembTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['smembTable']."...";
+ $sql = "DROP TABLE ".$CC_CONFIG['smembTable'];
+ camp_install_query($sql, false);
+
+ $CC_DBC->dropSequence($CC_CONFIG['smembTable']."_id");
+ echo "done.\n";
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['smembTable']."\n";
+ }
+
+ if (camp_db_table_exists($CC_CONFIG['scheduleTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['scheduleTable']."...";
+ camp_install_query("DROP TABLE ".$CC_CONFIG['scheduleTable']);
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['scheduleTable']."\n";
+ }
+
+ if (camp_db_table_exists($CC_CONFIG['backupTable'])) {
+ echo " * Removing database table ".$CC_CONFIG['backupTable']."...";
+ camp_install_query("DROP TABLE ".$CC_CONFIG['backupTable']);
+ } else {
+ echo " * Skipping: database table ".$CC_CONFIG['backupTable']."\n";
+ }
+}
//------------------------------------------------------------------------
@@ -100,132 +213,6 @@ camp_uninstall_delete_files($CC_CONFIG['storageDir']);
camp_uninstall_delete_files($CC_CONFIG['transDir']);
camp_uninstall_delete_files($CC_CONFIG['accessDir']);
-//------------------------------------------------------------------------
-// Delete DB tables
-//------------------------------------------------------------------------
-//echo " * Deleting DB tables...\n";
-//if (!PEAR::isError($CC_DBC)) {
-// if (camp_db_table_exists($CC_CONFIG['prefTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['prefTable']."...";
-// $sql = "DROP TABLE ".$CC_CONFIG['prefTable'];
-// camp_install_query($sql, false);
-//
-// $CC_DBC->dropSequence($CC_CONFIG['prefTable']."_id");
-// echo "done.\n";
-// } else {
-// echo " * Skipping: database table ".$CC_CONFIG['prefTable']."\n";
-// }
-//}
-//
-//if (camp_db_table_exists($CC_CONFIG['transTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['transTable']."...";
-// $sql = "DROP TABLE ".$CC_CONFIG['transTable'];
-// camp_install_query($sql, false);
-//
-// $CC_DBC->dropSequence($CC_CONFIG['transTable']."_id");
-// echo "done.\n";
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['transTable']."\n";
-//}
-//
-//if (camp_db_table_exists($CC_CONFIG['filesTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['filesTable']."...";
-// $sql = "DROP TABLE ".$CC_CONFIG['filesTable']." CASCADE";
-// camp_install_query($sql);
-// $CC_DBC->dropSequence($CC_CONFIG['filesTable']."_id");
-//
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['filesTable']."\n";
-//}
-//
-//if (camp_db_table_exists($CC_CONFIG['playListTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['playListTable']."...";
-// $sql = "DROP TABLE ".$CC_CONFIG['playListTable']." CASCADE";
-// camp_install_query($sql);
-// $CC_DBC->dropSequence($CC_CONFIG['playListTable']."_id");
-//
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['playListTable']."\n";
-//}
-//
-//if (camp_db_table_exists($CC_CONFIG['playListContentsTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['playListContentsTable']."...";
-// $sql = "DROP TABLE ".$CC_CONFIG['playListContentsTable'];
-// camp_install_query($sql);
-// $CC_DBC->dropSequence($CC_CONFIG['playListContentsTable']."_id");
-//
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['playListContentsTable']."\n";
-//}
-//
-////if (camp_db_sequence_exists($CC_CONFIG['filesSequence'])) {
-//// $sql = "DROP SEQUENCE ".$CC_CONFIG['filesSequence'];
-//// camp_install_query($sql);
-////}
-////
-//if (camp_db_table_exists($CC_CONFIG['accessTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['accessTable']."...";
-// $sql = "DROP TABLE ".$CC_CONFIG['accessTable'];
-// camp_install_query($sql);
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['accessTable']."\n";
-//}
-//
-//if (camp_db_table_exists($CC_CONFIG['permTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['permTable']."...";
-// $sql = "DROP TABLE ".$CC_CONFIG['permTable'];
-// camp_install_query($sql, false);
-//
-// $CC_DBC->dropSequence($CC_CONFIG['permTable']."_id");
-// echo "done.\n";
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['permTable']."\n";
-//}
-//
-//if (camp_db_table_exists($CC_CONFIG['sessTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['sessTable']."...";
-// $sql = "DROP TABLE ".$CC_CONFIG['sessTable'];
-// camp_install_query($sql);
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['sessTable']."\n";
-//}
-//
-//if (camp_db_table_exists($CC_CONFIG['subjTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['subjTable']."...";
-// $CC_DBC->dropSequence($CC_CONFIG['subjTable']."_id");
-//
-// $sql = "DROP TABLE ".$CC_CONFIG['subjTable']." CASCADE";
-// camp_install_query($sql, false);
-//
-// echo "done.\n";
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['subjTable']."\n";
-//}
-//
-//if (camp_db_table_exists($CC_CONFIG['smembTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['smembTable']."...";
-// $sql = "DROP TABLE ".$CC_CONFIG['smembTable'];
-// camp_install_query($sql, false);
-//
-// $CC_DBC->dropSequence($CC_CONFIG['smembTable']."_id");
-// echo "done.\n";
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['smembTable']."\n";
-//}
-//
-//if (camp_db_table_exists($CC_CONFIG['scheduleTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['scheduleTable']."...";
-// camp_install_query("DROP TABLE ".$CC_CONFIG['scheduleTable']);
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['scheduleTable']."\n";
-//}
-//
-//if (camp_db_table_exists($CC_CONFIG['backupTable'])) {
-// echo " * Removing database table ".$CC_CONFIG['backupTable']."...";
-// camp_install_query("DROP TABLE ".$CC_CONFIG['backupTable']);
-//} else {
-// echo " * Skipping: database table ".$CC_CONFIG['backupTable']."\n";
-//}
//------------------------------------------------------------------------
// Disconnect from the database
@@ -233,20 +220,6 @@ camp_uninstall_delete_files($CC_CONFIG['accessDir']);
//echo " * Disconnecting from database...\n";
//$CC_DBC->disconnect();
-//------------------------------------------------------------------------
-// Delete the database
-// Note: we do all the table-dropping above because this command usually fails
-// because there are usually still connections to the database.
-//------------------------------------------------------------------------
-//echo " * Dropping the database ".$CC_CONFIG['dsn']['database']."...\n";
-//$command = "sudo -u postgres dropdb {$CC_CONFIG['dsn']['database']}";
-//@exec($command, $output, $results);
-//if ($results == 0) {
-// echo " * Database '{$CC_CONFIG['dsn']['database']}' deleted.\n";
-//} else {
-// echo " * Could not delete database '{$CC_CONFIG['dsn']['database']}'.\n";
-//}
-
//------------------------------------------------------------------------
// Delete the user
//------------------------------------------------------------------------
diff --git a/htmlUI/install/uninstall.php b/install/uninstall_twitter_plugin.php
similarity index 100%
rename from htmlUI/install/uninstall.php
rename to install/uninstall_twitter_plugin.php