Changeset 14270 for gsdl/branches/gsdl-2.74/src/recpt/authenaction.cpp
- Timestamp:
- 2007-07-25T13:37:52+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/branches/gsdl-2.74/src/recpt/authenaction.cpp
r14014 r14270 33 33 #include "infodbclass.h" 34 34 #include "gsdltimes.h" 35 #include "userdb.h"36 35 37 36 … … 129 128 130 129 void authenaction::configure (const text_t &key, const text_tarray &cfgline) { 131 // get the password filename132 if (cfgline.size() == 1) {133 if (key == "usersfile") usersfile = cfgline[0];134 else if (key == "keyfile") keyfile = cfgline[0];135 else if (key == "keydecay") keydecay = cfgline[0].getint();136 }137 138 130 action::configure (key, cfgline); 139 131 } 140 132 141 133 bool authenaction::init (ostream &logout) { 142 143 134 if (gdbmhome.empty()) { 144 135 logout << "ERROR (authenaction::init) gdbmhome is not set\n"; 145 136 return false; 146 137 } 147 148 if (usersfile.empty()) usersfile = filename_cat (gdbmhome, "etc", "users.db");149 if (keyfile.empty()) keyfile = filename_cat (gdbmhome, "etc", "key.db");150 138 151 139 return action::init (logout); … … 169 157 if (args["uan"].empty()) return true; 170 158 171 userdbclass *user_database = new userdbclass(usersfile);172 keydbclass *key_database = new keydbclass(keyfile);173 174 159 // failure means we have to redirect to this action to get authentication 175 160 // (if we are not already doing this) … … 188 173 else args_us = "failed"; 189 174 190 // make sure we have a username 191 if (!args_un.empty() && (user_database->get_user_info (args_un, thisuser) == ERRNO_SUCCEED)) { 175 // make sure we have a username 176 int status = user_database->get_user_info (args_un, thisuser); 177 if (!args_un.empty() && (status == ERRNO_SUCCEED)) { 192 178 if (!args_pw.empty()) { 193 179 // we are authenticating using a password … … 286 272 } 287 273 288 //close the database289 user_database->closedatabase();290 key_database->closedatabase();291 274 return true; 292 275 }
Note:
See TracChangeset
for help on using the changeset viewer.