removed more facebook stuff
This commit is contained in:
parent
c39506fe6c
commit
306ab86787
6 changed files with 4 additions and 66 deletions
28
WebContent/header.jsp
Normal file → Executable file
28
WebContent/header.jsp
Normal file → Executable file
|
|
@ -54,7 +54,7 @@ UserMessage message = UserMessage.getUserMessage(session);
|
||||||
}, "Please enter your first and last name" );
|
}, "Please enter your first and last name" );
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Facebook -->
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// Google Analythics
|
// Google Analythics
|
||||||
var _gaq = _gaq || [];
|
var _gaq = _gaq || [];
|
||||||
|
|
@ -81,30 +81,6 @@ UserMessage message = UserMessage.getUserMessage(session);
|
||||||
<body class="single">
|
<body class="single">
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<div id="fb-root"></div>
|
|
||||||
<script>
|
|
||||||
window.fbAsyncInit = function() {
|
|
||||||
FB.init({
|
|
||||||
appId : '110543555676926',
|
|
||||||
status : true,
|
|
||||||
cookie : true,
|
|
||||||
xfbml : true,
|
|
||||||
oauth : true,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
(function(d) {
|
|
||||||
var js, id = 'facebook-jssdk';
|
|
||||||
if (d.getElementById(id)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
js = d.createElement('script');
|
|
||||||
js.id = id;
|
|
||||||
js.async = true;
|
|
||||||
js.src = "//connect.facebook.net/en_US/all.js";
|
|
||||||
d.getElementsByTagName('head')[0].appendChild(js);
|
|
||||||
}(document));
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="wrapper" class="hfeed">
|
<div id="wrapper" class="hfeed">
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<div id="branding">
|
<div id="branding">
|
||||||
|
|
@ -133,8 +109,6 @@ UserMessage message = UserMessage.getUserMessage(session);
|
||||||
<% if( user != null ){ %>
|
<% if( user != null ){ %>
|
||||||
<li class="cat-item"><a href="page_geni.jsp" title="Family tree">Geni</a></li>
|
<li class="cat-item"><a href="page_geni.jsp" title="Family tree">Geni</a></li>
|
||||||
<li class="cat-item"><a href="page_chat.jsp" title="Video chat with other users">Chat</a></li>
|
<li class="cat-item"><a href="page_chat.jsp" title="Video chat with other users">Chat</a></li>
|
||||||
|
|
||||||
<li class="blog-description"><A id="FB_logout" href="logout" onClick="FB.logout(); return true;">Logout <%=user.getName() %></A></li>
|
|
||||||
<% } %>
|
<% } %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
5
WebContent/login.jsp
Normal file → Executable file
5
WebContent/login.jsp
Normal file → Executable file
|
|
@ -29,7 +29,7 @@
|
||||||
<DIV class="formcontainer">
|
<DIV class="formcontainer">
|
||||||
<FORM id="loginform" method="post" action="<%=( request.getParameter("redirect") != null ? request.getParameter("redirect") : "gallery" ) %>">
|
<FORM id="loginform" method="post" action="<%=( request.getParameter("redirect") != null ? request.getParameter("redirect") : "gallery" ) %>">
|
||||||
<INPUT type="hidden" name="action" value="login">
|
<INPUT type="hidden" name="action" value="login">
|
||||||
<P id="comment-notes">Please login with your email address and password or with an existing Facebook account.</P>
|
<P id="comment-notes">Please login with your email address and password.</P>
|
||||||
|
|
||||||
<DIV class="form-section">
|
<DIV class="form-section">
|
||||||
<DIV class="form-label"><LABEL for="email">Email</LABEL> <SPAN class="required">*</SPAN></DIV>
|
<DIV class="form-label"><LABEL for="email">Email</LABEL> <SPAN class="required">*</SPAN></DIV>
|
||||||
|
|
@ -44,9 +44,6 @@
|
||||||
<INPUT id="submit" name="login" type="submit" value="Login" tabindex="7">
|
<INPUT id="submit" name="login" type="submit" value="Login" tabindex="7">
|
||||||
<INPUT type="button" value="Register" tabindex="8" onClick="document.location='register'">
|
<INPUT type="button" value="Register" tabindex="8" onClick="document.location='register'">
|
||||||
|
|
||||||
<SPAN style="float: right;">
|
|
||||||
<!-- <fb:login-button id="fb-auth"></fb:login-button> -->
|
|
||||||
</SPAN>
|
|
||||||
</FORM><!-- #commentform -->
|
</FORM><!-- #commentform -->
|
||||||
</DIV><!-- .formcontainer -->
|
</DIV><!-- .formcontainer -->
|
||||||
</DIV><!-- .formcontainer -->
|
</DIV><!-- .formcontainer -->
|
||||||
|
|
|
||||||
1
WebContent/media.jsp
Normal file → Executable file
1
WebContent/media.jsp
Normal file → Executable file
|
|
@ -72,7 +72,6 @@
|
||||||
<LI class="designer"> Uploaded by: <%=media.getUser().getName() %></LI>
|
<LI class="designer"> Uploaded by: <%=media.getUser().getName() %></LI>
|
||||||
<LI class="site-link"> <A rel="source" href="<%=request.getRequestURL() %>?type=<%=media.getType() %>&id=<%=media.getId() %>"><%=request.getRequestURL() %>?type=<%=media.getType() %>&id=<%=media.getId() %></A></LI>
|
<LI class="site-link"> <A rel="source" href="<%=request.getRequestURL() %>?type=<%=media.getType() %>&id=<%=media.getId() %>"><%=request.getRequestURL() %>?type=<%=media.getType() %>&id=<%=media.getId() %></A></LI>
|
||||||
<%if( media instanceof Image){ %> <LI class="slideshow-link"> <A rel="source" href="slideshow?id=<%=media.getId() %>">Slideshow</A> </LI> <%} %>
|
<%if( media instanceof Image){ %> <LI class="slideshow-link"> <A rel="source" href="slideshow?id=<%=media.getId() %>">Slideshow</A> </LI> <%} %>
|
||||||
<LI class="facebook"> <fb:like colorscheme="dark"></fb:like> </LI>
|
|
||||||
<LI align="right"> <button onClick="window.location='content?type=<%=media.getType() %>&id=<%=media.getId()%>&download'">Download</button> </LI>
|
<LI align="right"> <button onClick="window.location='content?type=<%=media.getType() %>&id=<%=media.getId()%>&download'">Download</button> </LI>
|
||||||
</UL>
|
</UL>
|
||||||
<!--
|
<!--
|
||||||
|
|
|
||||||
5
WebContent/profile.jsp
Normal file → Executable file
5
WebContent/profile.jsp
Normal file → Executable file
|
|
@ -112,11 +112,6 @@ User user = (User)request.getAttribute("profile_user");
|
||||||
<li class="page_item"><a href="?id=<%=user.getId() %>&page=password" title="Change Password">Password</a></li>
|
<li class="page_item"><a href="?id=<%=user.getId() %>&page=password" title="Change Password">Password</a></li>
|
||||||
<li class="page_item">Faces <!-- <a href="?id=<%=user.getId() %>&page=faces" title="Edit Detected faces">Faces</a> --></li>
|
<li class="page_item">Faces <!-- <a href="?id=<%=user.getId() %>&page=faces" title="Edit Detected faces">Faces</a> --></li>
|
||||||
<li class="page_item"> </li>
|
<li class="page_item"> </li>
|
||||||
<% if( user.getFacebookUid() == null ){ %>
|
|
||||||
<li class="page_item">
|
|
||||||
<!-- <fb:login-button>Connect to Facebook</fb:login-button> -->
|
|
||||||
</li>
|
|
||||||
<%} %>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
3
WebContent/users.jsp
Normal file → Executable file
3
WebContent/users.jsp
Normal file → Executable file
|
|
@ -42,9 +42,6 @@ if( request.getParameter("search") != null ){
|
||||||
out.println(" <td width='180px'><b>Last login:</b> "+formatter.format( printUser.getLoginDate() )+"</td>");
|
out.println(" <td width='180px'><b>Last login:</b> "+formatter.format( printUser.getLoginDate() )+"</td>");
|
||||||
}
|
}
|
||||||
out.println(" <td> ");
|
out.println(" <td> ");
|
||||||
if( printUser.getFacebookUid() != null ){
|
|
||||||
out.println(" <a href='http://www.facebook.com/profile.php?id="+printUser.getFacebookUid()+"' target='blank' title='Link to Facebook profile'>Facebook</a>");
|
|
||||||
}
|
|
||||||
out.println(" </td>");
|
out.println(" </td>");
|
||||||
out.println(" </tr>");
|
out.println(" </tr>");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import zutil.db.handler.SimpleSQLResult;
|
||||||
@DBTable("User")
|
@DBTable("User")
|
||||||
public class User extends DBBean{
|
public class User extends DBBean{
|
||||||
public enum AuthType{
|
public enum AuthType{
|
||||||
USER_INPUT, COOKIE, FACEBOOK
|
USER_INPUT, COOKIE
|
||||||
}
|
}
|
||||||
public static final long SESSION_TIMEOUT = 1000*60*60*24*3; // 3day ttl
|
public static final long SESSION_TIMEOUT = 1000*60*60*24*3; // 3day ttl
|
||||||
|
|
||||||
|
|
@ -113,28 +113,6 @@ public class User extends DBBean{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Uses Facebook user id to get a user object,
|
|
||||||
* this function will save the bean
|
|
||||||
*
|
|
||||||
* @param db is the DB connection
|
|
||||||
* @param uid is the Facebook UID(user id)
|
|
||||||
* @return The user object or null if non where found
|
|
||||||
*/
|
|
||||||
public static User loadByFacebook(HttpServletRequest request, HttpServletResponse response, DBConnection db, String uid ) throws SQLException{
|
|
||||||
PreparedStatement sql = db.getPreparedStatement(
|
|
||||||
"SELECT * FROM User WHERE facebookUid=? LIMIT 1");
|
|
||||||
sql.setString(1, uid);
|
|
||||||
|
|
||||||
User user = DBConnection.exec(sql, DBBeanSQLResultHandler.create(User.class, db));
|
|
||||||
if( user != null ){
|
|
||||||
user.registerOnHost(request, response, db, false);
|
|
||||||
user.setAuthBy( AuthType.FACEBOOK );
|
|
||||||
user.save(db);
|
|
||||||
}
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean emailExists(String email, DBConnection db) throws SQLException{
|
public static boolean emailExists(String email, DBConnection db) throws SQLException{
|
||||||
PreparedStatement sql = db.getPreparedStatement(
|
PreparedStatement sql = db.getPreparedStatement(
|
||||||
"SELECT email FROM User WHERE email=? LIMIT 1");
|
"SELECT email FROM User WHERE email=? LIMIT 1");
|
||||||
|
|
@ -190,8 +168,6 @@ public class User extends DBBean{
|
||||||
loginDate.getTime()+1000 > System.currentTimeMillis() ) &&
|
loginDate.getTime()+1000 > System.currentTimeMillis() ) &&
|
||||||
ipHost.equals( request.getRemoteAddr() ) &&
|
ipHost.equals( request.getRemoteAddr() ) &&
|
||||||
loginDate.getTime()+SESSION_TIMEOUT > System.currentTimeMillis();
|
loginDate.getTime()+SESSION_TIMEOUT > System.currentTimeMillis();
|
||||||
case FACEBOOK:
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue