Beispiel #1
0
<?php

include_once "common/base.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 ColoredListsUsers($db);
    $status = $users->updatePassword() ? "changed" : "failed";
    header("Location: /account.php?password={$status}");
    exit;
} else {
    header("Location: /login.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="inner cover">
          <br/><br/>
          <form class="form-horizontal" role="form" method="post" action="accountverify.php">
            <div class="form-group">
              <label for="p" class="control-label col-xs-2">Choose a New Password:</label>
              <div class="col-xs-10">
<?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 ColoredListsUsers($db);
    $ret = $users->verifyAccount();
} elseif (isset($_POST['v'])) {
    include_once "inc/class.users.inc.php";
    $users = new ColoredListsUsers($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) {
        ?>

        <h2>Choose a Password</h2>

        <form method="post" action="accountverify.php">
            <div>
                <label for="p">Choose a Password:</label>
                <input type="password" name="p" id="p" /><br />
                <label for="r">Re-Type Password:</label>
                <input type="password" name="r" id="r" /><br />
                <input type="hidden" name="v" value="<?php 
Beispiel #3
0
<?php

include_once "common/database.php";
if (isset($_SESSION['LoggedIn']) && $_SESSION['LoggedIn'] == 1) {
    $pageTitle = "Your Account";
    include_once "common/header.php";
    include_once 'inc/class.users.inc.php';
    $users = new ColoredListsUsers($db);
    if (isset($_GET['email']) && $_GET['email'] == "changed") {
        echo "<div class='message good'>Your email address " . "has been changed.</div>";
    } else {
        if (isset($_GET['email']) && $_GET['email'] == "failed") {
            echo "<div class='message bad'>There was an error " . "changing your email address.</div>";
        }
    }
    if (isset($_GET['password']) && $_GET['password'] == "changed") {
        echo "<div class='message good'>Your password " . "has been changed.</div>";
    } elseif (isset($_GET['password']) && $_GET['password'] == "nomatch") {
        echo "<div class='message bad'>The two passwords " . "did not match. Try again!</div>";
    }
    if (isset($_GET['delete']) && $_GET['delete'] == "failed") {
        echo "<div class='message bad'>There was an error " . "deleting your account.</div>";
    }
    list($userID, $v) = $users->retrieveAccountInfo();
    ?>
 
 
        <h2>Your Account</h2> 
        <form method="post" action="db-interaction/users.php"> 
            <div> 
                <input type="hidden" name="userid" 
<?php

include_once "common/base.php";
$pageTitle = "Register";
include_once "common/header.php";
if (!empty($_POST['username'])) {
    //used a different if/else syntax w/ ':'
    include_once "inc/class.users.inc.php";
    $users = new ColoredListsUsers($db);
    echo $users->createAccount();
} else {
    ?>

    <h2>Sign up</h2>
    <form method="post" action="signup.php" id="registerform">
        <div>
            <label for="username">Email:</label>
            <input type="text" name="username" id="username" /><br />
            <input type="submit" name="register" id="register" value="Sign up" />
        </div>
    </form>


<?php 
}
//end if
include_once 'common/close.php';
<?php

session_start();
require_once "../inc/constants.inc.php";
require_once "../inc/class.users.inc.php";
$userObj = new ColoredListsUsers();
if (!empty($_POST['action']) && isset($_SESSION['LoggedIn']) && $_SESSION['LoggedIn'] == 1) {
    switch ($_POST['action']) {
        case 'changeemail':
            $status = $userObj->updateEmail() ? "changed" : "failed";
            header("Location: /Outreach/account.php?email={$status}");
            break;
        case 'changepassword':
            $status = $userObj->updatePassword() ? "changed" : "nomatch";
            header("Location: /Outreach/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: /Outreach/resetpending.php");
    } else {
        echo $resp;
    }
    exit;
} else {
<?php

require_once "common/base.php";
$pageTitle = "Home";
require_once "common/header.php";
if (!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username'])) {
    ?>

        <p>You are currently <strong>logged in.</strong></p>
        <p><a href="logout.php">Log out</a></p>
<?php 
} elseif (!empty($_POST['username']) && !empty($_POST['password'])) {
    require_once 'inc/class.users.inc.php';
    $users = new ColoredListsUsers($db);
    if ($users->accountLogin() === TRUE) {
        echo "<meta http-equiv='refresh' content='0;/Outreach/'>";
        exit;
    } else {
        ?>

        <h2>Login Failed&mdash;Try Again?</h2>
        <form method="post" action="login.php" name="loginform" id="loginform">
            <div>
                <input type="text" name="username" id="username" />
                <label for="username">Email</label>
                <br /><br />
                <input type="password" name="password" id="password" />
                <label for="password">Password</label>
                <br /><br />
                <input type="submit" name="login" id="login" value="Login" class="button" />
            </div>