示例#1
0
int main()
{
        FILE *fp;
        int type;
        init_all();
        type=atoi(getparm("type"));
        if(!loginok)
                http_fatal("您尚未登录, 请重新登录。");
        printf("%s -- 填写注册单<hr color=green>\n", BBSNAME);
        check_if_ok();
        if(type==1) {
                check_submit_form();
                http_quit();
        }
        printf("您好, %s, 注册单通过确认后才可获得发表文章,发送信件和讯息的权利, 下面各项务必请认真真实填写<br><hr>\n", currentuser.userid);
        printf("<form method=post action=bbsform?type=1>\n");
        printf("真实姓名: <input name=realname type=text maxlength=80 size=8 value='%s'><br>\n",
               nohtml(currentuser.realname));
        printf("学校系级: <input name=dept type=text maxlength=320 size=32 value='%s'>(或工作单位)<br>\n",
               nohtml(currentuser.reginfo));
        printf("居住地址: <input name=address type=text maxlength=320 size=32 value='%s'><br>\n",
               nohtml(currentuser.address));
        printf("联络电话: <input name=phone type=text maxlength=320 size=32><br><hr><br>\n");
        printf("<input type=submit value=填好了> <input type=reset>");
        http_quit();
}
示例#2
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;
}
示例#3
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;
}
示例#4
0
int main()
{
        char *board, buf[80], *board1, *title;
        int i, total=0;
        init_all();
        modify_mode(u_info,SELECT+20000);	//bluetent
        board=nohtml(getparm("board"));
        if(board[0]==0) {
                printf("%s -- 选择讨论区<hr color=green>\n", BBSNAME);
                printf("<form name=sel action=bbssel>\n");
                printf("讨论区名称: <input type=text name=board>");
                printf(" <input type=submit value=确定><br><br> 如果输入一部分板面名称,系统会为您自动选择");
                printf("</form><script language=javascript>sel.board.focus()</script>\n");
                http_quit();
        } else {
                for(i=0; i<MAXBOARD; i++) {
                        board1=shm_bcache->bcache[i].filename;
                        if(!has_read_perm(&currentuser, board1))
                                continue;
                        if(!strcasecmp(board, board1) && !(shm_bcache->bcache[i].flag & ZONE_FLAG)) {
                                sprintf(buf, "bbs%sdoc?board=%s", (currentuser.userdefine & DEF_THESIS)?"t":"", board1);
                                redirect(buf);
                                http_quit();
                        }
                }
                printf("%s -- 选择讨论区<hr color=green>\n", BBSNAME);
                //		printf("找不到这个讨论区, ", board);
                printf("标题中含有'%s'的讨论区有: <br><br>\n", board);
                printf("<table>");
                for(i=0; i<MAXBOARD; i++) {
                        board1=shm_bcache->bcache[i].filename;
                        title=shm_bcache->bcache[i].title;
                        if(!has_read_perm(&currentuser, board1))
                                continue;
                        if(!(shm_bcache->bcache[i].flag & ZONE_FLAG) && (strcasestr(board1, board) || strcasestr(title, board))) {
                                total++;
                                printf("<tr><td>%d", total);
                                printf("<td><a href=bbs%sdoc?board=%s>%s</a><td>%s<br>\n", (currentuser.userdefine & DEF_THESIS)?"t":"",
                                       board1, board1, title+7);
                                sprintf(buf, "bbs%sdoc?board=%s", (currentuser.userdefine & DEF_THESIS)?"t":"", board1);
                        }
                }
                if (total==1)
                        redirect(buf);
                printf("</table><br>\n");
                printf("共找到%d个符合条件的讨论区.\n", total);
        }
}
示例#5
0
文件: bbsfall.c 项目: lytsing/ytht
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;
}
示例#6
0
int main()
{
        int type;
        char pw1[20], pw2[20], pw3[20];
        init_all();
        if(!loginok)
                http_fatal("����δ��¼, ���ȵ�¼");
        modify_mode(u_info,USERDEF+20000);	//bluetent
        type=atoi(getparm("type"));
        if(type==0) {
                printf("%s -- �޸����� [�û�: %s]<hr color=green>\n",
                       BBSNAME, currentuser.userid);
                printf("<form action=bbspwd?type=1 method=post>\n");
                printf("��ľ�����: <input maxlength=12 size=12 type=password name=pw1><br>\n");
                printf("���������: <input maxlength=12 size=12 type=password name=pw2><br>\n");
                printf("������һ��: <input maxlength=12 size=12 type=password name=pw3><br><br>\n");
                printf("<input type=submit value=ȷ���޸�>\n");
                http_quit();
        }
        strsncpy(pw1, getparm("pw1"), 13);
        strsncpy(pw2, getparm("pw2"), 13);
        strsncpy(pw3, getparm("pw3"), 13);
        if(strcmp(pw2, pw3))
                http_fatal("�������벻��ͬ");
        if(strlen(pw2)<2)
                http_fatal("������̫��");
        if(!checkpasswd(currentuser.passwd, pw1))
                http_fatal("���벻��ȷ");
        strcpy(currentuser.passwd, crypt1(pw2, pw2));
        save_user_data(&currentuser);
        printf("[%s] �����޸ijɹ�.", currentuser.userid);
}
示例#7
0
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++;
		}
	}
