Exemple #1
0
void NsAdapterCatalog::updateUser(const UserInfo& user) throw (DmException)
{
  // uid may not be initialized
  UserInfo u = this->getUser(user.name);
  wrapCall(dpns_modifyusrmap(u.getUnsigned("uid"),
                             (char*)user.name.c_str(),
                             user.getLong("banned")));
}
Exemple #2
0
void AuthnOracle::updateUser(const UserInfo& user) throw (DmException)
{
  occi::Statement* stmt = getPreparedStatement(this->conn_, STMT_UPDATE_USER);
  
  try {
    stmt->setInt(1, user.getLong("banned"));
    stmt->setString(2, user.name);
    stmt->executeUpdate();
    this->conn_->commit();
    this->conn_->terminateStatement(stmt);
  }
  catch (occi::SQLException& ex) {
    this->conn_->rollback();
    throw DmException(DM_INTERNAL_ERROR, ex.getMessage());
  }
}