From: b Date: Sat, 26 Nov 2016 10:30:52 +0000 (+0000) Subject: Update from src directory as of 26.11.2016 X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=HEAD;p=ott%2Fong1 Update from src directory as of 26.11.2016 --- diff --git a/makefile b/makefile index 9f4ff62..d195a61 100644 --- a/makefile +++ b/makefile @@ -4,7 +4,7 @@ CF=-g -Wall LF=-lIL LF2=-lcgi -all: bot4 deliver remove view mpview viewpage relink ong pleaseong update spoiler click generator post posted force enable npb npbd +all: bot4 deliver remove view mpview viewpage relink ong pleaseong update spoiler click generator post posted force enable npb npbd exec npb: npb.cpp makefile $(CC2) $(CF) $(LF) -o npb npb.cpp @@ -66,3 +66,6 @@ force: force.c enable: relink view click generator posted post remove ongtext pleaseong force chmod u+s relink view click generator posted post remove ongtext pleaseong force + +exec: spoiler.pl + chmod +x spoiler.pl diff --git a/mpview.c b/mpview.c index 45c2cba..fb75ec1 100644 --- a/mpview.c +++ b/mpview.c @@ -1,8 +1,8 @@ // mpview.c (1190.bicyclesonthemoon.info/ct-if-v) // Display one post -// 17.04.2015 +// 26.11.2016 // -// Copyright (C) 2015 Balthasar Szczepański +// Copyright (C) 2015-2016 Balthasar Szczepański // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as @@ -32,6 +32,7 @@ #define INFO_PATH "/eizm/www/time/aftertime/bftf/info.htm" #define POST_PATH "/eizm/mem/ong1/mpost/" #define WAIT_PATH "/eizm/mem/ong1/mpost/wait/" +#define RMOV_PATH "/eizm/mem/ong1/mpost/rm/" #define AWK_MVIEW "/eizm/pro/ong1/mview.awk" #define TEMP_PATH "/eizm/tmp/ong1/mpview." @@ -76,6 +77,14 @@ int main() sprintf(postpath,"%s%s",WAIT_PATH,filename); sprintf(otherpath,"%s%s",POST_PATH,filename); } + else if(line[0]=='r' && line[1]=='m') + { + sprintf(filename,"%s",line+2); + sprintf(cat,"cat=%s","wt"); + sprintf(othercat,"%s","ct"); + sprintf(postpath,"%s%s",RMOV_PATH,filename); + sprintf(otherpath,"%s%s",RMOV_PATH,filename); + } else { printf("Status: 404 - Not found.\n\nNot this.\n"); diff --git a/post.cpp b/post.cpp index 72c5974..d1ce1fa 100644 --- a/post.cpp +++ b/post.cpp @@ -1,8 +1,8 @@ // post.cpp (1190.bicyclesonthemoon.info/ct-if-p) // The post edit interface -// 17.04.2015 +// 27.05.2016 // -// Copyright (C) 2015 Balthasar Szczepański +// Copyright (C) 2015-2016 Balthasar Szczepański // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as @@ -58,6 +58,7 @@ char zero='\0'; char *username = &zero; char *subject = &zero; char *message = &zero; +//char *password = &zero; char *y = &zero; char *m = &zero; char *d = &zero; @@ -437,6 +438,21 @@ int main() sprintf(temppath,"%s%lu",TEMP_PATH,(unsigned long)getpid()); + arg=cgiGetValue(cgi,"password"); + if(arg!=NULL) + { + if(strcmp(arg,"witaj w klubie")) + { + missing=true; + strcpy(wrong,"Incorrect password"); + } + } + else + { + missing=true; + strcpy(wrong,"Password is missing."); + } + arg=cgiGetValue(cgi,"username"); if(arg!=NULL) username=arg; diff --git a/posted.c b/posted.c index ef4e19f..4eefa57 100644 --- a/posted.c +++ b/posted.c @@ -1,8 +1,8 @@ // posted.c (1190.bicyclesonthemoon.info/ct-if) // Display the post list -// 23.11.2014 +// 26.11.2016 // -// Copyright (C) 2014 Balthasar Szczepański +// Copyright (C) 2014, 2016 Balthasar Szczepański // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as @@ -26,6 +26,7 @@ #define TEMP_PATH "/eizm/tmp/ong1/posted." #define MPOST_PATH "/eizm/mem/ong1/mpost/" #define WAIT_PATH "/eizm/mem/ong1/mpost/wait/" +#define RMOV_PATH "/eizm/mem/ong1/mpost/rm/" #define LS_PATH "/bin/ls" #define RM_PATH "/bin/rm" #define MAWK_PATH "/usr/bin/mawk" @@ -148,6 +149,51 @@ int main(int argc, char **argv) } // } + if(fff) + { + fflush(stdout); + sub=fork(); + if(sub==0) + { + if(freopen(temppath,"wt",stdout)==NULL) + exit(255); + r=execl(LS_PATH,LS_PATH,"-1","--color=never",RMOV_PATH,(char *)0); + exit(r); + } + waitpid(sub,&r,0); + if(r) + printf("No messages.
\n"); + else + { + printf("
\n"); + printf("\n"); + + tempfile=fopen(temppath,"rt"); + if(tempfile!=NULL) + { + for(i=0; fgets(line,31,tempfile)!=NULL; ++i) + { + sscanf(line,"%s",filename); + sprintf(postpath,"%s%s",RMOV_PATH,filename); + + fflush(stdout); + sub=fork(); + if(!sub) + { + 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); + exit(r); + } + waitpid(sub,&r,0); + if(r) + --i; + + } + fclose(tempfile); + } + + } + printf("
RMVD
sentreceivedauthorsubjectaction
\n"); + } printf("
1190.bicyclesonthemoon.info\n"); fflush(stdout);