*
*/
+#include "postgresql_store.h"
+
+#include "stg/locker.h"
+#include "stg/common.h"
+#include "stg/admin_conf.h"
+#include "stg/blowfish.h"
+
#include <string>
#include <vector>
#include <sstream>
#include <libpq-fe.h>
-#include "stg/locker.h"
-#include "stg/admin_conf.h"
-#include "stg/blowfish.h"
-#include "postgresql_store.h"
-
#define adm_enc_passwd "cjeifY8m3"
//-----------------------------------------------------------------------------
PQclear(result);
printfd(__FILE__, "POSTGRESQL_STORE::GetAdminsList(): '%s'\n", strError.c_str());
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::GetAdminsList(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::GetAdminsList(): 'Failed to rollback transaction'\n");
+ }
return -1;
}
}
//-----------------------------------------------------------------------------
-int POSTGRESQL_STORE::SaveAdmin(const ADMIN_CONF & ac) const
+int POSTGRESQL_STORE::SaveAdmin(const STG::AdminConf & ac) const
{
STG_LOCKER lock(&mutex);
{
printfd(__FILE__, "POSTGRESQL_STORE::SaveAdmin(): 'Failed to escape password'\n");
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::SaveAdmin(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::SaveAdmin(): 'Failed to rollback transaction'\n");
+ }
return -1;
}
{
printfd(__FILE__, "POSTGRESQL_STORE::SaveAdmin(): 'Failed to escape login'\n");
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::SaveAdmin(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::SaveAdmin(): 'Failed to rollback transaction'\n");
+ }
return -1;
}
PQclear(result);
printfd(__FILE__, "POSTGRESQL_STORE::SaveAdmin(): '%s'\n", strError.c_str());
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::SaveAdmin(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::SaveAdmin(): 'Failed to rollback transaction'\n");
+ }
return -1;
}
}
//-----------------------------------------------------------------------------
-int POSTGRESQL_STORE::RestoreAdmin(ADMIN_CONF * ac, const std::string & login) const
+int POSTGRESQL_STORE::RestoreAdmin(STG::AdminConf * ac, const std::string & login) const
{
STG_LOCKER lock(&mutex);
{
printfd(__FILE__, "POSTGRESQL_STORE::RestoreAdmin(): 'Failed to escape login'\n");
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::RestoreAdmin(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::RestoreAdmin(): 'Failed to rollback transaction'\n");
+ }
return -1;
}
printfd(__FILE__, "POSTGRESQL_STORE::RestoreAdmin(): '%s'\n", strError.c_str());
PQclear(result);
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::RestoreAdmin(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::RestoreAdmin(): 'Failed to rollback transaction'\n");
+ }
return -1;
}
printfd(__FILE__, "POSTGRESQL_STORE::RestoreAdmin(): 'Invalid number of tuples. Wanted 1, actulally %d'\n", tuples);
PQclear(result);
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::RestoreAdmin(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::RestoreAdmin(): 'Failed to rollback transaction'\n");
+ }
return -1;
}
{
printfd(__FILE__, "POSTGRESQL_STORE::AddAdmin(): 'Failed to escape login'\n");
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::AddAdmin(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::AddAdmin(): 'Failed to rollback transaction'\n");
+ }
return -1;
}
PQclear(result);
printfd(__FILE__, "POSTGRESQL_STORE::AddAdmin(): '%s'\n", strError.c_str());
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::AddAdmin(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::AddAdmin(): 'Failed to rollback transaction'\n");
+ }
return -1;
}
{
printfd(__FILE__, "POSTGRESQL_STORE::DelAdmin(): 'Failed to escape login'\n");
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::DelAdmin(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::DelAdmin(): 'Failed to rollback transaction'\n");
+ }
return -1;
}
PQclear(result);
printfd(__FILE__, "POSTGRESQL_STORE::DelAdmin(): '%s'\n", strError.c_str());
if (RollbackTransaction())
- {
- printfd(__FILE__, "POSTGRESQL_STORE::DelAdmin(): 'Failed to rollback transaction'\n");
- }
+ {
+ printfd(__FILE__, "POSTGRESQL_STORE::DelAdmin(): 'Failed to rollback transaction'\n");
+ }
return -1;
}