]> bicyclesonthemoon.info Git - ott/ong1/commitdiff
Update from src directory as of 26.11.2016 main
authorb <rowerynaksiezycu@gmail.com>
Sat, 26 Nov 2016 10:30:52 +0000 (10:30 +0000)
committerb <rowerynaksiezycu@gmail.com>
Sat, 26 Nov 2016 10:30:52 +0000 (10:30 +0000)
makefile
mpview.c
post.cpp
posted.c

index 9f4ff622662569ee267a2415f6e961adb5d94264..d195a6102273801d80d2bd3f8fcd5009aba257e6 100644 (file)
--- a/makefile
+++ b/makefile
@@ -4,7 +4,7 @@ CF=-g -Wall
 LF=-lIL\r
 LF2=-lcgi\r
 \r
-all: bot4 deliver remove view mpview viewpage relink ong pleaseong update spoiler click generator post posted force enable npb npbd\r
+all: bot4 deliver remove view mpview viewpage relink ong pleaseong update spoiler click generator post posted force enable npb npbd exec\r
 \r
 npb: npb.cpp makefile\r
        $(CC2) $(CF) $(LF) -o npb npb.cpp\r
@@ -66,3 +66,6 @@ force: force.c
 \r
 enable: relink view click generator posted post remove ongtext pleaseong force\r
        chmod u+s relink view click generator posted post remove ongtext pleaseong force\r
+\r
+exec: spoiler.pl\r
+       chmod +x spoiler.pl\r
index 45c2cbaa8b124bdadffd23b27a0e276e8a04b8de..fb75ec123c52b0193c7ecdf71deb2b707a38f429 100644 (file)
--- a/mpview.c
+++ b/mpview.c
@@ -1,8 +1,8 @@
 // mpview.c (1190.bicyclesonthemoon.info/ct-if-v)\r
 // Display one post\r
-// 17.04.2015\r
+// 26.11.2016\r
 // \r
-// Copyright (C) 2015  Balthasar Szczepański\r
+// Copyright (C) 2015-2016  Balthasar Szczepański\r
 // \r
 // This program is free software: you can redistribute it and/or modify\r
 // it under the terms of the GNU Affero General Public License as\r
@@ -32,6 +32,7 @@
 #define INFO_PATH "/eizm/www/time/aftertime/bftf/info.htm"\r
 #define POST_PATH "/eizm/mem/ong1/mpost/"\r
 #define WAIT_PATH "/eizm/mem/ong1/mpost/wait/"\r
+#define RMOV_PATH "/eizm/mem/ong1/mpost/rm/"\r
 \r
 #define AWK_MVIEW "/eizm/pro/ong1/mview.awk"\r
 #define TEMP_PATH "/eizm/tmp/ong1/mpview."\r
@@ -76,6 +77,14 @@ int main()
                sprintf(postpath,"%s%s",WAIT_PATH,filename);\r
                sprintf(otherpath,"%s%s",POST_PATH,filename);\r
        }\r
