--- lbbs/include/user_priv.h 2025/07/02 04:17:33 1.7 +++ lbbs/include/user_priv.h 2025/11/05 00:49:41 1.10 @@ -1,18 +1,10 @@ -/*************************************************************************** - user_priv.h - description - ------------------- - Copyright : (C) 2004-2025 by Leaflet - Email : leaflet@leafok.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * user_priv + * - basic operations of user privilege + * + * Copyright (C) 2004-2025 Leaflet + */ #ifndef _USER_PRIV_H_ #define _USER_PRIV_H_ @@ -21,25 +13,31 @@ #include // User privilege -#define S_NONE 0x0 -#define S_LIST 0x1 -#define S_GETEXP 0x2 -#define S_POST 0x4 -#define S_MSG 0x8 -#define S_MAN_S 0x20 -#define S_MAN_M 0x60 //(0x40 | 0x20) -#define S_ADMIN 0xe0 //(0x80 | 0x40 | 0x20) -#define S_ALL 0xff -#define S_DEFAULT 0x3 // 0x1 | 0x2 +enum user_priv_t +{ + S_NONE = 0x0, + S_LIST = 0x1, + S_GETEXP = 0x2, + S_POST = 0x4, + S_MSG = 0x8, + S_MAN_S = 0x20, + S_MAN_M = 0x60, //(0x40 | 0x20) + S_ADMIN = 0xe0, //(0x80 | 0x40 | 0x20) + S_ALL = 0xff, + S_DEFAULT = 0x3, // 0x1 | 0x2 +}; -#define P_GUEST 0x0 //游客 -#define P_USER 0x1 //普通用户 -//#define P_AUTH_USER 0x2 // Reserved -#define P_MAN_S 0x4 //副版主 -#define P_MAN_M 0x8 //正版主 -#define P_MAN_C 0x10 // Reserved -#define P_ADMIN_S 0x20 //副系统管理员 -#define P_ADMIN_M 0x40 //主系统管理员 +enum user_level_t +{ + P_GUEST = 0x0, // 游客 + P_USER = 0x1, // 普通用户 + P_AUTH_USER = 0x2, // Reserved + P_MAN_S = 0x4, // 副版主 + P_MAN_M = 0x8, // 正版主 + P_MAN_C = 0x10, // Reserved + P_ADMIN_S = 0x20, // 副系统管理员 + P_ADMIN_M = 0x40, // 主系统管理员 +}; struct user_priv {