IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 5, 2008, 3:13:35 PM (18 years ago)
Author:
Paul Price
Message:

Using new function to get database details from user/site configuration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pxadmin.c

    r18850 r18927  
    122122
    123123    {
    124         bool status;
    125124        char line[128], answer[128];
    126125
    127         // XXX use the values defined in config->dbh?
    128         psString dbName = psMetadataLookupStr(&status, config->modules->complete, "DBNAME");
     126        psMetadataItem *name = pmConfigUserSite(config->modules, "DBNAME", PS_DATA_STRING);
     127        if (!name) {
     128            psError(PS_ERR_UNKNOWN, false, "Unable to determine database name.");
     129            return false;
     130        }
     131        psString dbName = name->data.str;
    129132
    130133        fprintf(stdout, "*** delete the tables from database %s? ***\n", dbName);
     
    150153        sscanf(line, "%s", answer);
    151154
    152         psString dbPassword = psMetadataLookupStr(&status, config->modules->complete, "DBPASSWORD");
     155        psMetadataItem *pass = pmConfigUserSite(config->modules, "DBPASSWORD", PS_DATA_STRING);
     156        if (!pass) {
     157            psError(PS_ERR_UNKNOWN, false, "Unable to determine database password.");
     158            return false;
     159        }
     160        psString dbPassword = pass->data.str;
    153161        if (strcmp (answer, dbPassword)) {
    154162            psError(PS_ERR_UNKNOWN, true, "invalid passwd - tables NOT deleleted");
Note: See TracChangeset for help on using the changeset viewer.