Exemplo n.º 1
0
<?php

session_start();
include_once "../inc/constants.inc.php";
include_once "../inc/class.users.inc.php";
$userObj = new FocusUsers();
if (!empty($_POST['action']) && isset($_SESSION['LoggedIn']) && $_SESSION['LoggedIn'] == 1) {
    switch ($_POST['action']) {
        case 'changeemail':
            $status = $userObj->updateEmail() ? "changed" : "failed";
            header("Location: /account.php?email={$status}");
            break;
        case 'changepassword':
            $status = $userObj->updatePassword() ? "changed" : "nomatch";
            header("Location: /account.php?password={$status}");
            break;
        case 'deleteaccount':
            $userObj->deleteAccount();
            break;
        default:
            header("Location: /");
            break;
    }
} elseif ($_POST['action'] == "resetpassword") {
    if ($resp = $userObj->resetPassword() === TRUE) {
        header("Location: /resetpending.php");
    } else {
        echo $resp;
    }
    exit;
} else {
Exemplo n.º 2
0
<?php

include_once "common/base.php";
$pageTitle = "Verify Your Account";
include_once "common/header.php";
if (isset($_GET['v']) && isset($_GET['e'])) {
    include_once "inc/class.users.inc.php";
    $users = new FocusUsers($db);
    $ret = $users->verifyAccount();
} elseif (isset($_POST['v'])) {
    include_once "inc/class.users.inc.php";
    $users = new FocusUsers($db);
    $ret = $users->updatePassword();
} else {
    header("Location: /signup.php");
    exit;
}
if (isset($ret[0])) {
    echo isset($ret[1]) ? $ret[1] : NULL;
    if ($ret[0] < 3) {
        ?>

        <div class="inner cover">
          <form class="form-horizontal" role="form" method="post" action="accountverify.php">
            <div class="form-group">
              <label for="p" class="control-label col-xs-2">Password</label>
              <div class="col-xs-10">
                <input type="password" class="form-control" id="p" name="p" placeholder="Password" value="">
              </div>
            </div>
            <div class="form-group">