//alert("inserted"); } </script> <section class="content"> <?php if (isset($_REQUEST['submitted'])) { //echo displayTree($_REQUEST); //print_r($_REQUEST); require_once "classWeddingUser.inc"; $userCreator = new weddingUser(); if (isset($_REQUEST['username']) && $_REQUEST['username'] != '') { if ($userCreator->usernameExists($_REQUEST['username'])) { $errors['username'] = '******'; } else { $username = $_REQUEST['username']; } } else { $errors['username'] = '******'; } if (isset($_REQUEST['passwordPlaintext']) && $_REQUEST['passwordPlaintext'] != '') { $pw = $_REQUEST['passwordPlaintext']; } else { $errors['passwordPlaintext'] = 'Invalid Password'; } if (isset($_REQUEST['name']) && $_REQUEST['name'] != '') {
<?php //TODO: Total duplication between guests_edit.php and guests_new.php...needs to be reduced into one file. /* notes: for existing attendees, array of controls names will match db fields, like "isAttending" and "isPlusOne", and index [] will match attendeeID else, it will be array of "new_isAttending", "new_isPlusOne", and index [] will simply be numeric I know i'm mixing underscores and camel-case, but I'll sacrifice the style for readability in this case. Shrug. */ $isSuperUserPage = true; require_once "resources/includePath.inc"; $page_title = "Edit User"; include "header.inc"; require_once "classWeddingUser.inc"; $userEditor = new weddingUser(); $userID = 0; if (isset($_REQUEST['userID']) && is_numeric($_REQUEST['userID'])) { $userID = $_REQUEST['userID']; // if($userEditor->isUserAdminByID($userID)) // { // echo '<p>Error #1337: Admin users cannot be edited with this form!</p>'; // include("footer.inc"); // exit(); // } } else { echo '<p>Error #0x2A: User ID not specified!</p>'; include "footer.inc"; exit; } $promptPlaceholderPlusOne = "Leave blank to be 'Guest'"; $promptPlaceholderNotPlusOne = "Required (If not +1)";
<?php session_start(); if (!isset($_SESSION['login']) || $_SESSION['login'] < 2) { echo "Administrator not logged in!"; exit; } // require_once("../resources/includePath.inc"); if (isset($_REQUEST['userID'])) { require_once '../resources/includePath.inc'; require_once 'classWeddingUser.inc'; $userManager = new weddingUser(); $attArray = $userManager->getAttendeesArrayByID($_REQUEST['userID']); header('Content-Type: application/json'); echo json_encode($attArray); } else { header('Content-Type: application/json'); echo 'false'; }
<?php $isSuperUserPage = true; $useJQuery = true; require_once "resources/includePath.inc"; $page_title = "Guests Table"; include "header.inc"; // Set by header.inc: $currTime = time(); $dateWedding = strtotime('2013-10-20 00:01'); ?> <section class="content"> <!-- style="position:absolute; left:210px; top:150px;"> --> <?php require_once "classWeddingUser.inc"; $userManager = new weddingUser(); $userManager->initializeAllUsers(); ?> <table id="tableUsers"> <thead class="rowHead"> <tr> <td colspan="2">Modify</td> <td rowspan="2">Username</td> <td rowspan="2">Name</td> <!--<td>RSVP?</td>--> <td rowspan="2">RSVP<br />Notes</td> <td rowspan="2">Email</td> <td rowspan="2">Address</td> <td rowspan="2">Gift Notes</td> <td rowspan="2">ThYou Notes</td>
<?php session_start(); require_once "resources/includePath.inc"; $page_title = "Wedding Guest Login"; if (isset($_REQUEST['submitted'])) { if (empty($_REQUEST['username'])) { $errors['username'] = '******'; } if (empty($_REQUEST['password'])) { $errors['password'] = '******'; } if (!isset($errors)) { require_once "classWeddingUser.inc"; //Note: model class sanitizes input $currentUser = new weddingUser(); if ($usrID = $currentUser->validateUser($_REQUEST['username'], $_REQUEST['password'])) { $currentUser->setCurrentUser($usrID); //set session variables with userID, name, etc $_SESSION['userID'] = $currentUser->getCurrentUserID(); $_SESSION['username'] = $currentUser->getCurrentUsername(); $_SESSION['name'] = $currentUser->getCurrentFullName(); if ($currentUser->getCurrentUserIsAdmin()) { $_SESSION['login'] = 2; } else { $_SESSION['login'] = 1; } //regular user //"guest" hack: if ($_SESSION['username'] == "Guest") { $_SESSION['guest'] = true;
<?php // guests_delete_attendee.php session_start(); if (!isset($_SESSION['login']) || $_SESSION['login'] < 2) { echo "Administrator not logged in!"; exit; } // require_once("../resources/includePath.inc"); if (isset($_REQUEST['attID'])) { require_once '../resources/includePath.inc'; require_once 'classWeddingUser.inc'; $userManager = new weddingUser(); if ($userManager->deleteAttendee($_REQUEST['attID'])) { echo 'true'; } else { echo 'false'; } //header('Content-Type: application/json'); //echo json_encode($attArray); } else { echo 'false'; }
else { for (var i = 0; i < inputs.length; ++i) inputs[i].disabled = true; document.getElementById("notesRSVP").disabled = true; elem.className = "lockedButton"; elem.value = "Locked"; elem.disabled = false; } } </script> <section class=content> <?php require_once "classWeddingUser.inc"; $currentUser = new weddingUser(); $currentUser->setCurrentUser($_SESSION['userID']); if (isset($_REQUEST['submitted'])) { //echo print_r($_REQUEST); $isUpdate = $currentUser->getCurrentIsRSVP(); $oldTotal = $currentUser->getCurrentNumAttending(); $oldSumAttending = $currentUser->getTotalAttending(); if ($isUpdate) { $emailMsg = '<strong>Changed RSVP Submitted</strong><br /> ' . date(DATE_RFC850) . '<br />--------<pre>'; $emailMsg .= 'Name: ' . $currentUser->getCurrentFullName() . "\r\n"; $emailMsg .= 'Username: '******'UserID: ' . $currentUser->getcurrentUserID() . "\r\n\r\n"; } foreach ($_REQUEST['isPlusOne'] as $attID => $isPlusOne) { if ($isUpdate) { $emailMsg .= '[' . ($_REQUEST['isAttending'][$attID] == 'on' ? 'x' : ' ') . '] ' . $_REQUEST['displayName'][$attID] . '(ID: ' . $attID . ")";
<?php // guests_delete_user.php session_start(); if (!isset($_SESSION['login']) || $_SESSION['login'] < 2) { echo "Administrator not logged in!"; exit; } // require_once("../resources/includePath.inc"); if (isset($_REQUEST['userID'])) { require_once '../resources/includePath.inc'; require_once 'classWeddingUser.inc'; $userManager = new weddingUser(); if ($userManager->deleteUser($_REQUEST['userID'])) { echo 'true'; } else { echo 'false'; } //header('Content-Type: application/json'); //echo json_encode($attArray); } else { echo 'false'; }