335 |
{ |
{ |
336 |
void *db; |
void *db; |
337 |
int rc; |
int rc; |
338 |
|
char *errtext; |
339 |
|
|
340 |
|
if (!anubis_dbarg) { |
341 |
|
anubis_error(HARD, _("Database not specified")); |
342 |
|
return ANUBIS_DB_FAIL; |
343 |
|
} |
344 |
|
|
345 |
if (!anubis_dbarg |
if (anubis_db_open(anubis_dbarg, anubis_db_rdonly, |
346 |
|| anubis_db_open(anubis_dbarg, anubis_db_rdonly, |
&db, &errtext) != ANUBIS_DB_SUCCESS) { |
347 |
&db) != ANUBIS_DB_SUCCESS) |
anubis_error(HARD, |
348 |
|
_("Cannot open database %s: %s"), |
349 |
|
anubis_dbarg, errtext); |
350 |
return ANUBIS_DB_FAIL; |
return ANUBIS_DB_FAIL; |
351 |
|
} |
352 |
|
|
353 |
rc = anubis_db_get_record(db, username, usr); |
rc = anubis_db_get_record(db, username, usr); |
354 |
switch (rc) { |
switch (rc) { |
355 |
case ANUBIS_DB_SUCCESS: |
case ANUBIS_DB_SUCCESS: |