| 15 |
* * |
* * |
| 16 |
***************************************************************************/ |
***************************************************************************/ |
| 17 |
|
|
| 18 |
|
#include <time.h> |
| 19 |
|
|
| 20 |
//BBS |
//BBS |
| 21 |
|
#define BBS_max_section 1024 |
| 22 |
|
#define BBS_max_username_length 20 |
| 23 |
|
|
| 24 |
extern char BBS_id[20]; |
extern char BBS_id[20]; |
| 25 |
extern char BBS_name[50]; |
extern char BBS_name[50]; |
| 26 |
extern char BBS_server[256]; |
extern char BBS_server[256]; |
| 29 |
extern long BBS_max_client; |
extern long BBS_max_client; |
| 30 |
extern long BBS_max_user; |
extern long BBS_max_user; |
| 31 |
extern char BBS_start_dt[50]; |
extern char BBS_start_dt[50]; |
| 32 |
|
|
| 33 |
|
//User privilege |
| 34 |
|
#define S_NONE 0x0 |
| 35 |
|
#define S_LIST 0x1 |
| 36 |
|
#define S_GETEXP 0x2 |
| 37 |
|
#define S_POST 0x4 |
| 38 |
|
#define S_MSG 0x8 |
| 39 |
|
#define S_MAIL 0x10 |
| 40 |
|
#define S_MAN_S 0x20 |
| 41 |
|
#define S_MAN_M 0x60 //(0x40 | 0x20) |
| 42 |
|
#define S_ADMIN 0xe0 //(0x80 | 0x40 | 0x20) |
| 43 |
|
#define S_ALL 0xff |
| 44 |
|
#define S_DEFAULT 0x3 //0x1 | 0x2 |
| 45 |
|
|
| 46 |
|
#define P_GUEST 0x0 //游客 |
| 47 |
|
#define P_USER 0x1 //普通用户 |
| 48 |
|
#define P_AUTH_USER 0x2 //认证用户 |
| 49 |
|
#define P_MAN_S 0x4 //副版主 |
| 50 |
|
#define P_MAN_M 0x8 //正版主 |
| 51 |
|
#define P_MAN_C 0x10 //栏目主管 |
| 52 |
|
#define P_ADMIN_S 0x20 //次系统管理员 |
| 53 |
|
#define P_ADMIN_M 0x40 //主系统管理员 |
| 54 |
|
|
| 55 |
|
struct user_priv |
| 56 |
|
{ |
| 57 |
|
long int uid; |
| 58 |
|
long int auid; |
| 59 |
|
int level; |
| 60 |
|
int g_priv; |
| 61 |
|
struct |
| 62 |
|
{ |
| 63 |
|
int sid; |
| 64 |
|
int s_priv; |
| 65 |
|
}s_priv_list[BBS_max_section]; |
| 66 |
|
int s_count; |
| 67 |
|
}; |
| 68 |
|
|
| 69 |
|
typedef struct user_priv BBS_user_priv; |
| 70 |
|
|
| 71 |
|
//Session |
| 72 |
|
extern char BBS_username[BBS_max_username_length]; |
| 73 |
|
extern BBS_user_priv BBS_priv; |
| 74 |
|
extern int BBS_passwd_complex; |
| 75 |
|
|
| 76 |
|
extern time_t BBS_login_tm; |
| 77 |
|
extern time_t BBS_last_access_tm; |
| 78 |
|
extern time_t BBS_last_sub_tm; |
| 79 |
|
|
| 80 |
|
extern char BBS_current_section_name[20]; |