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
\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
// 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
#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
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
// 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
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
\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
// 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
#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
}\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