回精華區
作者itoc, 信區: itoc
標題[功能] admutil.c 美工站長
時間04/05/11
作者: itoc (cygreadline4.dll) 看板: plan
標題: [功能] 美工站長
時間: 2004/05/11 Tue 19:03:58                           Updated: 2004/05/11

※ 引述《far (遠...)》之銘言:
>     就是敝站有設美工站長這種職位,就是只能編輯etc/下的檔案..
>     我要如何更改權限讓一般使用者的權限能更改"各種畫面"裡的檔案呢?

: perm.h  隨便選一個空的欄位,例如 PERM_9,改成 PERM_ART

- #define PERM_9          0x00000100
+ #define PERM_ART        0x00000100

  ...
  ...

- #define STR_PERM        "bctpjm#x-------@PTCM--L*B#-RACBS"
+ #define STR_PERM        "bctpjm#xa------@PTCM--L*B#-RACBS"

  ...
  ...

- "保留",                       /* PERM_9 */
+ "美工總管",                   /* PERM_ART */

: menu.c 隨便找一個選單加入選項

+ "bin/admutil.so:a_artfile", PERM_ART | PERM_SYSOP, - M_SYSTEM,
+ "Art        《 美工管理 》",

: admutil.c:a_artfile() 新增這函式於 a_regmerge() 後面

  desc[] 及 path[] 的順序是對應的,可以自己換,最多 18 個檔案
  檔案路徑可以是任意,通常是 gem/@/@* 及 etc/*
  如果 18 個不夠,那麼就再加一個 a_artfile2(),並加入 menu.c 的選項

int
a_artfile()
{
  static char *desc[] =
  {
    "開頭畫面(0)",
    "開頭畫面(1)",
    "開頭畫面(2)",
    "歡迎畫面",
    "再見畫面",
    "生日當天的上站畫面",
    "文章發表綱領",
    "樂透歡迎畫面",
    NULL
  };

  static char *path[] =
  {
    "gem/@/@opening.0",
    "gem/@/@opening.1",
    "gem/@/@opening.2",
    "gem/@/@welcome",
    "gem/@/@goodbye",
    "gem/@/@birthday",
    "gem/@/@post",
    "etc/game/lottery.main",
  };

  x_file(M_XFILES, desc, path);
  return 0;
}

--
□ 本文章由 itocitoc.Dorm11.NCTU.edu.tw 發表
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