Exemple #1
0
<?php

require_once 'vendor/autoload.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 WoobsUsers($db);
    $ret = $users->verifyAccount();
} elseif (isset($_POST['v'])) {
    include_once "inc/class.users.inc.php";
    $users = new WoobsUsers($db);
    $users->updateUsername();
    $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="container">
        <h2>Choose a Username and Password</h2>
        <form class="form-horizontal" method="post" role="form" action="accountverify.php" name="accountverifyform" id="accountverifyform">
            <div class="form-group">
                <div class="col-xs-4">
                    <label for="u">Choose a Username</label>
                    <input type="text" class="form-control" id="u" name="u" placeholder="Username">
                </div>
Exemple #2
0
<?php

require_once 'vendor/autoload.php';
include_once "common/base.php";
if (isset($_GET['v']) && isset($_GET['e'])) {
    include_once "inc/class.users.inc.php";
    $users = new WoobsUsers($db);
    $ret = $users->verifyAccount();
} elseif (isset($_POST['v'])) {
    include_once "inc/class.users.inc.php";
    $users = new WoobsUsers($db);
    $status = $users->updatePassword() ? "changed" : "failed";
    header("Location: /account.php?p={$status}");
    exit;
} else {
    header("Location: /index.php");
    exit;
}
$pageTitle = "Reset Your Password";
include_once "common/header.php";
if (isset($ret[0])) {
    echo isset($ret[1]) ? $ret[1] : NULL;
    if ($ret[0] < 3) {
        ?>
    <div class="container">
        <h2>Reset Your Password</h2>
        
        <form class="form-horizontal" method="post" role="form" action="accountverify.php" name="forgetpasswordform" id="forgetpasswordform">
            <input type="hidden" name="action" value="resetpassword" />
            <div class="form-group">
                <div class="col-xs-4">
Exemple #3
0
require_once "../vendor/autoload.php";
include_once "../inc/constants.inc.php";
include_once "../inc/class.users.inc.php";
$userObj = new WoobsUsers();
if (!empty($_POST['action']) && isset($_SESSION['LoggedIn']) && $_SESSION['LoggedIn'] == 1) {
    switch ($_POST['action']) {
        case 'changeusername':
            $status = $userObj->updateUsername() ? "changed" : "failed";
            header("Location: /account.php?username={$status}");
            break;
        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;
    }