| [43] | 1 | /********************************************************************\ |
|---|
| 2 | * This program is free software; you can redistribute it and/or * |
|---|
| 3 | * modify it under the terms of the GNU General Public License as * |
|---|
| 4 | * published by the Free Software Foundation; either version 2 of * |
|---|
| 5 | * the License, or (at your option) any later version. * |
|---|
| 6 | * * |
|---|
| 7 | * This program is distributed in the hope that it will be useful, * |
|---|
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
|---|
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
|---|
| 10 | * GNU General Public License for more details. * |
|---|
| 11 | * * |
|---|
| 12 | * You should have received a copy of the GNU General Public License* |
|---|
| 13 | * along with this program; if not, contact: * |
|---|
| 14 | * * |
|---|
| 15 | * Free Software Foundation Voice: +1-617-542-5942 * |
|---|
| 16 | * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * |
|---|
| 17 | * Boston, MA 02111-1307, USA gnu@gnu.org * |
|---|
| 18 | * * |
|---|
| 19 | \********************************************************************/ |
|---|
| 20 | |
|---|
| 21 | /* $Header$ */ |
|---|
| 22 | /** @file userclasses.h |
|---|
| 23 | @brief Function for handling user classes |
|---|
| 24 | @author Copyright (C) 2004 Alexandre Carmel-Veilleux <acv@acv.ca> |
|---|
| 25 | */ |
|---|
| 26 | |
|---|
| 27 | #ifndef _USERCLASSES_H_ |
|---|
| 28 | #define _USERCLASSES_H_ |
|---|
| 29 | |
|---|
| 30 | /* Format still up in the air... */ |
|---|
| 31 | typedef struct _user_classes { |
|---|
| 32 | int profile; /* 0-255, limited by exit() return values */ |
|---|
| 33 | int timeout; /* In minutes */ |
|---|
| 34 | int active; /* User active, boolean */ |
|---|
| 35 | struct _user_classes *next, |
|---|
| 36 | *prev; |
|---|
| 37 | } UserClasses; |
|---|
| 38 | |
|---|
| 39 | typedef struct _user_rights { |
|---|
| [45] | 40 | int profile; /* keyed to a global profile */ |
|---|
| 41 | time_t start_time; /* when connection started */ |
|---|
| 42 | time_t end_time; /* start_time + timeout */ |
|---|
| [43] | 43 | } UserRights; |
|---|
| 44 | |
|---|
| 45 | UserRights *new_userrights(void); |
|---|
| 46 | void free_userrights(UserRights *rights); |
|---|
| 47 | |
|---|
| 48 | UserClasses *new_userclasses(void); |
|---|
| 49 | void free_userclasses(UserClasses *class); |
|---|
| 50 | void insert_userclasses(UserClasses *class); |
|---|
| 51 | UserClasses *find_userclasses(int profile); |
|---|
| 52 | UserClasses *remove_userclasses(int profile); |
|---|
| 53 | int init_userclasses(int remote_allowed); /* Arg is boolean */ |
|---|
| 54 | |
|---|
| 55 | #endif /* _USERCLASSES_H_ */ |
|---|