有些站点可能需要,比如限制晚上10点全站不能发文。基本思路是hack checkreadonly。
boards.c
int checkreadonly(const char *board)
{ /* 检查是否是只读版面 */
#ifdef XMU_BBS
//Haishion, 全站只读,在这里切换
#define XMU_READONLY_OUTOFOFFICE 1
#ifdef XMU_READONLY_OUTOFOFFICE
time_t now;
struct tm* t;
now = time(0);
t = localtime(&now);
if (!HAS_PERM(getCurrentUser(), PERM_OBOARDS) &&
((t->tm_hour < 8) || (t->tm_hour > 20))) {
return true;
}
#endif
#endif
const struct boardheader *bh = getbcache(board);
if (bh && (bh->flag & BOARD_READONLY)) /* Checking if DIR access mode is "555" */
return true;
else
return false;
}
--
FROM 125.77.201.*