diff --git a/setup/upgrade-title.jpg b/setup/upgrade-title.jpg index 0787e5c..4f73a57 100644 --- a/setup/upgrade-title.jpg +++ b/setup/upgrade-title.jpg diff --git a/setup/upgrade.php b/setup/upgrade.php index 5aee1c4..2fde263 100644 --- a/setup/upgrade.php +++ b/setup/upgrade.php @@ -32,6 +32,7 @@ $GLOBALS["checkup"] = true; session_start(); require_once('../config/dmsDefaults.php'); +require_once(KT_LIB_DIR . '/authentication/authenticationutil.inc.php'); require_once(KT_LIB_DIR . '/upgrades/upgrade.inc.php'); require_once(KT_LIB_DIR . '/plugins/pluginutil.inc.php'); @@ -177,8 +178,6 @@ $action = trim($_REQUEST["go"]); switch ($action) { case 'UpgradeConfirm': - upgradeConfirm(); - break; case 'UpgradePreview': UpgradePreview(); break; @@ -209,11 +208,92 @@ switch ($action) case 'RestoreDone': restoreDone(); break; + case 'Login': + login(); + break; + case 'LoginProcess': + loginProcess(); + break; default: - welcome(); + if (!isset($_SESSION['setup_user'])) + login(); + else + welcome(); break; } +function login() +{ +?> +
+The database upgrade wizard completes the upgrade process on an existing KnowledgeTree installation. It applies +any upgrades to the database that may be required. +
+Only administrator users may access the upgrade wizard. +
+ +
+ +} + +function loginProcess() +{ + $username=$_REQUEST['username']; + $password=$_REQUEST['password']; + + $oUser = User::getByUserName($username); + + if (PEAR::isError($oUser)) + { + session_unset(); + loginFailed(_kt('Could not identify user')); + return; + } + + $is_admin=false; + $groups = GroupUtil::listGroupsForUser($oUser); + foreach($groups as $group) + { + if ($group->getSysAdmin()) + { + $is_admin=true; + break; + } + } + + if (!$is_admin) + { + session_unset(); + loginFailed(_kt('Could not identify administrator')); + return; + } + + $authenticated = KTAuthenticationUtil::checkPassword($oUser, $password); + + if (!$authenticated) + { + session_unset(); + loginFailed(_kt('Could not authenticate user')); + return; + } + + $_SESSION['setup_user'] = $oUser; + + welcome(); +} + +function loginFailed($message) +{ + print "$message"; + login(); +} + function resolveMysqlDir() { @@ -336,11 +416,16 @@ function create_restore_stmt($targetfile) function title($title) { + if (!isset($_SESSION['setup_user'])) + { + print ""; + } print "- - + + @@ -425,14 +513,14 @@ You can continue to do the backup manually using the following process: Press continue to backup to attempt the command(s) above.
- + if ($dir != '') { ?> - + @@ -501,7 +589,7 @@ function restoreSelect() ?>
-
+
}
@@ -577,8 +665,8 @@ Press continue to restore to attempt the command(s) above.
}
?>
-
-
+
+
if ($dir != '')
@@ -593,7 +681,7 @@ function restore()
}
}
-
+
@@ -666,12 +754,12 @@ We appologise for the inconvenience.
?>
-
+
if ($status)
{
?>
-
+
}
@@ -718,7 +806,7 @@ We appologise for the inconvenience.
-
+
@@ -758,7 +846,7 @@ function backup()
ob_flush();
flush();
?>
- The back is now underway. Please wait till it completes.
+ The backup is now underway. Please wait till it completes.
ob_flush();
@@ -798,7 +886,7 @@ function backup()
The mysqldump utility was not found in the =$dir?> subdirectory. - + } @@ -870,7 +958,7 @@ function restore()
The mysql utility was not found in the =$dir?> subdirectory.
-
+
}
@@ -884,20 +972,21 @@ function welcome()
set_state(1);
?>
-Welcome to the Database Upgrade Utility.
If you have just applied an upgrade stack installer or have updated +Welcome to the Database Upgrade Wizard.
If you have just updated your code base, you will need to complete the upgrade process in order to ensure your system is fully operational with the new version.
+You will not be able to log into until your the database upgrade process is completed. +
!!NB!! You are advised to backup the database before attempting the upgrade. !!NB!! -
If you have already done this, you may skip this step can continue directly to the upgade.
-
-
-
-
+
+
+
+
@@ -920,8 +1009,8 @@ function UpgradePreview()
?>
-
-
+
+
}
@@ -954,8 +1043,8 @@ function Upgrade()
?>
- - + + }