OSDN Git Service

Initial import.
[opengate/opengate.git] / opengate / opengatesrv / comm-userdb.c
1 /*************************************************
2   opengate server
3    module for Controling user DB 
4
5    *** Edit this file to set user property ***
6 **************************************************/
7 #include "opengatesrv.h"
8
9 /********************************************************/
10 /* get user property from user db                       */
11 /********************************************************/
12 int getUserProperty(char userid[USERMAXLN], char userProperty[BUFFMAXLN])
13 {
14   /*****************************************************/
15   /*  user database access routine                     */
16   /*  userid[USERMAXLN]: input: user ID to search      */
17   /*               Caution: "userid" if default server,*/
18   /*                        "userid@serverid" if not.  */
19   /*  userProperty[BUFFMAXLN]: output: user property   */
20   /*                   the value goes to opengatefw.pl */
21   /*                   to determine permitting grade.  */     
22   /*  return value: DENY or ACCEPT                     */
23   /*     If DENY is returned, the user is denyed.      */
24   /*     If ACCEPT, the value sent to firewall open.   */
25   /*****************************************************/
26
27   /* REPLACE THE FOLLOWING WITH YOUR DATABASE ACCESS ROUTINE */
28
29
30
31   userProperty[0]='\0';    /* The User has No Property */
32   return ACCEPT;           /* The User is Accepted     */
33
34
35
36 }
37
38
39 /* debug write routine */
40 int GetUserProperty(char *userid, char *userProperty)
41 {
42   int ret;
43
44   if(DEBUG) err_msg("DEBUG:=>getUserProperty(%s,)",userid);
45   ret=getUserProperty(userid,userProperty);
46   if(DEBUG) err_msg("DEBUG:(%d)<=getUserProperty(,%s)",ret, userProperty);
47
48   return ret;
49 }