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; } else { $_SESSION['guest'] = false; } if ($currentUser->getCurrentUserIsBridalShower()) { $_SESSION['isBridalShower'] = true;
<td><input type="text" name="displayUserID" id="displayUserID" value="<?php echo $invalidSubmit ? isset($_REQUEST['userID']) ? $_REQUEST['userID'] : '' : $userEditor->getCurrentUserID(); ?> " placeholder="auto_increment" size="10" maxlength="254" tabindex="<?php echo $tabIndex++; ?> " disabled /> <input type="hidden" name="userID" id="userID" value="<?php echo $invalidSubmit ? isset($_REQUEST['userID']) ? $_REQUEST['userID'] : '' : $userEditor->getCurrentUserID(); ?> " /></td> </tr> <tr> <td><label for="username">Username: </label></td> <td><input type="text" name="username" id="username" value="<?php echo $invalidSubmit ? isset($_REQUEST['username']) ? $_REQUEST['username'] : '' : $userEditor->getCurrentUsername(); ?> " placeholder="Login Name" size="25" maxlength="254" required tabindex="<?php echo $tabIndex++; ?> " /></td> <td><label for="isRSVP">RSVP Submitted?</label></td> <td><input type="checkbox" <?php echo $invalidSubmit ? isset($_REQUEST['isRSVP']) ? 'checked' : '' : ($userEditor->getCurrentIsRSVP() ? 'checked' : ''); ?> name="isRSVP" id="isRSVP" tabindex="<?php echo $tabIndex++; ?> " /></td>
</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 . ")"; $emailMsg .= ' - Previous: [' . ($currentUser->getAttendeeIsAttending($attID) ? 'x' : ' ') . '] ' . $currentUser->getAttendeeDisplayName($attID) . "\r\n"; } if ($_REQUEST['displayName'][$attID] != '') { $currentUser->updateAttendeeRSVP($attID, $_REQUEST['isAttending'][$attID] == 'on' ? true : false, $isPlusOne, $_REQUEST['displayName'][$attID]); } else { $currentUser->updateAttendeeRSVP($attID, $_REQUEST['isAttending'][$attID] == 'on' ? true : false, $isPlusOne); } } $currentUser->updateCurrentRSVP($_REQUEST['email'], $_REQUEST['notesRSVP']); if ($isUpdate) {