Changeset 13844 for trunk/gsdl/src/recpt/authenaction.cpp
- Timestamp:
- 2007-02-01T16:30:11+13:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/authenaction.cpp
r9620 r13844 169 169 if (args["uan"].empty()) return true; 170 170 171 userdbclass *user_database = new userdbclass(usersfile); 172 keydbclass *key_database = new keydbclass(keyfile); 171 173 172 174 // failure means we have to redirect to this action to get authentication … … 187 189 188 190 // make sure we have a username 189 if (!args_un.empty() && get_user_info (usersfile, args_un, thisuser)) {191 if (!args_un.empty() && (user_database->get_user_info (args_un, thisuser) == ERRNO_SUCCEED)) { 190 192 if (!args_pw.empty()) { 191 193 // we are authenticating using a password 192 if ( check_passwd (thisuser, args_pw)) args_ua = "1"; // succeeded194 if (user_database->check_passwd (thisuser.username, args_pw) == ERRNO_SUCCEED) args_ua = "1"; // succeeded 193 195 194 196 } else if (!args_ky.empty()) { 195 197 // we are authenticating using a key 196 if ( check_key (keyfile,thisuser, args_ky, args_ug, keydecay)) args_ua = "1";198 if (key_database->check_key(thisuser, args_ky, args_ug, keydecay)) args_ua = "1"; 197 199 else args_us = "stalekey"; 198 200 } … … 245 247 // note: we don't need to set "ug" as it is already set to what it needs to be 246 248 args_us = "enabled"; 247 args_ky = generate_key (keyfile,args_un); // new key249 args_ky = key_database->generate_key(args_un); // new key 248 250 249 251 // delete old keys around every 50 accesses 250 if (rand()%50 == 1) remove_old_keys (keyfile,keydecay);252 if (rand()%50 == 1) key_database->remove_old_keys(keydecay); 251 253 252 254 } else {
Note:
See TracChangeset
for help on using the changeset viewer.