示例#8
0
int main() {
    int i, total=0, mode;
    char  *ptr;
    struct boardheader *brd;
    init_all();
    printf("<b>删除信件 · %s </b><br>\n",BBSNAME);
    printpretable_lite();
    if(!loginok)
        http_fatal("请先登录");
    mode=atoi(getparm("mode"));
    if(mode<=0 || mode>1)
        http_fatal("错误的参数");
    printf("<table>");
    for(i=0; i<parm_num && i<40; i++)
    {
        if(!strncmp(parm_name[i], "box", 3))
        {
            total++;
            if(mode==1)
                do_del(parm_name[i]+3);
            /* for extension */
        }
    }
    printf("</table>");
    if(total<=0)
        printf("请先选定文章<br>\n");
    printposttable_lite();
    printf("<br><a href=bbsmail>返回信件模式</a>");
    http_quit();
}
示例#9
0
int main()
{
        FILE *fp;
        char *ptr, plan[256], buf[10000];
        init_all();
        printf("<center>\n");
        if(!loginok)
                http_fatal("匆匆过客不能设置说明档,请先登录");
        modify_mode(u_info,USERDEF+20000);	//bluetent
        sprintf(plan, "home/%c/%s/plans", toupper(currentuser.userid[0]), currentuser.userid);
        if(!strcasecmp(getparm("type"), "update"))
                save_plan(plan);
        printf("%s -- 设置个人说明档 [%s]<hr>\n", BBSNAME, currentuser.userid);
        printf("<form method=post action=bbsplan?type=update>\n");
        fp=fopen(plan, "r");
        if(fp) {
                fread(buf, 9999, 1, fp);
                ptr=strcasestr(buf, "<textarea>");
                if(ptr)
                        ptr[0]=0;
                fclose(fp);
        }
        printf("<table width=610 border=1><tr><td>");
        printf("<textarea name=text rows=20 cols=80 wrap=physicle>\n");
        printf(void1(buf));
        printf("</textarea></table>\n");
        printf("<input type=submit value=存盘> ");
        printf("<input type=reset value=复原>\n");
        printf("<hr>\n");
        http_quit();
}
示例#10
0
int main()
{
        FILE *fp;
        struct fileheader f;
        char rpath[80],*id,path[80];
        init_all();
        if(loginok == 0)
                http_fatal("ÄúÉÐδµÇ¼");
        id=currentuser.userid;
        sprintf(rpath, "mail/%c/%s/.recycle", toupper(id[0]), id);
        fp=fopen(rpath, "r");
        if(fp==0)
                http_fatal("´íÎóµÄ²ÎÊý2");
        while(1) {
                if(fread(&f, sizeof(struct fileheader ), 1, fp)<=0)
                        break;
                sprintf(path, "mail/%c/%s/%s", toupper(id[0]), id, f.filename);
                unlink(path);
        }

        unlink(rpath);
        fp=fopen(rpath,"a+");
        if(fp!=0) {
                fclose(fp);
                redirect("bbsmailrecycle");
                //   printf("Çå¿Õ³É¹¦£¬<a href=bbsmailrecycle> ·µ»Ø</a>");
                http_quit();
        }
        fclose(fp);
        http_fatal("Çå¿Õ³ö´í");
}
示例#11
0
文件: regreq.c 项目: bmybbs/bmybbs
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;
}
示例#12
0
文件: bbseva.c 项目: bmybbs/bmybbs
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;
}
示例#13
0
文件: bbsparm.c 项目: bmybbs/bmybbs
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;
}
示例#14
0
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;
}
示例#15
0
int save_plan(char *plan)
{
        char buf[10000];
        /* add by yiyo 过滤说明档多余字符
                char* p;
                int i;
         
                p = buf;
                i = 0;
                while (*p) {
                        if (13 != *p) {
                                buf[i] = *p;
                                i++;
                        }
                        p++;
                }
                buf[i] = 0;
        /* add end by yiyo */
        fp=fopen(plan, "w");
        strsncpy(buf, getparm("text"), 9999);
        fprintf(fp, "%s", buf);
        fclose(fp);
        printf("个人说明档修改成功。");
        http_quit();
}
示例#16
0
int main()
{
        char buf[512];
        char file[80];
        char keystr[80]; //关键字
        int has=1;
        init_all();
        if(!loginok)
                http_fatal("您尚未登录");
        modify_mode(u_info,FTPSEARCH);
        strsncpy(keystr, getparm("keystr"), 80);
        printf("<body background=/bg_1.gif bgproperties=fixed>");
        if(!strlen(keystr)) {
                printf("<table width=600 align=center><tr height=150><td align=center valign=bottom style='font-size:14px'><font color=blue>局域网FTP搜索引擎<p><p></font></td></tr>");
                printf("<tr><td align=center style='font-size:14px'><form name=ftpsearch>请输入关键字:<input name=keystr type=text size=50 maxlength=80><input type=submit value=搜索> (<font color=red>%d</font>人在线)</form><script language=javascript>document.ftpsearch.keystr.focus();</script></td></tr>", countuser());
                printf("<tr><td><table><tr>");
                printf("<td><a href=bbsmyftp?type=4>我要加盟</a></td>");
                if(SiteInList(fromhost))
                        printf("<td> | <a href=bbsmyftp>管理站点数据</a> | <a href=bbsmyftp?type=3>已上传数据的站点列表</a></td>");
                printf("</tr></table></td></tr>");
                printf("</tr><tr><td width=80%%>【说明】 本搜索引擎用来查找南开大学校内教育网和宿舍网FTP站点的数据。<br>各位站长可以自行上传自己的站点数据,服务器端对原始数据进行重新编码以供搜索。<br>因该引擎仅依照编码后的数据进行搜索,故不会对网络负载产生影响。</td></tr>");
                printf("</table>");
        } else {
                sprintf(file, "tmp/%d.tmp", getpid());
                search(keystr, file);
                printf("</pre>");
                unlink(file);
        }
        http_quit();
}
示例#17
0
文件: bbsmsg.c 项目: bmybbs/bmybbs
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;
}
示例#18
0
int main()
{
        int i;
        int shift=1;	//wzk
        char board[80];
        init_all();
        if(!loginok)
                http_fatal("您尚未登录, 请先登录");
        strsncpy(board, getparm("board"), 30);
        if(!has_read_perm(&currentuser, board))
                http_fatal("错误的讨论区");
        if(!has_BM_perm(&currentuser, board))
                http_fatal("你无权进行本操作");
        loaddenyuser(board);
        printf("<center>\n");
        printf("%s -- 被封用户名单 [讨论区: %s]<hr color=green><br>\n", BBSNAME, board);
        printf("本板共有 %d 人被封<br>", denynum);
        printf("<table border=0><tr class=title><td>序号<td>用户帐号<td>被封原因<td>原定解封日期<td>管理\n");
        for(i=0; i<denynum; i++) {
                printf("<tr><td>%d", i+1);
                printf("<td><a href=bbsqry?userid=%s>%s</a>", denyuser[i].id, denyuser[i].id);
                printf("<td>%s\n", nohtml(denyuser[i].exp));
                printf("<td>%s\n", denyuser[i].free_time);
                printf("<td>[<a onclick='return confirm(\"确实解封吗?\")' href=bbsdenydel?board=%s&userid=%s>解封</a>]",
                       board, denyuser[i].id);
        }
        printf("</table><hr color=green>\n");
        printf("[<a href=bbsdenyadd?board=%s>设定新的不可POST用户</a>]</center>\n", board);
        http_quit();
}
示例#19
0
文件: bbssel.c 项目: deepurple/bbssrc
int
bbssel_main()
{
    char *board, buf[80], *board1, *title;
    int i, total = 0;
    html_header(1);
    check_msg();
    changemode(SELECT);
    board = nohtml(getparm("board"));
    if (board[0] == 0) {
        printf("%s -- 选择讨论区<hr>\n", BBSNAME);
        printf("<form action=bbssel>\n");
        printf("讨论区名称: <input type=text name=board>");
        printf(" <input type=submit value=确定>");
        printf("</form>\n");
        http_quit();
    } else {
        struct boardmem *x;
        x = getboard(board);
        if (x) {
            sprintf(buf, "%s%s", showByDefMode(), x->header.filename);
            redirect(buf);
            http_quit();
        }
        printf("%s -- 选择讨论区<hr>\n", BBSNAME);
        printf("找不到这个讨论区, ", board);
        printf("标题中含有'%s'的讨论区有: <br><br>\n", board);
        printf("<table>");
        for (i = 0; i < MAXBOARD && i < shm_bcache->number; i++) {
            board1 = shm_bcache->bcache[i].header.filename;
            title = shm_bcache->bcache[i].header.title;
            if (!has_read_perm(&currentuser, board1))
                continue;
            if (strcasestr(board1, board)
                    || strcasestr(title, board)) {
                total++;
                printf("<tr><td>%d", total);
                printf
                ("<td><a href=%s%s>%s</a><td>%s<br>\n",
                 showByDefMode(), board1, board1, title + 7);
            }
        }
        printf("</table><br>\n");
        printf("共找到%d个符合条件的讨论区.\n", total);
    }
}
示例#20
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;
}
示例#21
0
int show_form() {
	printpretable_lite();
	printf("<table><form action=bbsmaildown?type=1 method=post>\n");
	printf("<tr><td>起始篇数: <input type=text maxlength=8 size=8 name=start><br>\n");
	printf("<tr><td>终止篇数: <input type=text maxlength=8 size=8 name=end>\n");
	printf("<tr><td><input type=submit value=递交查询>\n");
	printf("</form></table>");	
	printposttable_lite();
	http_quit();
}
示例#22
0
int
bbsinvite_main()
{
	char myname[40], ivemail[60], ivname[40], *note;
	char tmpfn[256];
	int retv;
	html_header(1);
	//check_msg();
	printf("<body>");
	if (!loginok || isguest
	    || (currentuser->userlevel & PERM_DEFAULT) != PERM_DEFAULT)
		http_fatal("匆匆过客无法发送邀请, 请先登录");
	changemode(MMENU);
	if (atoi(getparm("doit")) == 0) {
		printInviteForm();
		http_quit();
		return 0;
	}

	strsncpy(myname, getparm("myname"), sizeof (myname));
	strsncpy(ivemail, getparm("ivemail"), sizeof (ivemail));
	strsncpy(ivname, getparm("ivname"), sizeof (ivname));
	note = getparm("note");
	if (!*ivemail || !*ivname)
		http_fatal("被邀请人的 email 和名字都需要填写");
	if (!trustEmail(ivemail))
		http_fatal("该 email 无效,或者其使用者已经在本站注册");
	sprintf(tmpfn, "bbstmpfs/tmp/bbsinvite.%d",  getpid());
	f_write(tmpfn, note);
	retv = sendInvitation(currentuser->userid, myname, ivemail, ivname, tmpfn);
	unlink(tmpfn);
	if (retv < 0) {
		http_fatal("发送 email 失败,代码 %d", retv);
	}
	tracelog("%s invite %s %s", currentuser->userid, ivemail, ivname);

	printf("<br>成功给 %s 发送邀请!<br>", ivname);
	printf("<a href=bbsinvite>再发送几个邀请</a>");
	http_quit();
	return 0;
}
示例#23
0
文件: bbsdenyadd.c 项目: lytsing/ytht
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;
}
示例#24
0
文件: bbsmnote.c 项目: bmybbs/bmybbs
void
save_note(char *path)
{
	FILE *fp;
	char buf[10000];
	fp = fopen(path, "w");
	strsncpy(buf, getparm("text"), 9999);
	fprintf(fp, "%s", buf);
	fclose(fp);
	printf("±¸Íü¼Ð޸ijɹ¦¡£<br>\n");
	printf("<a href='javascript:history.go(-2)'>·µ»Ø</a>");
	http_quit();
}
示例#25
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;
}
示例#26
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;
}
示例#27
0
文件: bbsspam.c 项目: lytsing/ytht
int
bbsspam_main()
{
	int num;
	struct spamheader *sh = NULL;
	struct spamheader *sh1;
	uint16_t spamnum;
	struct yspam_ctx *yctx;
	unsigned long long mid;
	char midbuf[100];
	int ret;

	if ((!loginok || isguest) && (!tempuser)) 
		http_fatal("您尚未登录, 请先登录");
	html_header(1);
	changemode(RMAIL);
	printf("<body><center>\n");
	printf("%s -- 垃圾信件列表 [使用者: %s]\n", BBSNAME, currentuser->userid);
	yctx = yspam_init("127.0.0.1");
	ret = yspam_getallspam(yctx, currentuser->userid, &sh, &spamnum);
	yspam_fini(yctx);
	if (ret < 0 && ret != -YSPAM_ERR_NOSUCHMAIL) {
		if (sh)
			free(sh);
		http_fatal("内部错误 1");
	}
	printf("共有 %d 封垃圾邮件", spamnum);
	printf("<table>");
	printf
	    ("<tr><td>序号</td><td>发信人</td><td>日期</td><td>信件标题</td></tr>\n");
	sh1 = sh;
	for (num = 1; num <= spamnum; num++) {
		mid = ((unsigned long long)ntohl(sh1->mailid_high) << 32) + ntohl(sh1->mailid_low);
		sprintf(midbuf, "%llu", mid);
		printf("<tr><td>%d</td><td>%s</td><td>%12.12s</td><td><a href=bbsspamcon?id=%s&magic=%d>", num, void1(titlestr(sh1->sender)), Ctime(ntohl(sh1->time)) + 4, midbuf, ntohl(sh1->magic));
		if (sh1->title[0] == 0)
			printf("无题");
		else
			printf("%s", void1(titlestr(sh1->title)));
		printf("</a></td></tr>");
		sh1++;
	}
	if (sh)
		free(sh);
	printf("</table>");
	http_quit();
	return 0;
}
示例#28
0
int main()
{
        char word[80], buf[256];
        int type;
        int has=1;	//wzk
        init_all();
        modify_mode(u_info,DICT+20000);	//bluetent
        type=atoi(getparm("type"));
        strcpy(word, getparm("word"));
        printf("%s -- 字典查询<hr color=green>\n", BBSNAME);
        if(type==0 || word[0]==0) {
                printf("<form name=dict method=post action=bbsdict?type=1><pre>\n");
                hprintf("本字典 CDICT5.0 收录单词近 40000 , 一般较常见的单词和缩写均已收录,\n");
                printf("中英文输入均可, 支持'*'后缀通配符.\n\n");
                printf("请输入要查询的中英文单词: <input type=text name=word>\n");
                printf("<input type=submit>\n");
                printf("</pre></form><script language=javascript>dict.word.focus()</script>\n");
        } else {
                char file[80];
                FILE *fp;
                printf("查询单词: [%s]<br>\n", nohtml(word));
                sprintf(file, "tmp/%d.tmp", getpid());
                check(word);
                sprintf(buf, "bin/dict '%s' > %s", word, file);
                system(buf);
                fp=fopen(file, "r");
                if(fp==0)
                        http_fatal("内部错误");

                printf("<table width=610 border=0><tr><td><pre>\n");
                fgets(buf, 255, fp);		//wzk
                printf("<br>");			//wzk
                while(1) {
                        if(fgets(buf, 255, fp)==0) {
                                if (has)
                                        printf("单词\"%s\"没有找到", word);
                                break;
                        }
                        has=0;		//wzk
                        hprintf("%s", buf);
                }
                printf("</pre></table>");
                unlink(file);
        }
        check_msg();//bluetent 2002.10.31
        http_quit();
}
示例#29
0
文件: bbsfind.c 项目: bmybbs/bmybbs
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
		    ("目前系统负载 %f。系统负载超过 5.0 或者上线人数超过 4000 时将不能进行查询。<br>"
		     "系统负载统计图和上线人数统计图可以到<a href=%sbbslists>bbslists版</a>查看<br>",
		      *system_load(),showByDefMode());
		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() >= 5.0 || count_online() > 4000)
			http_fatal
			    ("系统负载(%f)或上线人数(%d)过高, 请在上站人数较少的时间查询.",
			     *system_load(), count_online());
		if (!loginok || isguest)
			http_fatal("请先登录再使用本功能。");
		search(user, title, title2, title3, day * 86400);
	}
	printf("</body>");
	http_quit();
	return 0;
}
示例#30
0
int
bbsselstyle_main()
{
	char name[STRLEN], *p, *url;
	int i;
#ifdef USESESSIONCOOKIE
	char session[STRLEN];
	strsncpy(session, getparm("SESSION"), sizeof (session));
#endif
	url = getenv("SCRIPT_URL");
	if (NULL == url)
		return -1;
	name[0] = 0;
	if (!strncmp(url, "/" SMAGIC, sizeof (SMAGIC))) {
		snprintf(name, STRLEN, "%s", url + sizeof (SMAGIC));
		p = strchr(name, '/');
		if (NULL != p) {
			*p = 0;
		} else {
			http_fatal("Incorrect url");
			return -1;
		}
	}
	html_header(1);
	check_msg();
	printf("<body><center><br><h2>选择界面风格</h2><table>");
	for (i = 0; i < NWWWSTYLE; i++) {
		addextraparam(name, sizeof (name), 0, i);
		printf("<tr><td><li><a");
#ifdef USESESSIONCOOKIE
		if (session[1]) {
			addextraparam(session, sizeof (session), 0, i);
			printf
			    (" onclick=\"document.cookie='SESSION=%s; path=/';return true;\"",
			     session);
		}
#endif
		printf(" href=/" SMAGIC "%s/?t=%d target=_top>%s</a></td></tr>",
		       name, now_t, wwwstyle[i].name);
	}
	if (strcmp(currentuser->userid, "guest"))
		printf
		    ("<tr><td><li><a href=bbsdefcss>定义自己的界面</a></td></tr>");
	printf("</table></body>");
	http_quit();
	return 0;
}