コード例 #1
0
ファイル: users.php プロジェクト: sahbic/Focus
<?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 {
コード例 #2
0
ファイル: closet.php プロジェクト: sahbic/Focus
<?php

include_once "common/base.php";
$pageTitle = "Closet";
include_once "common/header.php";
?>
				<div class="full" id="main">
					<noscript>This site just doesn't work, period, without JavaScript</noscript>
 <?php 
if (isset($_SESSION['LoggedIn']) && isset($_SESSION['Username'])) {
    echo "<table class=\"table table-hover\" id=\"list\">";
    echo "<tr>\n \t\t\t\t\t\t<td><b>Name</b></td>\n \t\t\t\t\t\t<td><b>Type</b></td>\n\t\t\t\t\t\t<td><b>Action</b></td>\n \t\t\t\t\t</tr>";
    include_once 'inc/class.items.inc.php';
    include_once 'inc/class.users.inc.php';
    $items = new FocusItems($db);
    $users = new FocusUsers($db);
    list($userID, $v) = $users->retrieveAccountInfo();
    $items->loadItemsByUser();
    echo "</table>";
    ?>

					 </br>
					 <div id="form-content" class="modal fade" tabindex="-1" role="dialog">
						 <div class="modal-dialog" role="document">
    			 		<div class="modal-content">
								<form class="form-horizontal" role="form"  id="add-new" method="post" action="db-interaction/items.php">
								 <div class="modal-header">
									 <a class="close" data-dismiss="modal">×</a>
								 </div>
								 <div class="modal-body">
									 	<div class="form-group">
コード例 #3
0
ファイル: signup.php プロジェクト: sahbic/Focus
<?php

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

        <div class="inner cover">
          <form class="form-horizontal" role="form" method="post" action="signup.php" id="registerform">
						 <div class="col-md-6 col-md-offset-3">
	            <div class="form-group">
	              <!-- <label for="username" class="control-label col-xs-2">Email</label> -->
	                <input type="text" class="form-control" id="username" name="username" placeholder="Email" value="">
	            </div>
	            <div class="form-group">
	                <button type="submit" name="register" id="register" class="btn btn-primary btn-block">Sign Up</button>
	            </div>
						</div>
          </form>
        </div>

<?php 
}
include_once 'common/close.php';
コード例 #4
0
ファイル: resetpassword.php プロジェクト: sahbic/Focus
<?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">
コード例 #5
0
ファイル: login.php プロジェクト: sahbic/Focus
<?php

include_once "common/base.php";
$pageTitle = "Home";
include_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'])) {
    include_once 'inc/class.users.inc.php';
    $users = new FocusUsers($db);
    if ($users->accountLogin() === TRUE) {
        echo "<meta http-equiv='refresh' content='0;/'>";
        exit;
    } else {
        ?>
        <div class="inner cover">
          <h4>Login Failed - Try Again?</h4>
          <br/>
          <br/>
          <form class="form-horizontal" role="form" method="post" action="login.php" name="loginform" id="loginform">
            <div class="col-md-6 col-md-offset-3">
              <div class="form-group">
                <input type="text" class="form-control" id="username" name="username" placeholder="Email" value="">
              </div>
              <div class="form-group">
                <input class="form-control" type="password" name="password" id="password" placeholder="Password" value="">
コード例 #6
0
ファイル: accountverify.php プロジェクト: sahbic/Focus
<?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">