仿照水木处理方式,对站务特权做提示

类别:软件工程 点击:0 评论:0 推荐:

主要是转载和发帖时检查是否是俱乐部成员和是否被封,并给出提示。
此外还对系统记录区作了保护,包括不能转载到系统记录区和在系统记录区发帖


===================================================================
RCS file: D:\ythtcvs\bbs\src\bbs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- bbs.c       2005/00/06 01:23:20     1.5
+++ bbs.c       2005/00/09 07:15:33     1.6
@@ -645,6 +645,12 @@
        clrtoeol();
        prints("转载 ' %s ' 到 %s 版 ", quote_title, bname);
        move(6, 0);
+       if (!strcmp(bname,"syssecurity")) {
+               prints("抱歉,你不能将文章转载到系统安全记录区");
+               pressreturn();
+               clear();
+               return FULLUPDATE;
+       }
        if (innd_board(bname)) {
                getdata(7, 0, "(S)发表 (L)不转信 (A)取消? [A]: ", ispost,
                        9, DOECHO, YEA);
@@ -669,23 +675,47 @@
                islocal = 1;
        }
        if (ispost[0] == 's' || ispost[0] == 'S') {
-               if (deny_me(bname) && !USERPERM(currentuser, PERM_SYSOP)) {
-                       move(8, 0);
-                       clrtobot();
-                       prints
-                           ("\n\n                 很抱歉,您已经被版主停止了发
贴的权利。");
-                       pressreturn();
-                       clear();
-                       return FULLUPDATE;
+               if (deny_me(bname)){
+                       if (USERPERM(currentuser,PERM_SYSOP)) {
+                               move(8,0);
+                               clrtobot();
+                               if (askyn("您已经被版主停止了发帖权利,强制发文
吗?",NA,NA)==NA) {
+                                       prints("\n\n               很抱歉,您已
经被版主停止了发贴的权利。");
+                                       pressreturn();
+                                       clear();
+                                       return FULLUPDATE;
+                               }
+                       } else {
+                               if (!USERPERM(currentuser, PERM_SYSOP)) {
+                                       move(8, 0);
+                                       clrtobot();
+                                       prints
+                                       ("\n\n                 很抱歉,您已经被
版主停止了发贴的权利。");
+                                       pressreturn();
+                                       clear();
+                                       return FULLUPDATE;
+                               }
+                       }
                }
-               if (deny_me_global() && !USERPERM(currentuser, PERM_SYSOP)) {
-                       move(8, 0);
+               if (deny_me_global()) {
+                       move(8,0);
                        clrtobot();
-                       prints
-                           ("\n\n                 很抱歉,您已经被站务停止了全
站的发贴权利。");
-                       pressreturn();
-                       clear();
-                       return FULLUPDATE;
+                       if (USERPERM(currentuser,PERM_SYSOP)) {
+                               if (askyn("您已经被站务停止了全站发帖权利,强制
发文吗?",NA,NA)==NA) {
+                                       prints("\n\n               很抱歉,您已
经被站务停止了全站发贴的权利。");
+                                       pressreturn();
+                                       clear();
+                                       return FULLUPDATE;
+                               }
+                       } else {
+                               if (!USERPERM(currentuser, PERM_SYSOP)) {
+                                       prints
+                                           ("\n\n                 很抱歉,您已
经被站务停止了全站的发贴权利。");
+                                       pressreturn();
+                                       clear();
+                                       return FULLUPDATE;
+                               }
+                       }
                }
                if (club_board(bname, 0)) {
                        if (USERPERM(currentuser, PERM_SYSOP) && (!clubtest(bnam
e))) {
@@ -695,7 +725,7 @@
                                        clear();
                                        return FULLUPDATE;
                                     }
-                       }
+                       } else {
                        if (!clubtest(bname)
                            && !USERPERM(currentuser, PERM_SYSOP)) {
                                move(8, 0);
@@ -707,6 +737,7 @@
                                clear();
                                return FULLUPDATE;
                        }
+                       }
                }
                strcpy(quote_board, currboard);
                ddigestmode = digestmode;
@@ -1739,6 +1770,14 @@
                replytitle = sfh->title;
        modify_user_mode(POSTING);
        bnum = getbnum(currboard);
+       if (!strcmp(currboard,"syssecurity")) {
+               move(3,0);
+               clrtobot();
+               prints("\n\n     抱歉,您不能在系统记录区发帖");
+               pressreturn();
+               clear();
+               return FULLUPDATE;
+       }
        if (!haspostperm(bnum)) {
                move(3, 0);
                clrtobot();
@@ -1771,18 +1810,53 @@
        }

        if (club_board(currboard, bnum)) {
-               if (!clubtest(currboard) && !USERPERM(currentuser, PERM_SYSOP))
{
-                       move(3, 0);
-                       clrtobot();
-                       prints
-                           ("\n\n             %s为俱乐部版面,请向版务申请发文
权限",
-                            currboard);
-                       pressreturn();
-                       clear();
-                       return FULLUPDATE;
+               if (!clubtest(currboard)) {
+                       if (USERPERM(currentuser,PERM_SYSOP)) {
+                               move(3,0);
+                               clrtobot();
+                               if (askyn("您并不是本俱乐部的成员,强制发文吗?",
NA,NA)==NA) {
+                                       prints("\n\n               %s为俱乐部版
面,请向版务申请发文权限。",currboard);
+                                       pressreturn();
+                                       clear();
+                                       return FULLUPDATE;
+                                }
+                       } else {
+                               if (!USERPERM(currentuser, PERM_SYSOP)) {
+                                       move(3, 0);
+                                       clrtobot();
+                                       prints
+                                       ("\n\n             %s为俱乐部版面,请向
版务申请发文权限",
+                                       currboard);
+                                       pressreturn();
+                                       clear();
+                                       return FULLUPDATE;
+                               }
+                       }
                }
        }
-       if (deny_me(currboard) && !USERPERM(currentuser, PERM_SYSOP)) {
+       if (deny_me(currboard)) {
+                       if (USERPERM(currentuser,PERM_SYSOP)) {
+                               move(3,0);
+                               clrtobot();
+                               if (askyn("您已经被版主停止了发帖权利,强制发文
吗?",NA,NA)==NA) {
+                                       prints("\n\n               很抱歉,您已
经被版主停止了发贴的权利。");
+                                       pressreturn();
+                                       clear();
+                                       return FULLUPDATE;
+                               }
+                       } else {
+                               if (!USERPERM(currentuser, PERM_SYSOP)) {
+                                       move(3, 0);
+                                       clrtobot();
+                                       prints
+                                       ("\n\n                 很抱歉,您已经被
版主停止了发贴的权利。");
+                                       pressreturn();
+                                       clear();
+                                       return FULLUPDATE;
+                               }
+                       }
+               }
+/*              && !USERPERM(currentuser, PERM_SYSOP)) {
                move(3, 0);
                clrtobot();
                prints
@@ -1790,11 +1864,30 @@
                pressreturn();
                clear();
                return FULLUPDATE;
-       }
+       }*/
        if (deny_me_global()
            && strcmp(currboard, "sysop")
-           && strcmp(currboard, "Arbitration")
-           && !USERPERM(currentuser, PERM_SYSOP)) {
+           && strcmp(currboard, "Arbitration")) {
+                       move(3,0);
+                       clrtobot();
+                       if (USERPERM(currentuser,PERM_SYSOP)) {
+                               if (askyn("您已经被站务停止了全站发帖权利,强制
发文吗?",NA,NA)==NA) {
+                                       prints("\n\n               很抱歉,您已
经被站务停止了全站发贴的权利。");
+                                       pressreturn();
+                                       clear();
+                                       return FULLUPDATE;
+                               }
+                       } else {
+                               if (!USERPERM(currentuser, PERM_SYSOP)) {
+                                       prints
+                                           ("\n\n                 很抱歉,您已
经被站务停止了全站的发贴权利。");
+                                       pressreturn();
+                                       clear();
+                                       return FULLUPDATE;
+                               }
+                       }
+               }
+           /*&& !USERPERM(currentuser, PERM_SYSOP)) {
                move(3, 0);
                clrtobot();
                prints
@@ -1802,7 +1895,7 @@
                pressreturn();
                clear();
                return FULLUPDATE;
-       }
+       }*/

        bzero(&postfile, sizeof (struct fileheader));
        clear();

本文地址:http://com.8s8s.com/it/it32105.htm