diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2013-03-29 22:05:34 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2013-03-29 22:05:34 +0800 |
commit | 6a0d7685111fc8607d33d783bbe90826dd7d6559 (patch) | |
tree | e6deb51685cdd1632d5dbe494b0bf2a95c62a5e2 | |
parent | 3c2344bf065e5a29228163019bc2ddb8043162b4 (diff) | |
download | pttbbs-6a0d7685111fc8607d33d783bbe90826dd7d6559.tar pttbbs-6a0d7685111fc8607d33d783bbe90826dd7d6559.tar.gz pttbbs-6a0d7685111fc8607d33d783bbe90826dd7d6559.tar.bz2 pttbbs-6a0d7685111fc8607d33d783bbe90826dd7d6559.tar.lz pttbbs-6a0d7685111fc8607d33d783bbe90826dd7d6559.tar.xz pttbbs-6a0d7685111fc8607d33d783bbe90826dd7d6559.tar.zst pttbbs-6a0d7685111fc8607d33d783bbe90826dd7d6559.zip |
Enable roles in mbbsd
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5832 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/angel.c | 11 | ||||
-rw-r--r-- | pttbbs/mbbsd/talk.c | 23 |
2 files changed, 14 insertions, 20 deletions
diff --git a/pttbbs/mbbsd/angel.c b/pttbbs/mbbsd/angel.c index a6dc3d1f..3c259955 100644 --- a/pttbbs/mbbsd/angel.c +++ b/pttbbs/mbbsd/angel.c @@ -76,6 +76,7 @@ angel_notify_activity(const char *userid) { static time4_t t = 0; time4_t tick; + // TODO last piece to replace by ROLE_ANGEL_CIA. #ifdef ANGEL_CIA_ACCOUNT // Don't notify AngelBeats for CIA account. if (strcasecmp(userid, ANGEL_CIA_ACCOUNT) == 0) @@ -271,7 +272,6 @@ select_angel() { int uid = list.uids[i]; const char *userid = getuserid(uid); FILE *fp = NULL; - int has_nick = 0; userinfo_t *uinfo = search_ulist_userid(userid); const char *pause_msg = ""; @@ -279,7 +279,6 @@ select_angel() { if ((fp = fopen(fn, "rt")) != NULL) { angel_parse_nick_fp(fp, nick, sizeof(nick)); strlcat(nick, "小天使", sizeof(nick)); - has_nick = 1; fclose(fp); } else { strlcpy(nick, "(未設定暱稱)", sizeof(nick)); @@ -325,10 +324,8 @@ do_changeangel(int force) { if (cuser.myangel[0] == '-') return 0; -#ifdef ANGEL_CIA_ACCOUNT - if (strcasecmp(cuser.userid, ANGEL_CIA_ACCOUNT) == 0) + if (HasUserRole(ROLE_ANGEL_CIA)) return select_angel(); -#endif if (!cuser.myangel[0]) { vmsg(prompt); @@ -858,10 +855,8 @@ TalkToAngel(){ return; } -#ifdef ANGEL_CIA_ACCOUNT - if (strcasecmp(cuser.userid, ANGEL_CIA_ACCOUNT) == 0) + if (HasUserRole(ROLE_ANGEL_CIA)) supervisor = 1; -#endif if (cuser.myangel[0] && !AngelPermChecked) { userec_t xuser = {0}; diff --git a/pttbbs/mbbsd/talk.c b/pttbbs/mbbsd/talk.c index a1c133ec..db7b290a 100644 --- a/pttbbs/mbbsd/talk.c +++ b/pttbbs/mbbsd/talk.c @@ -488,20 +488,19 @@ my_query(const char *uident) outs("《私人信箱》最近無新信件\n"); // ------------------------------------------------------------ -#ifdef ANGEL_CIA_ACCOUNT - if (strcasecmp(muser.userid, ANGEL_CIA_ACCOUNT) != 0) -#endif - { - prints("《上次上站》%-28.28s《上次故鄉》", - PERM_HIDE(&muser) ? "秘密" : - Cdate(muser.lastseen ? &muser.lastseen : &muser.lastlogin)); - // print out muser.lasthost + if (muser.role & ROLE_HIDE_FROM) { + // do nothing + } else { + prints("《上次上站》%-28.28s《上次故鄉》", + PERM_HIDE(&muser) ? "秘密" : + Cdate(muser.lastseen ? &muser.lastseen : &muser.lastlogin)); + // print out muser.lasthost #ifdef USE_MASKED_FROMHOST - if(!HasUserPerm(PERM_SYSOP|PERM_ACCOUNTS)) - obfuscate_ipstr(muser.lasthost); + if(!HasUserPerm(PERM_SYSOP|PERM_ACCOUNTS)) + obfuscate_ipstr(muser.lasthost); #endif // !USE_MASKED_FROMHOST - outs(muser.lasthost[0] ? muser.lasthost : "(不詳)"); - outs("\n"); + outs(muser.lasthost[0] ? muser.lasthost : "(不詳)"); + outs("\n"); } // ------------------------------------------------------------ |