Import of tac_plus.v8.tar.gz: 173206 bytes, md5:
[tac_plus.git] / db_null.c
1 /*
2 **  Simple NULL driver for database interface. I created this for testing
3 **  db_* on my notebook by home. There i dont have Oracle or any database
4 **  server.                                               Fil/27-nov-1998
5 **
6 **  DO_NOT_USE_THIS_FOR_WORK!
7 */
8
9 #if defined(DB_NULL) && defined(DB)
10 #include "tac_plus.h"
11
12 int null_db_verify(user, users_passwd, db_user, db_password, db_hostname,
13             db_table, dbfield_name, dbfield_passwd)
14             
15 char *user, *users_passwd;      /* Username and gived password   */
16 char *db_user;                  /* db's parametr's               */
17 char *db_password;
18 char *db_hostname;
19 char *db_table;
20 char *dbfield_name;
21 char *dbfield_passwd;
22
23 {
24 //report(LOG_DEBUG, "DB_NULL(%u) - ok", __LINE__);
25
26     /* Try to verify the password
27        Successful if username and password equal */
28     if (strcmp(user, users_passwd)) {
29         return (0);
30     }
31     if (debug & DEBUG_PASSWD_FLAG)
32         report(LOG_DEBUG, "DB Null: verify password '%s'", users_passwd);
33
34     return (1); /* Return 1 if verified, 0 otherwise. */
35 }
36
37 /*      Null Database Accounting        */
38
39 int 
40 null_db_acct(db_user, db_password, db_hostname,db_name,db_table,s_name,c_name,a_username,elapsed_time,bytes_in,bytes_out)
41 char *db_user;                  /* db's parametr's               */
42 char *db_password;
43 char *db_hostname;
44 char *db_name;
45 char *db_table;
46 char *s_name;
47 char *c_name;
48 char *a_username;
49 char *elapsed_time;char *bytes_in;char *bytes_out;
50 {
51 report(LOG_INFO,"Db accounting user=%s pass=%s host=%s 
52 db_name=%s table=%s servern=%s clientn=%s username=%s et=%s bi=%s bo=%s",db_user,db_password,db_hostname,
53 db_name,db_table,s_name,c_name,a_username,elapsed_time,bytes_in,bytes_out);
54 return (1);
55 }
56 #endif
57