Example #1
0
<?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;
Example #2
0
    $guid = $_POST["Set_Guid"];
    if (isset($_POST["Set_Password"]) && $_POST["Set_Password"] !== "" && $_POST["Set_Password"] !== Null) {
        $password = hash("sha512", $_POST["Set_Password"]);
    } else {
        if (isset($_POST["Set_Disable_authentication"])) {
            $password = "";
        } else {
            $password = costant::login_password();
        }
    }
    $parameterarray = array("disable_authentication" => $disable_authentication, "user_username" => $username, "user_password" => $password, "disable_payee" => $disable_payee, "disable_category" => $disable_category, "defaultaccountname" => $default_account, "desktop_guid" => $guid);
    if (file_exists("configuration_user.php")) {
        various::update_configuration_file($parameterarray);
        header("Location: landing.php");
    } else {
        various::update_configuration_file($parameterarray);
        header("Location: guide.php");
    }
}
?>
<!DOCTYPE HTML>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
    	
        <title>Money Manager EX</title>
        <link rel="icon" href="res/favicon.ico" />
        <link rel="apple-touch-icon" href="res/apple-touch-icon.png" />
        
<?php

require_once "functions.php";
session_start();
security::redirect_if_not_loggedin();
# Delete & Modify
if (isset($_POST["TrModify"])) {
    $TrModify = $_POST["TrModify"];
    if (isset($_POST["TrDelete"]) && $TrModify == "Delete") {
        $TrDeleteArr = $_POST["TrDelete"];
        db_function::transaction_delete_group($TrDeleteArr);
        attachments::delete_group($TrDeleteArr);
        header("Location: show.php");
    }
    if (!isset($_POST["TrDelete"]) && $TrModify == "Delete") {
        $test = various::send_alert_and_redirect("No transaction selected!", "show.php");
    }
    if (isset($_POST["TrEdit"]) && $TrModify == "Edit") {
        $TrEdit = $_POST["TrEdit"];
        header("Location: new_transaction.php?TrEditNr={$TrEdit[0]}");
    }
    if (!isset($_POST["TrEdit"]) && $TrModify == "Edit") {
        $test = various::send_alert_and_redirect("No transaction selected!", "show.php");
    }
}
 public static function to_0_9_9()
 {
     $parameterarray = array("disable_authentication" => costant::disable_authentication() ? "True" : "False", "user_username" => costant::login_username(), "user_password" => costant::login_password(), "disable_payee" => costant::disable_payee() ? "True" : "False", "disable_category" => "False", "defaultaccountname" => costant::transaction_default_account(), "desktop_guid" => costant::desktop_guid());
     various::update_configuration_file($parameterarray);
     $const_dbpath = costant::database_path();
     $db = new PDO("sqlite:{$const_dbpath}");
     $db->exec("ALTER TABLE Payee_List ADD DefCateg TEXT");
     $db->exec("ALTER TABLE Payee_List ADD DefSubCateg TEXT");
     $db->exec("UPDATE Payee_List SET DefCateg = 'None', DefSubCateg = 'None'");
     $db->exec("UPDATE New_Transaction SET Category = 'None', SubCategory = 'None'");
     $db->exec("UPDATE Parameters SET Value = '0.9.9' WHERE Parameter = 'Version';");
     $db = null;
 }