Beispiel #1
0
        case "cognome":
            // update the surname
            $user->changeSurname($_SESSION["username"], $value);
            break;
        case "password":
            // update the password
            $user->changePassword($_SESSION["username"], $value);
            break;
        default:
            // redirect to home.php and exit the script
            header("location: home.php");
            exit;
            break;
    }
    // take out the updated information from the database
    $newUser = $user->getInformationAboutUser($_SESSION["username"]);
    // reset the session array
    $_SESSION = $newUser;
    // redirect to the home.php and exit the script
    header("location: home.php");
    exit;
} else {
    if (isset($_POST["enable"])) {
        // get out the value from the post array
        $newValue = $_POST["value"];
        $username = $_POST["username"];
        // require the file with all the classes
        require_once 'Matchup.inc.php';
        // create an object of MUUsers
        $user = new MUUsers();
        // update the enable state