You should have received a copy of the GNU General Public License
    along with GlobalBan.  If not, see <http://www.gnu.org/licenses/>.
*/
/**
 * Instead of putting each step on a separate page, each step will post back to this page and be
 * processed in the next step if it passes the previous step.
 */
define("ROOTDIR", dirname(__FILE__));
// Global Constant of root directory
error_reporting(E_ALL & ~E_STRICT);
session_start();
require_once ROOTDIR . "/include/database/class.InstallAndUpgradeQueries.php";
require_once ROOTDIR . "/include/php4functions.php";
$lan_file = ROOTDIR . '/languages/English/lan_configuration.php';
include file_exists($lan_file) ? $lan_file : ROOTDIR . "/languages/English/lan_configuration.php";
$installAndUpgrade = new InstallAndUpgradeQueries();
function selfURL()
{
    $s = empty($_SERVER["HTTPS"]) ? '' : $_SERVER["HTTPS"] == "on" ? "s" : "";
    $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/") . $s;
    $port = $_SERVER["SERVER_PORT"] == "80" ? "" : ":" . $_SERVER["SERVER_PORT"];
    return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
}
function strleft($s1, $s2)
{
    return substr($s1, 0, strpos($s1, $s2));
}
$url = selfURL();
$url = substr($url, 0, strrpos($url, "/")) . "/";
// The step of the install process
$step = 1;
    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 GlobalBan.  If not, see <http://www.gnu.org/licenses/>.
*/
/**
 * Instead of putting each step on a separate page, each step will post back to this page and be
 * processed in the next step if it passes the previous step.
 */
define("ROOTDIR", dirname(__FILE__));
// Global Constant of root directory
require_once ROOTDIR . "/include/database/class.InstallAndUpgradeQueries.php";
require_once ROOTDIR . "/config/class.Config.php";
$config = new Config();
$installAndUpgrade = new InstallAndUpgradeQueries();
$installAndUpgrade->setDbHost($config->dbHostName);
$installAndUpgrade->setDbUser($config->dbUserName);
$installAndUpgrade->setDbPass($config->dbPassword);
$installAndUpgrade->setDbase($config->dbName);
$complete = false;
if (isset($_POST['submit'])) {
    $installAndUpgrade->createConnection();
    $installAndUpgrade->connectToDatabase();
    $upgradeVersion = $_POST['upgradeVersion'];
    // ---------------------------------------------------------------------------
    // UPGRADE FROM 2.2 TO ANY 3.0+ VERSION
    // ---------------------------------------------------------------------------
    // Upgrade from Version 2.2 to Version 3.0
    if ($upgradeVersion == "22to30") {
        $installAndUpgrade->upgradeTwoPointTwoToThree();