diff options
| author | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-11 14:44:19 +0100 |
|---|---|---|
| committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-11 14:44:19 +0100 |
| commit | 2b65e68f64d00772c1e4765ef9f0510c3edfab48 (patch) | |
| tree | 2bc9519d3482ff8b59519a22a4e32368c7db766c /database/sqlite | |
| parent | 2bc063ccd25092e1b4251136573adaeed8e55937 (diff) | |
| download | eurephia-2b65e68f64d00772c1e4765ef9f0510c3edfab48.tar.gz eurephia-2b65e68f64d00772c1e4765ef9f0510c3edfab48.tar.xz eurephia-2b65e68f64d00772c1e4765ef9f0510c3edfab48.zip | |
Added ACCFLAG_ERRATTEMPT for flagging if the attempt counter > 0
Diffstat (limited to 'database/sqlite')
| -rw-r--r-- | database/sqlite/administration.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/database/sqlite/administration.c b/database/sqlite/administration.c index 3927192..b1e5c91 100644 --- a/database/sqlite/administration.c +++ b/database/sqlite/administration.c @@ -420,9 +420,11 @@ int eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, eurephiaUSERINFO *user) { // Query the database, find the user defined in the user map uinf = sqlite_query_mapped(ctx, SQL_SELECT, "SELECT u.username, u.activated, u.deactivated, u.last_accessed, u.uid," - " (bl.username IS NOT NULL), opensess, logincount" + " (bl.username IS NOT NULL), opensess, logincount," + " (at.attempts > 0)" " FROM openvpn_users u" " LEFT JOIN openvpn_blacklist bl USING(username)" + " LEFT JOIN openvpn_attempts at USING(username)" " LEFT JOIN (SELECT uid, count(*) AS logincount " " FROM openvpn_lastlog" " GROUP BY uid) lc" @@ -453,6 +455,7 @@ int eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, eurephiaUSERINFO *user) { user->account_flags|= ((sqlite_get_value(uinf, 0, 2) != NULL) ? ACCFLAG_DEACTIVATED : 0); user->account_flags|= ((atoi(sqlite_get_value(uinf, 0, 5)) == 1) ? ACCFLAG_BLACKLISTED : 0); user->account_flags|= ((atoi_nullsafe(sqlite_get_value(uinf, 0, 6))==1) ? ACCFLAG_OPENSESSION : 0); + user->account_flags|= ((atoi_nullsafe(sqlite_get_value(uinf, 0, 8))==1) ? ACCFLAG_ERRATTEMPT : 0); if( (getInfo & USERINFO_user) == USERINFO_user ) { free_nullsafe(user->password); |
