added: parameter 'r' to priv function

all directories and files can be changed


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@586 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-02-16 00:37:00 +00:00
parent a276fb6b79
commit 4fe3d4339f
16 changed files with 347 additions and 106 deletions

View File

@@ -799,6 +799,8 @@ void Db::GetItems(std::vector<Item> & item_table, long parent_id, Item::Type typ
item_table.clear();
PGresult * r = 0;
item_table.clear();
try
{
AssertConnection();
@@ -859,7 +861,10 @@ return res;
}
// !! ta chyba nie uzywana juz?
// !! zamienic nazwe na GetFile?
// !! cos tu pomyslec innego, ta metoda nie musi pobierac tablicy za argument
// i tak istnieje tylko jedna pozycja o okreslonym id
// mozna zwracac bool i pobierac referencje na item
void Db::GetItem(std::vector<Item> & item_table, long id)
{
PGresult * r = 0;
@@ -1020,8 +1025,6 @@ long Db::GetDirId(long parent_id, const std::string & url)
// !! w tej metodzie odczytujemy tylko uprawnienia?
// bo w tej chwili jest caly item odczytywany
bool Db::GetPriv(Item & item, long id)
{
bool result = false;
@@ -1033,7 +1036,8 @@ bool result = false;
AssertConnection();
std::ostringstream query;
query << "select user_id, group_id, privileges, subject, content, guest_name from core.item left join core.content on item.content_id = content.id where item.id='" << id << "';"; // !! tymczasowo odczytujemy z content i subject
query << "select user_id, group_id, privileges, guest_name from core.item"
<< " where item.id='" << id << "';";
r = AssertQuery( query.str() );
AssertResultStatus(r, PGRES_TUPLES_OK);
@@ -1092,6 +1096,7 @@ return result;
Error Db::DelDirById(long id)
{
Error result = Error::ok;