added: new plugin: menu
fixed: System::FollowAllLinks didn't check permissions to a file (only to a simlink or a directory) added: new ezc function: insert_page now we are able to nest pages in pages git-svn-id: svn://ttmath.org/publicrep/winix/trunk@750 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -356,14 +356,12 @@ Item * Dirs::GetDir(const std::wstring & path)
|
||||
// ops, we do not have a root dir
|
||||
return 0;
|
||||
|
||||
Item * pitem = &(*root);
|
||||
|
||||
std::wstring name; // !! dodac jako skladowa klasy
|
||||
Item * pitem = &(*root);
|
||||
const wchar_t * s = path.c_str();
|
||||
|
||||
while( ExtractName(s, name) )
|
||||
while( ExtractName(s, get_dir_temp) )
|
||||
{
|
||||
pitem = GetDir(name, pitem->id);
|
||||
pitem = GetDir(get_dir_temp, pitem->id);
|
||||
|
||||
if( !pitem )
|
||||
return 0;
|
||||
|
@@ -99,6 +99,7 @@ private:
|
||||
size_t AnalyzeDir(Item * pdir, const std::wstring & path, long & dir_id, std::wstring & dir);
|
||||
size_t AnalyzeDir(std::vector<Item*> & dir_tab, const std::wstring & link_to);
|
||||
std::wstring analyze_temp;
|
||||
std::wstring get_dir_temp;
|
||||
|
||||
void CopyDirTab(const std::vector<Item*> & in, std::vector<Item*> & out);
|
||||
int FollowLink(std::vector<Item*> & dir_tab, const std::wstring & link_to, std::wstring & out_item);
|
||||
|
@@ -547,6 +547,14 @@ return false;
|
||||
|
||||
|
||||
|
||||
bool IsLastSlash(const std::wstring & path)
|
||||
{
|
||||
if( path.empty() )
|
||||
return false;
|
||||
|
||||
return path[path.size()-1] == '/';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -185,6 +185,7 @@ const char * DateToStrCookie(time_t t);
|
||||
const wchar_t * IpToStr(unsigned int ip_);
|
||||
|
||||
bool IsWhite(wchar_t s);
|
||||
bool IsLastSlash(const std::wstring & path);
|
||||
|
||||
template<class StringType>
|
||||
void TrimWhite(StringType & s)
|
||||
|
@@ -785,6 +785,12 @@ bool System::FollowAllLinksFileOrSymlinkFound(std::vector<Item*> & out_dir_tab,
|
||||
return false;
|
||||
}
|
||||
|
||||
if( check_access && !HasReadAccess(out_item) )
|
||||
{
|
||||
log << log1 << "System: no read access to the file or symlink" << logend;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( out_item.type == Item::symlink )
|
||||
{
|
||||
if( out_item.link_to.empty() )
|
||||
@@ -794,16 +800,8 @@ bool System::FollowAllLinksFileOrSymlinkFound(std::vector<Item*> & out_dir_tab,
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !check_access || HasReadAccess(out_item) )
|
||||
{
|
||||
if( !(stop_on_link_redirect && out_item.link_redirect==1) )
|
||||
link_to_temp = out_item.link_to;
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log1 << "System: no read access to the symlink" << logend;
|
||||
return false;
|
||||
}
|
||||
if( !(stop_on_link_redirect && out_item.link_redirect==1) )
|
||||
link_to_temp = out_item.link_to;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user