summaryrefslogtreecommitdiff
path: root/microbbs.c
diff options
context:
space:
mode:
Diffstat (limited to 'microbbs.c')
-rw-r--r--microbbs.c108
1 files changed, 107 insertions, 1 deletions
diff --git a/microbbs.c b/microbbs.c
index 6a6c098..8387cb8 100644
--- a/microbbs.c
+++ b/microbbs.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include "kconfig.h"
#include "logs.h"
#include "motd.h"
#include "libterm/term.h"
@@ -16,36 +17,139 @@ int main( int argc, char **argv )
term_init_data( &ts );
//printf("%d %d\n", ts.term_col, ts.term_row);
+ //lunch captcha and try to detect if its random bot
+#ifdef CONFIG_CAPTCHA
+ if ( captcha_test1() != 1)
+ return 1;
+#endif
+
//write to log that some user have accesed bbs
+ //too much fake stuff comes to log
//bbs_log( NULL ); //write to default place
+#ifdef CONFIG_MOTD
bbs_login_motd( &ts, "art/motd.txt" );
print_build_info();
+#endif
+
while ( strncmp( str, "q", 1 ) && strncmp( str, "Q", 1 ) )
{
- printf("(M)otd (Q)uit (S)ysinfo (A)rticles: ");
+ #ifdef CONFIG_MOTD
+ printf("(M)otd ");
+ #endif
+
+ #ifdef CONFIG_ARTICLES
+ printf("(A)rticles ");
+ #endif
+
+ #ifdef CONFIG_DOORGAMES
+ printf("(D)oor games ");
+ #endif
+
+ #ifdef CONFIG_TWIT
+ printf("(T)wit ");
+ #endif
+
+ #ifdef CONFIG_BOARD
+ printf("(B)oard ");
+ #endif
+
+ #ifdef CONFIG_LOGIN
+ printf("(L)ogin ");
+ #endif
+
+ #ifdef CONFIG_TODO
+ printf("T(o)do ");
+ #endif
+ printf("(Q)uit (S)ysinfo Mesa(G)es: ");
ret_len = getline( &str, &str_size, stdin );
if ( ret_len > 0)
{
switch ( str[0] )
{
+ //------------------------------------------------------------------
+ #ifdef CONFIG_MOTD
case 'm':
case 'M':
{
bbs_login_motd( &ts, "art/motd.txt" );
}
break;
+ #endif
case 's':
case 'S':
{
bbs_sysinfo( &ts );
}
break;
+
+ //------------------------------------------------------------------
+ #ifdef CONFIG_ARTICLES
case 'a':
case 'A':
{
bbs_article_list( &ts, "./article/" );
}
break;
+ #endif
+
+ //------------------------------------------------------------------
+ #ifdef CONFIG_TWIT
+ case 't':
+ case 'T':
+ {
+ printf("Twitter like\n");
+ }
+ break;
+ #endif
+
+ //------------------------------------------------------------------
+ #ifdef CONFIG_DOORGAMES
+ case 'd':
+ case 'D':
+ {
+ printf("Door games\n");
+ }
+ break;
+ #endif
+
+ case 'g':
+ case 'G':
+ {
+ printf("Messages\n");
+ }
+ break;
+
+ //------------------------------------------------------------------
+ #ifdef CONFIG_BOARD
+ case 'b':
+ case 'B':
+ {
+ printf("Board\n");
+ }
+ break;
+ #endif
+
+
+ //------------------------------------------------------------------
+ #ifdef CONFIG_LOGIN
+ case 'l':
+ case 'L':
+ {
+ printf("Login?\n");
+ }
+ break;
+ #endif
+
+ //------------------------------------------------------------------
+ #ifdef CONFIG_TODO
+ case 'o':
+ case 'O':
+ {
+ printf("Todo list\n");
+ }
+ break;
+ #endif
+
case 'q':
case 'Q':
bbs_log_quit( NULL );
@@ -55,6 +159,8 @@ int main( int argc, char **argv )
}
}
}
+#ifdef CONFIG_MOTD
bbs_quit_motd( &ts, "art/quit.txt" );
+#endif
return 0;
}