+       else if(line[0]=='r' && line[1]=='m')\r
+       {\r
+               sprintf(filename,"%s",line+2);\r
+               sprintf(cat,"cat=%s","wt");\r
+               sprintf(othercat,"%s","ct");\r
+               sprintf(postpath,"%s%s",RMOV_PATH,filename);\r
+               sprintf(otherpath,"%s%s",RMOV_PATH,filename);\r
+       }\r
        else \r
        {\r
                printf("Status: 404 - Not found.\n\nNot this.\n");\r
index 72c597493366b18c7e260d338858539d6b5cf7e9..d1ce1fa3a5b40024273047f246be6039cc592cdb 100644 (file)
--- a/post.cpp
+++ b/post.cpp
@@ -1,8 +1,8 @@
 // post.cpp (1190.bicyclesonthemoon.info/ct-if-p)\r
 // The post edit interface\r
-// 17.04.2015\r
+// 27.05.2016\r
 // \r
-// Copyright (C) 2015  Balthasar Szczepański\r
+// Copyright (C) 2015-2016  Balthasar Szczepański\r
 // \r
 // This program is free software: you can redistribute it and/or modify\r
 // it under the terms of the GNU Affero General Public License as\r
@@ -58,6 +58,7 @@ char zero='\0';
 char *username = &zero;\r
 char *subject = &zero;\r
 char *message = &zero;\r
+//char *password = &zero;
 char *y = &zero;\r
 char *m = &zero;\r
 char *d = &zero;\r
@@ -437,6 +438,21 @@ int main()
        \r
        sprintf(temppath,"%s%lu",TEMP_PATH,(unsigned long)getpid());\r
        \r
+       arg=cgiGetValue(cgi,"password");\r
+       if(arg!=NULL)\r
+       {
+               if(strcmp(arg,"witaj w klubie"))
+               {
+                       missing=true;
+                       strcpy(wrong,"Incorrect password");
+               }
+       }
+       else\r
+       {\r
+               missing=true;\r
+               strcpy(wrong,"Password is missing.");\r
+       }\r
+       
        arg=cgiGetValue(cgi,"username");\r
        if(arg!=NULL)\r
                username=arg;\r
index ef4e19fd6d671d4e22ac3e086cb2d1c7228efc46..4eefa5722af0a0440b24c3e3e496e0e8d6f3954a 100644 (file)
--- a/posted.c
+++ b/posted.c
@@ -1,8 +1,8 @@
 // posted.c (1190.bicyclesonthemoon.info/ct-if)\r
 // Display the post list\r
-// 23.11.2014\r
+// 26.11.2016\r
 // \r
-// Copyright (C) 2014  Balthasar Szczepański\r
+// Copyright (C) 2014, 2016  Balthasar Szczepański\r
 // \r
 // This program is free software: you can redistribute it and/or modify\r
 // it under the terms of the GNU Affero General Public License as\r
@@ -26,6 +26,7 @@
 #define TEMP_PATH "/eizm/tmp/ong1/posted."\r
 #define MPOST_PATH "/eizm/mem/ong1/mpost/"\r
 #define WAIT_PATH "/eizm/mem/ong1/mpost/wait/"\r
+#define RMOV_PATH "/eizm/mem/ong1/mpost/rm/"\r
 #define LS_PATH "/bin/ls"\r
 #define RM_PATH "/bin/rm"\r
 #define MAWK_PATH "/usr/bin/mawk"\r
@@ -148,6 +149,51 @@ int main(int argc, char **argv)
        }\r
 // }\r
        \r
+       if(fff)\r
+       {\r
+               fflush(stdout);\r
+               sub=fork();\r
+               if(sub==0)\r
+               {\r
+                       if(freopen(temppath,"wt",stdout)==NULL)\r
+                               exit(255);\r
+                       r=execl(LS_PATH,LS_PATH,"-1","--color=never",RMOV_PATH,(char *)0);\r
+                       exit(r);\r
+               }\r
+               waitpid(sub,&r,0);\r
+               if(r)\r
+                       printf("No messages.<br>\n");\r
+               else\r
+               {\r
+                       printf("<br><table class=\"pl\"><tr class=\"pls\"><td colspan=\"5\">RMVD</td></tr>\n");\r
+                       printf("<tr class=\"plt\"><td class=\"plk\">sent</td><td class=\"plk\">received</td><td class=\"plk\">author</td><td class=\"plk\">subject</td><td class=\"plk\">action</td></tr>\n");\r
+                       \r
+                       tempfile=fopen(temppath,"rt");\r
+                       if(tempfile!=NULL)\r
+                       {\r
+                               for(i=0; fgets(line,31,tempfile)!=NULL; ++i)\r
+                               {\r
+                                       sscanf(line,"%s",filename);\r
+                                       sprintf(postpath,"%s%s",RMOV_PATH,filename);\r
+                                       \r
+                                       fflush(stdout);\r
+                                       sub=fork();\r
+                                       if(!sub)\r
+                                       {\r
+                                               r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_POSTED,"-v",i&0x1?"r2=1":"r2=0","-v","cat=rm","-v",fff?"fff=fff":"f=f",postpath,(char *)0);\r
+                                               exit(r);\r
+                                       }\r
+                                       waitpid(sub,&r,0);\r
+                                       if(r)\r
+                                       --i;\r
+                                       \r
+                               }\r
+                               fclose(tempfile);\r
+                       }\r
+                       \r
+               }\r
+               printf("</table>\n");\r
+       }       \r
        printf("<br><a href=\"/\">1190.bicyclesonthemoon.info</a></body></html>\n");\r
        \r
        fflush(stdout);\r