fixed: winix_subdomain ezc function
didn't print the subdomain added: to rm winix function: bool Rm::RemoveItemByPath(const std::wstring & path, bool check_access) fixed: in Upload winix function when uploading an image we have to get a mount point where the image is placed (parent dir) (it was cur->mount beforehand) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@844 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -216,8 +216,10 @@ return RemoveFile(item);
|
||||
|
||||
|
||||
// for other uses (plugins etc)
|
||||
void Rm::RemoveItemById(long item_id, bool check_access)
|
||||
bool Rm::RemoveItemById(long item_id, bool check_access)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
// selecting files, symlinks and directories
|
||||
rm_by_id_iq.SetAll(false, false);
|
||||
rm_by_id_iq.sel_parent_id = true;
|
||||
@@ -233,14 +235,49 @@ void Rm::RemoveItemById(long item_id, bool check_access)
|
||||
if( db->GetItem(rm_by_id_item, rm_by_id_iq) == WINIX_ERR_OK )
|
||||
{
|
||||
if( rm_by_id_item.type == Item::dir )
|
||||
{
|
||||
RemoveDirTree(rm_by_id_item, true, check_access);
|
||||
result = true; // RemoveDirTree doesn't return a status
|
||||
}
|
||||
else
|
||||
RemoveFileOrSymlink(rm_by_id_item, check_access);
|
||||
{
|
||||
result = RemoveFileOrSymlink(rm_by_id_item, check_access);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Rm::RemoveItemByPath(const std::wstring & path, bool check_access)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
int res = system->FollowAllLinks(path, rm_path_dir_tab, rm_path_item);
|
||||
|
||||
if( res == 0 )
|
||||
{
|
||||
Item * dir = system->dirs.GetDir(rm_path_dir_tab.back()->id);
|
||||
|
||||
if( dir )
|
||||
{
|
||||
RemoveDirTree(*dir, true, check_access);
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
if( res == 1 )
|
||||
{
|
||||
result = RemoveFileOrSymlink(rm_path_item, check_access);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool Rm::RemoveDirFiles(long dir_id, bool check_access)
|
||||
{
|
||||
content_dir_iq.WhereParentId(dir_id);
|
||||
|
Reference in New Issue
Block a user