Permalink
Browse files

added option to prevent logging out current user

  • Loading branch information...
1 parent ca29276 commit dd29ba86e914394c0ffe735c926211bb9424255e @chiva committed Oct 31, 2011
Showing with 24 additions and 4 deletions.
  1. +1 −0 README.rst
  2. +1 −1 tuitwall.ino
  3. +1 −0 web/config.php
  4. +15 −1 web/inc/html.inc
  5. +3 −1 web/inc/logged.inc
  6. +3 −1 web/inc/logged_st.inc
View
1 README.rst
@@ -44,6 +44,7 @@ Configuration
- SHOW_USER: include tweet owner when giving a tweet to a device through `fetch.php`?
- STREAM: show a stream from UStream at the main page? Useful when doing a demo of the project
- USTREAM_ID: ID of the stream from UStream you want to show
+- DISALLOW_LOGOUT: disallow logging out to keep tweets of a specific user being shown. To log out you have to delete ``auth.txt`` from the web server
**Arduino**
View
2 tuitwall.ino
@@ -45,7 +45,7 @@ void setup() {
Serial.begin(115200);
Serial.println();
- Serial.println(F("tuitwall BETA1"));
+ Serial.println(F("tuitwall BETA2"));
Serial.println(F("KungFu Labs - http://www.kungfulabs.com"));
Serial.println(F("tuitwall Copyright (C) 2011 Santiago Reig"));
Serial.println();
View
1 web/config.php
@@ -10,4 +10,5 @@
define('SHOW_USER', true); // incluir de quien es el tweet cuando Arduino lo pida
define('STREAM', false); // mostrar stream desde UStream para demos del proyecto
define('USTREAM_ID', 9584783); // ID del stream de UStreama a mostrar
+define('DISALLOW_LOGOUT', false); // deshabilita el poder cerrar sesión, útil para demos o si queremos fijar la configuración
?>
View
16 web/inc/html.inc
@@ -9,7 +9,21 @@
<body>
<div>
<h1><span>tuit</span>wall</h1>
- <h3>Inicia sesión con tu usuario y verás los tweets en la barra de LEDs</h3>
+ <?php if (DISALLOW_LOGOUT){
+ switch ($access_token['type']){
+ case "timeline":
+ echo "<h3>¿Cual es la actualidad?</h3>";
+ break;
+ case "menciones":
+ echo "<h3>¡Menciona a @{$access_token['screen_name']} y aparece!</h3>";
+ break;
+ case "propios":
+ echo "<h3>¿Que nos cuenta?</h3>";
+ break;
+ }
+ }
+ else echo "<h3>Inicia sesión con tu usuario y verás los tweets en la barra de LEDs</h3>";
+ ?>
</div>
<?php if (isset($error)) {
if (isset($access_token['user_id'])) {include('logged.inc');}
View
4 web/inc/logged.inc
@@ -2,7 +2,9 @@
<div style="float: left; padding-right: 8px; margin: 0; text-align: right;">
<?php echo ucfirst($access_token['type']);?>
<div style="margin:0; padding-top:3px;">
- <a href='./clearsessions.php'>Cerrar Sesión</a>
+ <?php if (!DISALLOW_LOGOUT){
+ echo "<a href='./clearsessions.php'>Cerrar Sesión</a>";
+ }?>
</div>
</div>
<div style="float: left; padding: 0; margin: 0; height: 48px; border-left: 1px solid #E6E6E6;">
View
4 web/inc/logged_st.inc
@@ -11,7 +11,9 @@
<div style="margin: 0; text-align: center; border-top: 1px solid #E6E6E6; padding-top: 5px;">
<?php echo ucfirst($access_token['type']);?>
<div style="margin:0;">
- <a href='./clearsessions.php'>Cerrar Sesión</a>
+ <?php if (!DISALLOW_LOGOUT){
+ echo "<a href='./clearsessions.php'>Cerrar Sesión</a>";
+ }?>
</div>
</div>
</div>

0 comments on commit dd29ba8

Please sign in to comment.