Permalink
Browse files

Auto sign in

  • Loading branch information...
dustball committed Jan 26, 2011
1 parent f09f8a4 commit 19002daed55ba3e46914fca8d27f42dd3548790e
Showing with 28 additions and 0 deletions.
  1. BIN static/countdown.gif
  2. +21 −0 static/signin.js
  3. +7 −0 templates/main.html
View
Binary file not shown.
View
@@ -15,6 +15,13 @@ function capstaff(evt) {
}
}
+function autosignin(x) {
+ if (x==1) go('Anonymous');
+ if (x==2) go('Member');
+ if (x==3) go('StaffKey');
+ $('#auto').slideUp();
+}
+
function stopRKey(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
@@ -61,6 +68,12 @@ function stopRKey(evt) {
document.getElementById("em").value = data.username + "@hackerdojo.com";
$('.rfidpic').attr("src",data.gravatar);
$('.rfidname').html(data.name);
+ if (data.auto_signin && data.auto_signin > 0 && data.auto_signin < 4) {
+ $('#auto').slideDown();
+ $('#count').attr("src","/static/countdown.gif");
+ window.auto = setTimeout("autosignin("+data.auto_signin+");",5000);
+ }
+
} else {
prepare_for_signin();
audio = new Audio("/static/denied.mp3");
@@ -117,6 +130,10 @@ function go(x) {
$('#rfidwelcome').fadeOut();
$('#ajaxloading').fadeIn();
main_screen_turn_on = false;
+ $('#auto').hide();
+ if (window.auto) {
+ clearTimeout(window.auto);
+ }
ok();
} else {
alert("Please enter a valid e-mail address");
@@ -129,8 +146,12 @@ function auto_reset() {
$('#thanks').fadeOut();
$('#denied').fadeOut();
$('#privacy').hide();
+ $('#auto').hide();
$('#rfidwelcome').fadeOut();
$('#ajaxloading').fadeOut();
+ if (window.auto) {
+ clearTimeout(window.auto);
+ }
main_screen_turn_on = false;
prepare_for_signin();
}
View
@@ -17,6 +17,13 @@
</div>
{% endif %}
+<div id="auto" class="corners" style="padding:1em; display:none; position:absolute; z-index:20; top:-12px; right:-12px; width:20%; border:2px solid #90900f; background:#ffffa0 ">
+ <center>
+ Auto Sign In
+ <img id="count" src="/static/countdown.gif" style="margin:1em" align="absmiddle" />
+ </center>
+</div>
+
<div id="tos" class="corners" style="display:none; position:absolute; z-index:2; top:10%; left:10%; width:80%; height:80%; border:2px solid black; background:white ">
<iframe style="border:none" border=0 width=100% src="http://hackerdojo.pbworks.com/api_v2/op/GetPage/page/Policies/_type/html" height=80%>
</iframe>

0 comments on commit 19002da

Please sign in to comment.