回精華區
作者itoc.bbs@cpu.tfcis.org (核心動力) 看板: plan
標題Re: 請問 如何取消版主可以更改看板屬性
時間動力核心 (2005/05/26 Thu 09:46:30) Updated: 2005/05/26
※ 引述《papago (papago)》之銘言:
>     請問.除了以上 不開放版主修改看板屬性 的功能外
>     能否設定 特定優秀版主 能修改呢 ?

: global.h

#define FN_ETC_EXPIRE   "etc/expire.conf"       /* 看板文章篇數上限設定 */
+ #define FN_ETC_GOODBM "etc/goodbm"            /* 優良板主清單 */

: admutil.c:a_xfile()

    "收信黑名單",
+   "優良板主清單",

  ...
  ...

    UNMAIL_ACLFILE,
+   FN_ETC_GOODBM,

: manage.c:belong_goodbm() 加在 post_manage() 前面

static int
belong_goodbm()
{
  int fd, rc;
  char *str;

  rc = 0;
  if ((fd = open(FN_ETC_GOODBM, O_RDONLY)) >= 0)
  {
    mgets(-1);

    while (str = mgets(fd))
    {
      if (!strcmp(str, cuser.userid))
      {
        rc = 1;
        break;
      }
    }

    close(fd);
  }
  return rc;
}

: post.c:post_manage()

  // 接下來就看你要禁止「不在優良板主名單上的板主」做哪些事,     
  // 就在那 case 裡面加 if (belong_goodbm())                      
  // 例如「只有在優良板主名單上的板主才能改變是否開放注音文」     

  case 's':
+   if (belong_goodbm())
      return post_battr_noscore(xo);

--
  Origin:  Maple-itoc˙動力核心  cpu.tfcis.org 
  Author: itoc itoc.Dorm11.NCTU.edu.tw 發表
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