int bbsfall_main() { int i; html_header(1); check_msg(); if (!loginok || isguest) http_fatal("дЗипн╢╣гб╪, гКох╣гб╪"); changemode(GMENU); loadfriend(currentuser->userid); printf("<body><center>\n"); printf("%s -- ╨цсяцШ╣╔ [й╧сцуъ: %s]<hr><br>\n", BBSNAME, currentuser->userid); printf("дЗ╧╡иХ╤╗ак %d н╩╨цся<br>", friendnum); printf ("<table border=1><tr><td>пР╨е</td><td>╨цся╢З╨е</td><td>╨цсяк╣цВ</td><td>и╬ЁЩ╨цся</td></tr>"); for (i = 0; i < friendnum; i++) { printf("<tr><td>%d</td>", i + 1); printf("<td><a href=bbsqry?userid=%s>%s</a></td>", fff[i].id, fff[i].id); printf("<td>%s</td>\n", nohtml(fff[i].exp)); printf ("<td>[<a onclick='return confirm(\"х╥й╣и╬ЁЩбП?\")' href=bbsfdel?userid=%s>и╬ЁЩ</a>]</td></tr>", fff[i].id); } printf("</table><hr>\n"); printf("[<a href=bbsfadd>лМ╪спб╣д╨цся</a>]</center></body>\n"); http_quit(); return 0; }
int bbspassport_main() { char id[IDLEN + 1], buf[384], site[256]; struct userec *x; html_header(1); if (key_fail) http_fatal("�ڲ����� ��ϵά��!"); strsncpy(buf, getparm("pp"), sizeof (buf)); strsncpy(site, getparm("site"), sizeof (site)); strsncpy(id, des3_decode(buf, 0), IDLEN + 1); if (id[0] && getuser(id, &x) > 0) { snprintf(buf, sizeof (buf), "http://%s?q=%s", site, des3_encode(id, 1)); redirect(buf); http_quit(); return 0; } printf("<form name=lpassport method=post action=lpassport>\n"); printf("<table width=100%%>\n"); printf ("<tr><td align=right>*���������:<td align=left><input name=id size=12 maxlength=%d >\n", IDLEN); printf ("<tr><td align=right>*����������:<td align=left><input type=password name=pw size=12 maxlength=%d>\n", PASSLEN - 1); printf("<tr><td><td><input type=hidden name=site value=\"%s\">", site); printf("<tr><td align=right><input type=submit value=��¼>" " <td align=left><input type=reset value=������д></table>"); printf("</form>"); http_quit(); return 0; }
static void deleteStudy(llist entries) { CONDITION cond; char dbKey[64]; char studyUID[65]; IDB_Query study; strcpy(dbKey, cgi_val(entries, "DBKey")); strcpy(studyUID, cgi_val(entries, "StudyUID")); TBL_SetOption("OPEN_SPEEDUP"); cond = deleteOneStudy(dbKey, studyUID); selectArchive(entries); #if 0 cond = searchOneStudy(dbKey, studyUID, &study); html_header(); html_begin_body_options("CTN Archive: Study Management", "bgcolor=#ffffff"); printf("<table>\n"); printf("<TR><TH>Name: <TH>%s</TR>\n", study.patient.PatNam); printf("<TR><TH>Date of Birth: <TH>%s</TR>\n", study.patient.PatBirDat); printf("<TR><TH>Accession Number: <TH>%s</TR>\n", study.study.AccNum); printf("</table>\n"); #endif }
int bbsfdel_main() { FILE *fp; int i, total = 0; char path[80], userid[80]; struct override f[200]; html_header(1); //check_msg(); if (!loginok || isguest) http_fatal("您尚未登录,请先登录"); changemode(GMENU); sethomefile(path, currentuser->userid, "friends"); printf("<center>%s -- 好友名单 [使用者: %s]<hr>\n", BBSNAME, currentuser->userid); strsncpy(userid, getparm("userid"), 13); if (userid[0] == 0) { printf("<form action=bbsfdel>\n"); printf("请输入欲删除的好友帐号: <input type=text><br>\n"); printf("<input type=submit>\n"); printf("</form>"); http_quit(); } loadfriend(currentuser->userid); if (friendnum <= 0) http_fatal("您没有设定任何好友"); if (!isfriend(userid)) http_fatal("此人本来就不在你的好友名单里"); for (i = 0; i < friendnum; i++) { if (strcasecmp(fff[i].id, userid)) { memcpy(&f[total], &fff[i], sizeof (struct override)); total++; } }
int bbschangestyle_main() { char name[STRLEN], p[STRLEN], main_page[STRLEN], *tmp; int colorIndex, n = NWWWSTYLE; colorIndex = atoi(getparm("color")); get_session_string(name); tmp = strchr(name, '/'); if (NULL != tmp) { *tmp = '\0'; } if (!strcmp(currentuser.userid,"guest")) { n = NWWWSTYLE - 1; } if (colorIndex > -1 && colorIndex < n) { addextraparam(name, sizeof(name), 0, colorIndex); sprintf(p, "/%s%s./", SMAGIC, name); print_session_string(p); html_header(1); sprintf(main_page, "/%s/", SMAGIC); redirect(main_page); } else { http_fatal("´íÎóµÄÅäÉ«·½°¸"); } http_quit(); return 0; }
void cgibin_reg_general(WEBBLK *webblk) { int i; REGS *regs; regs = sysblk.regs[sysblk.pcpu]; if (!regs) regs = &sysblk.dummyregs; html_header(webblk); hprintf(webblk->sock, "<H2>General Registers</H2>\n"); hprintf(webblk->sock, "<PRE>\n"); if(regs->arch_mode != ARCH_900) for (i = 0; i < 16; i++) hprintf(webblk->sock, "GR%2.2d=%8.8X%s", i, regs->GR_L(i), ((i & 0x03) == 0x03) ? "\n" : "\t"); else for (i = 0; i < 16; i++) hprintf(webblk->sock, "GR%1.1X=%16.16" I64_FMT "X%s", i, (U64)regs->GR_G(i), ((i & 0x03) == 0x03) ? "\n" : " "); hprintf(webblk->sock, "</PRE>\n"); html_footer(webblk); }
int bbsparm_main() { ////modify by mintbaggio 20040829 for new www int i, perm = 1, type; html_header(1); check_msg(); type = atoi(getparm("type")); printf("<body><center><div class=rhead>%s -- 修改个人参数 [使用者: <span class=h11>%s</span>]</div><hr>\n", BBSNAME, currentuser.userid); if (!loginok || isguest) http_fatal("匆匆过客不能设定参数"); changemode(USERDEF); if (type) return read_form(); printf("<form action=bbsparm?type=1 method=post>\n"); printf("<table>\n"); for (i = 0; defines[i]; i++) { char *ptr = ""; if (i % 2 == 0) printf("<tr>\n"); if (currentuser.userdefine & perm) ptr = " checked"; printf ("<td><input type=checkbox name=perm%d%s></td><td>%s</td>", i, ptr, defines[i]); perm = perm * 2; } printf("</table>"); printf ("<input type=submit value=确定修改></form><br>以上参数大多仅在telnet方式下才有作用\n"); printf("</body>"); http_quit(); return 0; }
void createIndex(STS sts, char *outpath) { char *filename = new char[strlen(outpath)+12]; sprintf(filename, "%s/index.html", outpath); HTML html = html_create(filename); if (html == NULL) { log("createIndex", "Khong the tao file 'index.html' duoc!"); return; } html_header(html, "HCMUS Students"); html_body_navigation(html); html_body_content(html, 1); html_body_content_header(html, "", "", 1); html_idxlist_begin(html); for (int i = 0; sts[i] != NULL; i++) { char year[5]; itoa(sts[i]->Nam, year, 10); html_idxlist_element(html, sts[i]->MSSV, sts[i]->HoTen, year); } html_idxlist_end(html); html_footer(html, "HungryBirds"); html_close(html); delete filename; }
int regreq_main() { html_header(1); printf("<nobr><center>%s -- 注册提示<hr>\n", BBSNAME); printf("<table width=100%%>\n"); printf("亲爱的" MY_BBS_NAME "用户,您已经在本站浏览了%ld分钟了<br>", (now_t - (w_info->login_start_time)) / 60); printf("请点<a href=bbsreg>这里</a>进行注册<br><br>"); printf("· 一定要注册吗?<br>"); printf("为了给各位网友提供更加优质的服务,更好地与大家交流沟通,"); printf(MY_BBS_NAME "建议建议大家完成用户注册。"); printf ("注册成为我们的普通注册用户是十分方便快捷的。您将不会后悔花这一点点的时间,"); printf("因为" MY_BBS_NAME "将为注册成功的普通注册用户提供更多的特色服务。"); printf("当然,即使没有进行注册也可轻松浏览" MY_BBS_NAME "的信息,"); printf("但对于一些特色服务就只能望网兴叹了。"); printf ("为了您以后更好地享受" MY_BBS_NAME "带给您的周到服务,赶快去注册吧!<br><br>"); printf("· 先登录再浏览有什么好处?<br>"); printf("我们建议习惯于使用www方式访问" MY_BBS_NAME "时先进行用户登录,"); printf("因为" MY_BBS_NAME "许多版面的讨论和许多服务功能都必须进行用户登录才能使用。"); printf ("作为普通用户,养成一上网即登录的好习惯,能明显地节省您整个上网,"); printf("讨论和查询的时间,并享受无以伦比的个性化服务。"); printf("</table><br><hr>\n"); printf("</center>"); http_quit(); return 0; }
int bbseva_main() { html_header(1); http_fatal("请安装MySQL支持环境!"); return 0; }
int bbsmsg_main() { //modify by mintbaggio 20040829 for new www char buf[MAX_MSG_SIZE]; char msgbuf[MAX_MSG_SIZE*2]; int count, i; struct msghead head; html_header(1); check_msg(); printf("<body>"); printf("<div class=rhead>%s -- 查看信息</div><hr>\n", BBSNAME); if (!loginok || isguest) http_fatal("匆匆过客无法查看讯息, 请先登录"); changemode(LOOKMSGS); count = get_msgcount(0, currentuser.userid); if (count == 0) http_fatal("没有任何讯息"); for (i=0; i<count; i++) { load_msghead(0, currentuser.userid, &head, i); load_msgtext(currentuser.userid, &head, buf); translate_msg(buf, &head, msgbuf, 0); hprintf("%s", msgbuf); } u_info->unreadmsg = 0; printf("<a onclick='return confirm(\"你真的要清除所有讯息吗?\")' href=bbsdelmsg>清除所有讯息</a> "); printf("<a href=bbsmailmsg>寄回所有信息</a>"); http_quit(); return 0; }
int bbseva_main() { char board[80], file[80]; int star; html_header(1); check_msg(); strsncpy(board, getparm("B"), 32); if (!board[0]) strsncpy(board, getparm("board"), 32); strsncpy(file, getparm("F"), 20); if (!file[0]) strsncpy(file, getparm("file"), 32); star = atoi(getparm("star")); if (!loginok) http_fatal("匆匆过客不能进行本项操作"); changemode(READING); if(! getboard(board)) http_fatal("错误的讨论区"); if (hideboard(board)) http_fatal("隐藏版面就不要评价文章啦!"); if (star < 1 || star > 5) http_fatal("错误的参数"); if (star == 1) star++; printf("<center>%s -- 评价文章 [使用者: %s]<hr>\n", BBSNAME, currentuser.userid); printf("<table><td>"); do_eva(board, file, star); printf("</td></table>"); printf("[<a href='javascript:history.go(-1)'>返回</a>]"); http_quit(); return 0; }
void cgibin_debug_device_list(WEBBLK *webblk) { DEVBLK *dev; char *class; html_header(webblk); hprintf(webblk->sock,"<h2>Attached Device List</h2>\n" "<table>\n" "<tr><th>Number</th>" "<th>Subchannel</th>" "<th>Class</th>" "<th>Type</th>" "<th>Status</th></tr>\n"); for(dev = sysblk.firstdev; dev; dev = dev->nextdev) if(dev->pmcw.flag5 & PMCW5_V) { (dev->hnd->query)(dev, &class, 0, NULL); hprintf(webblk->sock,"<tr>" "<td>%4.4X</td>" "<td><a href=\"detail?subchan=%4.4X\">%4.4X</a></td>" "<td>%s</td>" "<td>%4.4X</td>" "<td>%s%s%s</td>" "</tr>\n", dev->devnum, dev->subchan,dev->subchan, class, dev->devtype, (dev->fd > 2 ? "open " : ""), (dev->busy ? "busy " : ""), (IOPENDING(dev) ? "pending " : "")); }
void createSVPage(HTML html, STS sts, int i) { ST st = sts[i]; printf("buildinfo -> Dang tao file HTML cua sinh vien %s\n", sts[i]->MSSV); char *buf = new char[41]; sprintf(buf, "%s - %s", st->HoTen, st->MSSV); html_header(html, buf); delete buf; html_body_navigation(html); html_body_content(html, 2); html_body_content_header(html, st->HoTen, st->MSSV, 2); char year[5]; itoa(st->Nam, year, 10); html_content_pesonal_begin(html, st->MSSV, st->BirthD, year, strsplit(st->Description, ","), strsplit(st->Hobby, ",")); html_listview_begin(html); char **friendlist = strsplit(st->FriendList, ";"); for (int i = 0; friendlist[i] != NULL; i++) { int pos = getFList(sts, friendlist[i]); if (pos != -1) { itoa(sts[pos]->Nam, year, 10); html_listview_item(html, friendlist[i], sts[pos]->HoTen, year); } else { printf("error -> Khong the lay thong tin cua sinh vien %s\n", friendlist[i]); } } html_listview_end(html); html_content_pesonal_end(html); }
int main_html_player_list(int argc, char **argv) { const struct order *order; unsigned pnum, offset; struct player p; struct sqlite3_stmt *res; unsigned nrow; char query[512], *queryfmt = "SELECT" ALL_PLAYER_COLUMNS " FROM players" " WHERE" IS_PLAYER_RANKED " ORDER BY %s" " LIMIT 100 OFFSET %u"; if (argc != 3) { fprintf(stderr, "usage: %s <page_number> by-rank|by-lastseen\n", argv[0]); return EXIT_FAILURE; } if (!parse_pnum(argv[1], &pnum)) return EXIT_FAILURE; if (strcmp(argv[2], "by-rank") == 0) { order = &BY_RANK; } else if (strcmp(argv[2], "by-lastseen") == 0) { order = &BY_LASTSEEN; } else { fprintf(stderr, "%s: Should be either \"by-rank\" or \"by-lastseen\"\n", argv[2]); return EXIT_FAILURE; } html_header(&CTF_TAB, "CTF", "/players", NULL); print_section_tabs(PLAYERS_TAB, NULL, NULL); if (order == &BY_RANK) html_start_player_list(1, 0, pnum); else html_start_player_list(0, 1, pnum); offset = (pnum - 1) * 100; snprintf(query, sizeof(query), queryfmt, order->sortby, offset); foreach_player(query, &p) html_player_list_entry(&p, NULL, 0); if (!res) return EXIT_FAILURE; if (!nrow && pnum > 1) return EXIT_NOT_FOUND; html_end_player_list(); print_page_nav(order->urlprefix, pnum, count_ranked_players() / 100 + 1); html_footer("player-list", relurl("/players/%s.json?p=%u", argv[2], pnum)); return EXIT_SUCCESS; }
static void retrieveStudies(llist entries) { html_header(); html_begin_body_options("DICOM Study Search", "bgcolor=#ffffff"); printf("%s<p>\n", cgi_val(entries, "patientID")); html_end(); }
int bbssetscript_main() { html_header(1); if (!loginok) return 0; w_info->doc_mode=0; return 0; }
int bbsnewmail_main() { FILE *fp; struct fileheader x; int total = 0, total2 = 0; char dir[80]; if (!loginok || isguest) http_fatal("您尚未登录, 请先登录"); sprintf(dir, "mail/%c/%s/.DIR", mytoupper(currentuser->userid[0]), currentuser->userid); if (cache_header(file_time(dir), 1)) return 0; html_header(1); //check_msg(); changemode(RMAIL); //去掉了框架 printf("<body topmargin=0 leftMargin=1 MARGINWIDTH=1 MARGINHEIGHT=0>" WWWLEFT_DIV); printf("<center>\n"); printf ("%s -- 未读邮件列表 [使用者: %s] [信箱容量: %dk, 已用空间: %dk]<hr>\n", BBSNAME, currentuser->userid, max_mailsize(currentuser), get_mailsize(currentuser)); fp = fopen(dir, "r"); if (fp == 0) http_fatal("目前您的信箱没有任何信件"); printf("<table border=1>\n"); printf ("<tr><td>序号</td><td>状态</td><td>发信人</td><td>日期</td><td>信件标题</td></tr>\n"); while (1) { if (fread(&x, sizeof (x), 1, fp) <= 0) break; total++; if (x.accessed & FH_READ) continue; printf("<tr><td>%d</td><td>N</td>", total); printf("<td>%s</td>", userid_str(fh2owner(&x))); printf("<td>%6.6s</td>", Ctime(x.filetime) + 4); printf("<td><a href=bbsmailcon?file=%s&num=%d>", fh2fname(&x), total - 1); if (strncmp("Re: ", x.title, 4)) printf("★ "); hprintf("%42.42s", void1(x.title)); printf(" </a></td></tr>\n"); total2++; } fclose(fp); printf("</table><hr>\n"); printf("您的信箱共有%d封信件, 其中新信%d封.", total, total2); printf("</center>"); showfile(MY_BBS_HOME "/wwwtmp/googleanalytics"); // printf("</body>"); //修改框架,页面底部 printf(WWWFOOT_DIV "</body></html>\n"); http_quit(); return 0; }
int bbsgetmsg_main() { char buf[MAX_MSG_SIZE], msg[MAX_MSG_SIZE * 50]; // static int r = 0; int count, line; struct msghead head; html_header(11); if (!loginok || isguest) { printf ("<body topmargin=1 MARGINHEIGHT=1><script>top.document.getElementById('fs1').rows=\"2, *, 15\";</script>\n</html>\n"); return 0; } if (u_info->unreadmsg > 0) { count = get_unreadmsg(currentuser.userid); if (count == -1 || count == 0) goto outthere; if (currentuser.userdefine & DEF_SOUNDMSG) printf("<bgsound src=/msg.wav>\n"); load_msghead(1, currentuser.userid, &head, count); load_msgtext(currentuser.userid, &head, buf); line = translate_msg(buf, &head, msg, 0); printf ("<body topmargin=1 MARGINHEIGHT=1 style='BACKGROUND-COLOR: #f0ffd0'>\n"); printf ("<script>top.document.getElementById('fs1').rows=\"%d, *, 15\";</script>\n", (line + 11) * 16 + 32); emotion_print(msg); printf("<form name=form0 action=bbssendmsg method=post>\n" "<input type=hidden name=dr value=1>\n" "<input type=hidden name=destpid value=%d>\n" "<input type=hidden name=destid value='%s'>\n", head.frompid, head.id); printf("在下面直接回复讯息或 \n"); printf("<a href=bbsgetmsg>[忽略该消息]</a><br>\n"); printf("<table><tr><td>\n"); printf("<textarea name=msg rows=5 cols=76>" "</textarea><br>\n"); printf("</td><td>\n"); print_emote_table("form0", "msg"); printf("</td></tr></table><br>\n"); printf("<input type=submit value=确认 width=6></form>\n"); u_info->unreadmsg--; http_quit(); } outthere: u_info->unreadmsg = 0; printf ("<body topmargin=1 MARGINHEIGHT=1><script>top.document.getElementById('fs1').rows=\"2, *, 15\";</script>"); // printf("<script>function t(){return (new Date()).valueOf();}</script>"); // printf("<script>setTimeout('self.location.replace(\"bbsgetmsg?sn='+t()+'\")', %d);</script>", 235000+r * 1000); // r = (r + now_t + u_info->uid) % 10; printf("</body>"); http_quit(); return 0; }
static void moveSeries(llist entries) { CONDITION cond; char dbKey[64] = ""; char studyUID[65] = ""; char seriesUID[65] = ""; char destinationApplication[17] = ""; char password[64] = ""; int i; long successes = 0; long warnings = 0; long failures = 0; void *timeStamp = 0; double deltaTime = 0; DMAN_HANDLE *controlHandle; strcpy(dbKey, cgi_val(entries, "DBKey")); strcpy(studyUID, cgi_val(entries, "StudyUID")); strcpy(seriesUID, cgi_val(entries, "SeriesUID")); strcpy(password, cgi_val(entries, "password")); strcpy(destinationApplication, cgi_val(entries, "DestinationApplication")); TBL_SetOption("OPEN_SPEEDUP"); html_header(); html_begin_body_options("CTN Archive: Move Series", "bgcolor=#ffffff"); printf("<pre>\n"); printf("DB Key: %s<br>\n", dbKey); printf("Study UID: %s<br>\n", studyUID); printf("Series UID: %s<br>\n", seriesUID); /*printf("Password: %s<br>\n", password);*/ printf("Destination: %s<br>\n", destinationApplication); timeStamp = UTL_GetTimeStamp(); cond = moveSeriesRequest(dbKey, studyUID, seriesUID, destinationApplication, &successes, &warnings, &failures); deltaTime = UTL_DeltaTime(timeStamp); UTL_ReleaseTimeStamp(timeStamp); printf("Successes: %d<br>\n", successes); printf("Warnings: %d<br>\n", warnings); printf("Failures: %d<br>\n", failures); printf("Xmit time: %8.2f seconds <br>\n", deltaTime); printf("</pre>\n"); logMoveRequest(dbKey, studyUID, seriesUID, destinationApplication, successes, warnings, failures); html_end(); }
void cgibin_debug_storage(WEBBLK *webblk) { int i, j; char *value; U32 addr = 0; /* INCOMPLETE * no storage alter * no storage type (abs/real/prim virt/sec virt/access reg virt) * no cpu selection for storage other then abs */ if((value = cgi_variable(webblk,"alter_a0"))) sscanf(value,"%x",&addr); addr &= ~0x0F; html_header(webblk); hprintf(webblk->sock,"<form method=post>\n" "<table>\n"); if(addr > sysblk.mainsize || (addr + 128) > sysblk.mainsize) addr = sysblk.mainsize - 128; for(i = 0; i < 128;) { if(i == 0) hprintf(webblk->sock,"<tr>\n" "<td><input type=text name=alter_a0 size=8 value=%8.8X>" "<input type=hidden name=alter_a1 value=%8.8X></td>\n" "<td><input type=submit name=refresh value=\"Refresh\"></td>\n", i + addr, i + addr); else hprintf(webblk->sock,"<tr>\n" "<td align=center>%8.8X</td>\n" "<td></td>\n", i + addr); for(j = 0; j < 4; i += 4, j++) { U32 m; FETCH_FW(m,sysblk.mainstor + i + addr); hprintf(webblk->sock,"<td><input type=text name=alter_m%d size=8 value=%8.8X></td>\n",i,m); } hprintf(webblk->sock,"</tr>\n"); } hprintf(webblk->sock,"</table>\n" "</form>\n"); html_footer(webblk); }
int bbsdelmsg_main() { html_header(1); if (!loginok || isguest) http_fatal("匆匆过客不能处理短消息, 请先登录"); changemode(LOOKMSGS); clear_msg(currentuser->userid); u_info->unreadmsg = 0; printf("已删除所有短消息备份"); return 0; }
int bbsjs_main() { FILE *fp; static char s[300]; html_header(1); printf("<font style='font-size:12px'>\n"); printf ("<center>欢迎访问[%s], 目前在线人数(www/all) [<font color=green>%d/%d</font>]", MY_BBS_NAME, count_www(), count_online()); printf("</font>"); }
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 bbsnewmail_main() { //modify by mintbaggio 20040829 for new www FILE *fp; struct fileheader x; int total = 0, total2 = 0; char dir[80]; if (!loginok || isguest) http_fatal("您尚未登录, 请先登录"); sprintf(dir, "mail/%c/%s/.DIR", mytoupper(currentuser.userid[0]), currentuser.userid); if(cache_header(file_time(dir),1)) return 0; html_header(1); check_msg(); changemode(RMAIL); printf("<body><center>\n"); printf ("<div class=rhead>%s -- 新邮件列表 [使用者: <span class=h11>%s</span>]<br>[信箱容量: <span class=h11>%d</span>k, 已用空间: <span class=h11>%dk</span>]</div><hr>\n", BBSNAME, currentuser.userid, max_mail_size(), get_mail_size()); fp = fopen(dir, "r"); if (fp == 0) http_fatal("目前您的信箱没有任何信件"); printf("<table border=1>\n"); printf ("<tr><td>序号</td><td>状态</td><td>发信人</td><td>日期</td><td>信件标题</td></tr>\n"); while (1) { if (fread(&x, sizeof (x), 1, fp) <= 0) break; total++; if (x.accessed & FH_READ) continue; printf("<tr><td>%d</td><td>N</td>", total); printf("<td>%s</td>", userid_str(fh2owner(&x))); printf("<td>%6.6s</td>", Ctime(x.filetime) + 4); printf("<td><a href=bbsmailcon?file=%s&num=%d>", fh2fname(&x), total - 1); if (strncmp("Re: ", x.title, 4)) printf("★ "); hprintf("%42.42s", void1(x.title)); printf(" </a></td></tr>\n"); total2++; } fclose(fp); printf("</table><hr>\n"); printf("您的信箱共有%d封信件, 其中新信%d封.", total, total2); printf("</center></body>"); http_quit(); return 0; }
int bbsfoot_main() { int dt = 0, mail_total = 0, mail_unread = 0, lasttime = 0; char *id = "guest"; static int r = 0; html_header(2); printf("<script>function t(){return (new Date()).valueOf();}</script>"); printf("<body topmargin=1 MARGINHEIGHT=1 class=foot>\n"); if (loginok) { id = currentuser->userid; dt = abs(now_t - w_info->login_start_time) / 60; } printf("时间[%16.16s] ", Ctime(now_t)); printf("在线[%d] ", count_online()); printf("帐号[<a href=\"bbsqry?userid=%s\" target=f3>%s</a>] ", id, id); if (loginok && !isguest) { int thistime; lasttime = atoi(getparm("lt")); thistime = mails_time(id); if (thistime <= lasttime) { mail_total = atoi(getparm("mt")); mail_unread = atoi(getparm("mu")); } else { mail_total = mails(id, &mail_unread); lasttime = thistime; } if (mail_unread == 0) { printf("信箱[<a href=bbsmail target=f3>%d封</a>] ", mail_total); } else { printf ("信箱[<a href=bbsmail target=f3>%d(<font color=red>新信%d</font>)</a>] ", mail_total, mail_unread); } showmyclass(); } #ifdef ENABLE_BLOG showmyblog(); #endif printf("停留[%d小时%d分] ", dt / 60, dt % 60); printf ("<a href=# onclick='javascript:{location=location;return false;}'>刷新</a>"); printf("<script>setTimeout('self.location.replace(" "\"bbsfoot?lt=%d&mt=%d&mu=%d&sn='+t()+'\")', %d);</script>", lasttime, mail_total, mail_unread, 900000 + r * 1000); r = (r + dt + now_t) % 30; printf("</body>"); return 0; }
int bbsfind_main() { char user[32], title3[80], title[80], title2[80]; int day; html_header(1); //check_msg(); changemode(READING); strsncpy(user, getparm("user"), 13); strsncpy(title, getparm("title"), 50); strsncpy(title2, getparm("title2"), 50); strsncpy(title3, getparm("title3"), 50); day = atoi(getparm("day")); printf("<body>"); if (day == 0) { printf("%s -- 站内文章查询<hr>\n", BBSNAME); printf ("<font color=red>用户查询请使用各版面上的 版内查询 功能,此查询主要供管理人员使用</font>" "<br> 目前系统负载 %f。系统负载超过 1.5 或者上线人数超过 %d 时将不能进行查询。<br>" "系统负载统计图和上线人数统计图可以到<a href=home?B=bbslists>bbslists版</a>查看<br>", *system_load(), ONLINELIMIT); if (!loginok || isguest) printf("<b>您还没有登录,请先登录再使用本功能</b><br>"); printf("<form action=bbsfind>\n"); printf ("文章作者: <input maxlength=12 size=12 type=text name=user> (不填查找所有作者)<br>\n"); printf ("标题含有: <input maxlength=60 size=20 type=text name=title>"); printf (" AND <input maxlength=60 size=20 type=text name=title2><br>\n"); printf ("标题不含: <input maxlength=60 size=20 type=text name=title3><br>\n"); printf ("查找最近: <input maxlength=5 size=5 type=text name=day value=7> 天以内的文章<br><br>\n"); printf("<input type=submit value=提交查询></form>\n"); } else { if (*system_load() >= 1.7 || count_online() > ONLINELIMIT) http_fatal ("用户查询请使用各版面上的 版内查询 功能,此查询主要供管理人员使用。系统负载(%f)或上线人数(%d)过高, 请在上站人数较少的时间查询( 系统负载超过 1.5 或者上线人数超过 %d 时不能进行查询 )", *system_load(), count_online(), ONLINELIMIT); if (!loginok || isguest) http_fatal("请先登录再使用本功能。"); search(user, title, title2, title3, day * 86400); } // printSoukeForm(); showfile(MY_BBS_HOME "/wwwtmp/googleanalytics"); printf("</body>"); http_quit(); return 0; }
static void directoryToHTML(const char* path) { LST_HEAD* l; #if 0 char topDirectory[1024]; char currentDirectory[1024]; char key[1024]; #endif FILE_ENTRY* f; char parentPath[1024]; char *c; strcpy(parentPath, path); c = parentPath + strlen(parentPath); while (*(--c) != '/') ; *c = '\0'; l = LST_Create(); listDirectory(path, &l); html_header(); html_begin_body_options("File View", "bgcolor=#ffffff"); while ((f = LST_Dequeue(&l)) != NULL) { if (strcmp(f->fileName, "..") == 0) { printf("<br><a href=""/cgi-bin/fileview.cgi" "?submitSearch=FileSelect" "&Key=%s" "&CurrentDirectory=%s" "&>%s</a>\n", ".", parentPath, f->fileName); } else { printf("<br><a href=""/cgi-bin/fileview.cgi" "?submitSearch=FileSelect" "&Key=%s" "&CurrentDirectory=%s" "&>%s</a>\n", f->fileName, path, f->fileName); } free(f); } html_end(); LST_Destroy(&l); }
int main() { llist entries; int status; html_header(); html_begin("Query Results"); status = read_cgi_input(&entries); printf("<h1>Status = %d</h1>\n",status); h1("Query results"); print_entries(entries); html_end(); list_clear(&entries); return 0; }
int user_result (HTTP_INFO *info, int result) { html_header (info); html_body (info, "Result"); if (result == 0) { printf ("Successful<BR>\n"); } else printf ("Fail<BR>\n"); printf ("<A HREF=\"javaScript:history.back();\">Back</A>\n"); html_footer (info); return 0; }