public static function upgrade_db() { $start_db_version = db_function::db_version(); $app_version = costant::app_version(); while (db_function::db_version() !== $app_version) { switch (db_function::db_version()) { case "0.9.2": db_upgrade::to_0_9_3(); break; case "0.9.3": db_upgrade::upgrade_version("0.9.4"); break; case "0.9.4": db_upgrade::upgrade_version("0.9.5"); break; case "0.9.5": db_upgrade::upgrade_version("0.9.6"); break; case "0.9.6": db_upgrade::to_0_9_7(); break; case "0.9.7": db_upgrade::upgrade_version("0.9.8"); break; case "0.9.8": db_upgrade::to_0_9_9(); break; case "0.9.9": db_upgrade::upgrade_version("1.0.0"); break; case "1.0.0": db_upgrade::upgrade_version("1.0.1"); break; case "1.0.1": db_upgrade::upgrade_version("1.0.2"); break; case $app_version: break; default: various::send_alert_and_redirect("Database version not compliant: DB Version = " . db_function::db_version() . " - APP Version = {$app_version}", "error.php"); break 2; } } if ($start_db_version !== $app_version && db_function::db_version() == $app_version) { return "update_done"; } else { return "update_not_need"; } }
<?php require_once "functions.php"; $error = db_function::db_create(); if ($error !== "ok") { echo $error; } else { $upgrade_result = db_upgrade::upgrade_db(); if ($upgrade_result == "update_done") { various::send_alert_and_redirect("Database succesfully updated to version " . costant::app_version(), "index.php"); } } $username = null; $password = null; $const_username = costant::login_username(); $const_password = costant::login_password(); $const_disable_authentication = costant::disable_authentication(); if ($const_disable_authentication == "True") { header("Location: landing.php"); } if ($const_disable_authentication !== "True" && (!isset($const_username) or !isset($const_password))) { header("Location: settings.php"); } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (!empty($_POST["Username"]) && !empty($_POST["Password"])) { $username = $_POST["Username"]; $password = hash("sha512", $_POST["Password"]); if ($username == $const_username && $password == $const_password) { session_start(); $user_browser = $_SERVER['HTTP_USER_AGENT']; $_SESSION["username"] = $username;
<link rel="icon" href="res/favicon.ico" /> <link rel="apple-touch-icon" href="res/apple-touch-icon.png" /> <link rel="stylesheet" type="text/css" href="res/bootstrap-3.2.0.min.css" /> <link rel="stylesheet" type="text/css" href="res/bootstrap-theme-3.2.0.min.css" /> <link rel="stylesheet" type="text/css" href="res/style_global-0.9.9.css" /> </head> <body> <div class="container text_align_center"> <br /> <img src="res/mmex.ico" alt="Money Manager Ex Logo" height="150" width="150"/> <br /> <h2><strong>Money Manager Ex - Web App</strong></h2> <?php echo "<h4> Version " . costant::app_version() . "</h4>"; echo "<h5> API Version " . costant::api_version() . "</h5>"; ?> <br /> <h4> Developer: Gabriele [Gabriele-V]</h4> <a href="https://github.com/moneymanagerex/web-money-manager-ex"><h4> GitHub WebPage</h4></a> <br /> <p> Used components: <br /> <a href="http://getbootstrap.com/">Bootstrap</a> <br /> <a href="http://jquery.com//">jQuery</a> <br /> <a href="http://modernizr.com/">Modernizr</a> <br />