summaryrefslogtreecommitdiffstats
path: root/apis
diff options
context:
space:
mode:
authorSimon Rettberg2016-07-04 14:10:29 +0200
committerSimon Rettberg2016-07-04 14:10:29 +0200
commit8232db1461a302aaeecabd88228786d5d86c39c5 (patch)
tree9a87666546a5f3740a13a445283a39f23b15a00b /apis
parent[main] Fix ul & li mismatch in main-menu (diff)
downloadslx-admin-8232db1461a302aaeecabd88228786d5d86c39c5.tar.gz
slx-admin-8232db1461a302aaeecabd88228786d5d86c39c5.tar.xz
slx-admin-8232db1461a302aaeecabd88228786d5d86c39c5.zip
delete update.inc.php: Not used anymore
Diffstat (limited to 'apis')
-rw-r--r--apis/update.inc.php59
1 files changed, 0 insertions, 59 deletions
diff --git a/apis/update.inc.php b/apis/update.inc.php
deleted file mode 100644
index d3262eb3..00000000
--- a/apis/update.inc.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-//
-// TODO: Modularize
-//
-
-$targetVersion = Database::getExpectedSchemaVersion();
-
-function fatal($message)
-{
- if (tableExists('eventlog'))
- EventLog::failure($message);
- die("$message\n");
-}
-
-// #######################
-
-$res = Database::queryFirst("SELECT value FROM property WHERE name = 'webif-version' LIMIT 1", array(), true);
-
-$currentVersion = (int) ($res === false ? 1 : $res['value']);
-
-if ($currentVersion >= $targetVersion)
- die('Up to date :-)');
-
-while ($currentVersion < $targetVersion) {
-
- $function = 'update_' . $currentVersion;
-
- if (!function_exists($function))
- fatal("Don't know how to update from version $currentVersion to $targetVersion :-(");
-
- if (!$function())
- fatal("Update from $currentVersion to $targetVersion failed! :-(");
-
- $currentVersion++;
-
- $ret = Database::exec("INSERT INTO property (name, value) VALUES ('webif-version', :version) ON DUPLICATE KEY UPDATE value = VALUES(value)", array('version' => $currentVersion), false);
- if ($ret === false)
- fatal('Writing version information back to DB failed. Next update will probably break.');
-
- if ($currentVersion < $targetVersion) {
- echo("Updated to $currentVersion...\n");
- }
-}
-
-// TEMPORARY HACK; Rebuild AD configs.. move somewhere else
-$list = ConfigModule::getAll('AdAuth');
-if ($list === false) {
- Message::addError('ad-config-failed');
-} else {
- foreach ($list as $ad) {
- $ad->generate(false);
- }
-}
-
-Message::addSuccess('db-update-done');
-if (tableExists('eventlog'))
- EventLog::info("Database updated to version $currentVersion");
-Util::redirect('index.php?do=Main');