Ignore:
Timestamp:
2007-07-25T13:37:52+12:00 (17 years ago)
Author:
oranfry
Message:

merged selected changes to the gsdl trunk since r14217 into the 2.74 branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/branches/gsdl-2.74/src/recpt/authenaction.cpp

    r14014 r14270  
    3333#include "infodbclass.h"
    3434#include "gsdltimes.h"
    35 #include "userdb.h"
    3635
    3736
     
    129128
    130129void authenaction::configure (const text_t &key, const text_tarray &cfgline) {
    131   // get the password filename
    132   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 
    138130  action::configure (key, cfgline);
    139131}
    140132
    141133bool authenaction::init (ostream &logout) {
    142 
    143134  if (gdbmhome.empty()) {
    144135    logout << "ERROR (authenaction::init) gdbmhome is not set\n";
    145136    return false;
    146137  }
    147 
    148   if (usersfile.empty()) usersfile = filename_cat (gdbmhome, "etc", "users.db");
    149   if (keyfile.empty()) keyfile = filename_cat (gdbmhome, "etc", "key.db");
    150138
    151139  return action::init (logout);
     
    169157  if (args["uan"].empty()) return true;
    170158
    171   userdbclass *user_database = new userdbclass(usersfile);
    172   keydbclass *key_database = new keydbclass(keyfile);
    173 
    174159  // failure means we have to redirect to this action to get authentication
    175160  // (if we are not already doing this)
     
    188173  else args_us = "failed";
    189174
    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)) {
    192178    if (!args_pw.empty()) {
    193179      // we are authenticating using a password
     
    286272  }
    287273
    288   //close the database
    289   user_database->closedatabase();
    290   key_database->closedatabase();
    291274  return true;
    292275}
Note: See TracChangeset for help on using the changeset viewer.