RU beehive logo ITEC dept promo banner
ITEC 325
2015spring
ibarland

homelectshws
D2Lbreeze (snow day)

sessions
sessions

Due 2015-Apr-20 (Mon) 10:00

We will augment the trivia-question page so that it requires a login, to submit a question. See the example of sessions in lect29-sessions—sessions: chapter 9 (and the working code at page0.php).

(5pts) Add a <input type="password"/> to the form. For now, a login is “valid” if the password is “skillz”. A user will stay logged in for 60seconds, or until they log out (via a logout link).

<ins>clarification</ins>: That is: on a first-visit, the user will fill in the form and (presumably) the password. If they do provide the correct password, then they are logged in for 60sec. If they submit 5 more trivia-questions (very quickly — within 60s), then they won't need need to re-provide the password.
When logged in, the page should say “Hello userName.” in the upper-right corner, and “not logged in” otherwise. (In particular, don't do any auto-forwarding, as is in the lecture-examples.)

The password-field would be on the main form and submitted alongside all other information; if the password is correct then they are logged in (regardless if the form validates clientserver-side… though presumably it would if the client-side validation passed for submittal). If a user returns to the form-entry within 3060sec, they'll see a greeting for their name in the upper-right (e.g. “Hello ventra99.”).

(20pts) If a user submits a form and they are not logged in, (or if a different username was entered w/o a password, than the currently-logged-in user) it should count as a server-side validation error (and be printed as such). (Note that this approach works particularly well if you also complete the extra-credit sticky-form, ../hw06b-ec-sticky.)

homelectshws
D2Lbreeze (snow day)


©2014, Ian Barland, Radford University
Last modified 2015.Apr.19 (Sun)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.