int bbsdenyadd_main() { int i; char exp[80], board[80], *userid; int dt; struct userec *x; struct boardmem *x1; html_header(1); check_msg(); if (!loginok || isguest) http_fatal("您尚未登录, 请先登录"); changemode(READING); getparmboard(board, sizeof(board)); strsncpy(exp, getparm("exp"), 30); dt = atoi(getparm("dt")); if (!(x1 = getboard(board))) http_fatal("错误的讨论区"); if (!has_BM_perm(currentuser, x1)) http_fatal("你无权进行本操作"); loaddenyuser(board); userid = getparm("userid"); if (userid[0] == 0) return show_form(board); if (getuser(userid, &x) <= 0) http_fatal("错误的使用者帐号"); if (!has_post_perm(x, x1)) http_fatal("这个人本来就没有post权"); strcpy(userid, x->userid); if (!(currentuser->userlevel & PERM_SYSOP) && (dt > 14)) http_fatal("封禁时间大于14天,超过了权限,若需要,请联系站长"); if (dt < 1 || dt > 99) http_fatal("请输入被封天数(1-99)"); if (exp[0] == 0) http_fatal("请输入封人原因"); for (i = 0; i < denynum; i++) if (!strcasecmp(denyuser[i].id, userid)) http_fatal("此用户已经被封"); if (denynum > 40) http_fatal("太多人被封了"); strsncpy(denyuser[denynum].id, userid, 13); strsncpy(denyuser[denynum].exp, exp, 30); denyuser[denynum].free_time = now_t + dt * 86400; denynum++; savedenyuser(board); printf("封禁 %s 成功<br>\n", userid); tracelog("%s deny %s %s", currentuser->userid, board, userid); inform(board, userid, exp, dt); printf("[<a href=bbsdenyall?B=%d>返回被封帐号名单</a>]", getbnumx(x1)); http_quit(); return 0; }
int showHTML(){ show_head(HTML_PATH); show_javascript(HTML_PATH); show_form(HTML_PATH); return 0; }
int main() { struct user_doccount *udcount,*udcounthead; FILE *fp,*fpfile; struct fileheader *data; char buf[512]; int type=0,docstart,docend,total,i,docmin; char dir[80], board[80], userid[80]; struct boardheader *brd; struct fileheader x; init_all(); /* added by roly 2002.05.10 去掉cache */ printf("<meta http-equiv=\"pragma\" content=\"no-cache\">"); printf("<title>信件下载</title><body>"); /* add end */ if(!loginok) { printf("<b>信件下载 · %s</b><br>\n",BBSNAME); printpretable_lite(); http_fatal("您尚未登录, 请先登录"); } printf("<b>信件下载 · %s</b><br>\n", BBSNAME); type=atoi(getparm("type")); if(type==0) return show_form(); docstart=atoi(getparm("start")); docend=atoi(getparm("end")); sprintf(dir, "mail/%c/%s/.DIR", toupper(currentuser.userid[0]), currentuser.userid); total=file_size(dir)/sizeof(struct fileheader); if(docstart<=0) docstart=1; if(docend<=0 || docend>total) docend=total; //printf("docstart:%d,docend:%d",docstart,docend); data=(struct fileheader *)calloc(total, sizeof(struct fileheader)); if(data==0) http_fatal("memory overflow"); fp=fopen(dir, "r"); if(fp==0) http_fatal("dir error"); total=fread(data, sizeof(struct fileheader), total, fp); printpretable_lite(); if(fp) { int i,filetime; char path[STRLEN]; printf("<ol>\n"); for (i=docstart-1 ;i<docend;i++) { filetime=atoi(data[i].filename+2); //added by iamfat 2002.08.10 //check_anonymous(data[i].owner); //added end. printf("<LI><A href=#%s>%s:(%12.12s) %s</A>\n",data[i].filename,data[i].owner,Ctime(filetime)+4,data[i].title); } printf("</ol>\n"); for (i=docstart-1;i<docend;i++) { printf("<a name=%s></a>",data[i].filename); //,data[i].title); printpretable(); printf("<table width=100%% border=0>\n"); printf("<pre class=ansi>"); sprintf(path, "mail/%c/%s/%s", toupper(currentuser.userid[0]), currentuser.userid, data[i].filename); //printf(path); fpfile=fopen(path, "r"); if(fpfile==0) { printf("本文不存在或者已被删除!"); printf("</pre></table>\n"); printposttable(); continue; } while(1) { if(fgets(buf, 512, fpfile)==0) break; hhprintf("%s", buf); } fclose(fpfile); printf("</pre></table>\n"); printposttable(); } } fclose(fp); printf("</body>\n"); http_quit(); }