210 likes | 310 Views
A user-friendly web application allowing users to upload photos from their computer to the website. Includes a login system for user authentication and session tracking.
E N D
Photo Album Final Project AIT 616 Spring 2008 Tom Auth Ahmed Ismail
Picture upload • Intended to allow the user to select photos from their personal computer and add them to the website.
The upload page • Upload file.rhtml • ‘upload File’ • ‘upload’ • ‘data file’
Upload Controller Defines the index and the “uploadFile” actions. Calls Datafile.save
Datafile Model • Defines a function for .save • Shows where the files are to be saved. • Questionable section of code.
The login • Intended to authenticate users by user name and password. • Create a session that could be used to track the user as the moved from page to page. • -Also to identify the images that were associated to that user. • Created a whole set of functions with scaffold.
The login Page • Consists of two fields • Calls the action “login”
Login def. In the controller • The redirect actions direct the website to the proper controller or page base don the outcome of authenticate
Users / Login controller Cont • The “show” definition is what held up the whole app. • This is the original index definition that would have shown all the users when accessed.
User / Login Model • Very simple version • U=find(:first, :conditions=>[“nickname=? And password=?”, nickname, password])
The User Database • The integer Id and the date and time fields are auto created with the scaffold. • The rest serve to ID the user and authenticate them for access to the site.