added: mount points
(reading /etc/fstab from db not working yet) core/mount.h core/mountparser.h core/mountparser.cpp core/mounts.h core/mounts.cpp content/thread.cpp content/createthread.cpp templates/thread.cpp git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@495 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
o = data.o log.o sessionmanager.o requestcontroller.o dircontainer.o session.o main.o done.o request.o misc.o httpsimpleparser.o db.o error.o db_itemcolumns.o users.o config.o dirs.o groups.o function.o functionparser.o functions.o functioncodeparser.o sessioncontainer.o lastcontainer.o
|
||||
o = data.o log.o sessionmanager.o requestcontroller.o dircontainer.o session.o main.o done.o request.o misc.o httpsimpleparser.o db.o error.o db_itemcolumns.o users.o config.o dirs.o groups.o function.o functionparser.o functions.o functioncodeparser.o sessioncontainer.o lastcontainer.o mounts.o mountparser.o
|
||||
|
||||
|
||||
|
||||
|
@@ -3,10 +3,14 @@
|
||||
config.o: config.h ../confparser/confparser.h error.h log.h data.h misc.h
|
||||
config.o: item.h dirs.h db.h dircontainer.h user.h group.h ugcontainer.h
|
||||
config.o: users.h groups.h functions.h function.h functioncodeparser.h
|
||||
config.o: lastcontainer.h
|
||||
config.o: lastcontainer.h mounts.h mount.h request.h requesttypes.h session.h
|
||||
config.o: done.h getparser.h httpsimpleparser.h postparser.h cookieparser.h
|
||||
config.o: mountparser.h
|
||||
data.o: data.h misc.h log.h item.h error.h dirs.h db.h dircontainer.h user.h
|
||||
data.o: group.h ugcontainer.h users.h groups.h functions.h function.h
|
||||
data.o: functioncodeparser.h lastcontainer.h
|
||||
data.o: functioncodeparser.h lastcontainer.h mounts.h mount.h request.h
|
||||
data.o: requesttypes.h session.h done.h getparser.h httpsimpleparser.h
|
||||
data.o: postparser.h cookieparser.h mountparser.h
|
||||
db.o: db.h log.h item.h misc.h error.h dircontainer.h user.h group.h
|
||||
db.o: ugcontainer.h
|
||||
db_itemcolumns.o: db.h log.h item.h misc.h error.h dircontainer.h user.h
|
||||
@@ -22,9 +26,9 @@ functionparser.o: functionparser.h request.h requesttypes.h log.h session.h
|
||||
functionparser.o: error.h item.h done.h user.h getparser.h httpsimpleparser.h
|
||||
functionparser.o: postparser.h cookieparser.h function.h data.h misc.h dirs.h
|
||||
functionparser.o: db.h dircontainer.h group.h ugcontainer.h users.h groups.h
|
||||
functionparser.o: functions.h functioncodeparser.h lastcontainer.h
|
||||
functionparser.o: ../app/content.h ../core/log.h ../core/data.h
|
||||
functionparser.o: ../core/function.h
|
||||
functionparser.o: functions.h functioncodeparser.h lastcontainer.h mounts.h
|
||||
functionparser.o: mount.h mountparser.h ../app/content.h ../core/log.h
|
||||
functionparser.o: ../core/data.h ../core/function.h
|
||||
functions.o: functions.h function.h log.h item.h functioncodeparser.h
|
||||
groups.o: groups.h group.h db.h log.h item.h misc.h error.h dircontainer.h
|
||||
groups.o: user.h ugcontainer.h
|
||||
@@ -33,33 +37,37 @@ lastcontainer.o: lastcontainer.h log.h
|
||||
log.o: log.h
|
||||
main.o: requestcontroller.h data.h misc.h log.h item.h error.h dirs.h db.h
|
||||
main.o: dircontainer.h user.h group.h ugcontainer.h users.h groups.h
|
||||
main.o: functions.h function.h functioncodeparser.h lastcontainer.h request.h
|
||||
main.o: requesttypes.h session.h done.h getparser.h httpsimpleparser.h
|
||||
main.o: postparser.h cookieparser.h ../content/content.h
|
||||
main.o: ../templates/templates.h ../../ezc/src/ezc.h ../core/data.h
|
||||
main.o: ../core/request.h ../core/item.h ../core/db.h ../core/error.h
|
||||
main.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
main.o: ../core/log.h ../templates/patterncacher.h ../app/templates.h
|
||||
main.o: ../core/misc.h ../core/function.h ../core/functionparser.h
|
||||
main.o: ../app/content.h sessionmanager.h sessioncontainer.h config.h
|
||||
main.o: ../confparser/confparser.h
|
||||
main.o: functions.h function.h functioncodeparser.h lastcontainer.h mounts.h
|
||||
main.o: mount.h request.h requesttypes.h session.h done.h getparser.h
|
||||
main.o: httpsimpleparser.h postparser.h cookieparser.h mountparser.h
|
||||
main.o: ../content/content.h ../templates/templates.h ../../ezc/src/ezc.h
|
||||
main.o: ../core/data.h ../core/request.h ../core/item.h ../core/db.h
|
||||
main.o: ../core/error.h ../core/user.h ../core/group.h ../core/users.h
|
||||
main.o: ../core/groups.h ../core/log.h ../templates/patterncacher.h
|
||||
main.o: ../app/templates.h ../core/misc.h ../core/function.h
|
||||
main.o: ../core/functionparser.h ../app/content.h sessionmanager.h
|
||||
main.o: sessioncontainer.h config.h ../confparser/confparser.h
|
||||
misc.o: misc.h log.h item.h
|
||||
mountparser.o: mountparser.h log.h mount.h error.h
|
||||
mounts.o: mounts.h mount.h request.h requesttypes.h log.h session.h error.h
|
||||
mounts.o: item.h done.h user.h getparser.h httpsimpleparser.h postparser.h
|
||||
mounts.o: cookieparser.h function.h mountparser.h
|
||||
request.o: request.h requesttypes.h log.h session.h error.h item.h done.h
|
||||
request.o: user.h getparser.h httpsimpleparser.h postparser.h cookieparser.h
|
||||
request.o: function.h
|
||||
requestcontroller.o: requestcontroller.h data.h misc.h log.h item.h error.h
|
||||
requestcontroller.o: dirs.h db.h dircontainer.h user.h group.h ugcontainer.h
|
||||
requestcontroller.o: users.h groups.h functions.h function.h
|
||||
requestcontroller.o: functioncodeparser.h lastcontainer.h request.h
|
||||
requestcontroller.o: requesttypes.h session.h done.h getparser.h
|
||||
requestcontroller.o: functioncodeparser.h lastcontainer.h mounts.h mount.h
|
||||
requestcontroller.o: request.h requesttypes.h session.h done.h getparser.h
|
||||
requestcontroller.o: httpsimpleparser.h postparser.h cookieparser.h
|
||||
requestcontroller.o: ../content/content.h ../templates/templates.h
|
||||
requestcontroller.o: ../../ezc/src/ezc.h ../core/data.h ../core/request.h
|
||||
requestcontroller.o: ../core/item.h ../core/db.h ../core/error.h
|
||||
requestcontroller.o: ../core/user.h ../core/group.h ../core/users.h
|
||||
requestcontroller.o: ../core/groups.h ../core/log.h
|
||||
requestcontroller.o: ../templates/patterncacher.h ../app/templates.h
|
||||
requestcontroller.o: ../core/misc.h ../core/function.h
|
||||
requestcontroller.o: mountparser.h ../content/content.h
|
||||
requestcontroller.o: ../templates/templates.h ../../ezc/src/ezc.h
|
||||
requestcontroller.o: ../core/data.h ../core/request.h ../core/item.h
|
||||
requestcontroller.o: ../core/db.h ../core/error.h ../core/user.h
|
||||
requestcontroller.o: ../core/group.h ../core/users.h ../core/groups.h
|
||||
requestcontroller.o: ../core/log.h ../templates/patterncacher.h
|
||||
requestcontroller.o: ../app/templates.h ../core/misc.h ../core/function.h
|
||||
requestcontroller.o: ../core/functionparser.h ../app/content.h
|
||||
requestcontroller.o: sessionmanager.h sessioncontainer.h
|
||||
session.o: session.h requesttypes.h error.h log.h item.h done.h user.h
|
||||
@@ -69,7 +77,7 @@ sessionmanager.o: sessionmanager.h request.h requesttypes.h log.h session.h
|
||||
sessionmanager.o: error.h item.h done.h user.h getparser.h httpsimpleparser.h
|
||||
sessionmanager.o: postparser.h cookieparser.h function.h data.h misc.h dirs.h
|
||||
sessionmanager.o: db.h dircontainer.h group.h ugcontainer.h users.h groups.h
|
||||
sessionmanager.o: functions.h functioncodeparser.h lastcontainer.h
|
||||
sessionmanager.o: sessioncontainer.h
|
||||
sessionmanager.o: functions.h functioncodeparser.h lastcontainer.h mounts.h
|
||||
sessionmanager.o: mount.h mountparser.h sessioncontainer.h
|
||||
users.o: users.h user.h db.h log.h item.h misc.h error.h dircontainer.h
|
||||
users.o: group.h ugcontainer.h
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include "groups.h"
|
||||
#include "functions.h"
|
||||
#include "lastcontainer.h"
|
||||
|
||||
#include "mounts.h"
|
||||
|
||||
|
||||
|
||||
@@ -119,8 +119,14 @@ public:
|
||||
// functions (ls, cat, etc)
|
||||
Functions functions;
|
||||
|
||||
// for 'last' function
|
||||
LastContainer last;
|
||||
|
||||
// mount points
|
||||
Mounts mounts;
|
||||
|
||||
|
||||
|
||||
Data();
|
||||
|
||||
|
||||
|
@@ -52,12 +52,12 @@ bool DirContainer::Empty()
|
||||
|
||||
|
||||
|
||||
void DirContainer::PushBack(const Item & item)
|
||||
DirContainer::Iterator DirContainer::PushBack(const Item & item)
|
||||
{
|
||||
if( item.parent_id == -1 && is_root )
|
||||
{
|
||||
log << log1 << "DirCont: more than one root dir - skipped, id: " << item.id << logend;
|
||||
return;
|
||||
return root_iter;
|
||||
}
|
||||
|
||||
Iterator last_iter = table.insert(table.end(), item);
|
||||
@@ -74,6 +74,8 @@ void DirContainer::PushBack(const Item & item)
|
||||
table_parent.insert( std::make_pair(last_iter->parent_id, last_iter) );
|
||||
|
||||
log << log3 << "DirCont: added indexes to dir, id: " << last_iter->id << ", parent_id: " << last_iter->parent_id << logend;
|
||||
|
||||
return last_iter;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -38,7 +38,7 @@ public:
|
||||
Iterator End();
|
||||
SizeType Size();
|
||||
bool Empty();
|
||||
void PushBack(const Item & item);
|
||||
Iterator PushBack(const Item & item);
|
||||
void Clear();
|
||||
|
||||
Iterator FindId(long id);
|
||||
|
@@ -342,9 +342,9 @@ return &(*i);
|
||||
|
||||
|
||||
|
||||
void Dirs::AddDir(const Item & item)
|
||||
Item * Dirs::AddDir(const Item & item)
|
||||
{
|
||||
dir_table.PushBack(item);
|
||||
return &(*dir_table.PushBack(item));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -68,7 +68,7 @@ public:
|
||||
Item * GetDir(const std::string & path);
|
||||
Item * GetDir(long id);
|
||||
|
||||
void AddDir(const Item & item);
|
||||
Item * AddDir(const Item & item);
|
||||
|
||||
|
||||
static void SplitPath(const std::string & path, std::string & dir, std::string & file);
|
||||
|
@@ -26,6 +26,7 @@ public:
|
||||
deleted_dir,
|
||||
privileged_item,
|
||||
added_dir,
|
||||
added_thread,
|
||||
defaulted_dir,
|
||||
loggedout
|
||||
};
|
||||
|
@@ -44,6 +44,9 @@ public:
|
||||
|
||||
item_required, // !! zamienic na no_item (i usunac db_no_item)
|
||||
unknown_param,
|
||||
|
||||
mount_unknown,
|
||||
no_mountpoint,
|
||||
unknown = 1000
|
||||
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008, Tomasz Sowa
|
||||
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -29,6 +29,9 @@
|
||||
#define FUN_RUN 11
|
||||
#define FUN_WHO 12
|
||||
#define FUN_LAST 13
|
||||
#define FUN_CREATETHREAD 14
|
||||
#define FUN_THREAD 15
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008, Tomasz Sowa
|
||||
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -87,6 +87,14 @@ void Functions::ReadFunctions()
|
||||
f.item.url = "last";
|
||||
table.insert( std::make_pair(f.item.url, f) );
|
||||
|
||||
f.code = FUN_CREATETHREAD;
|
||||
f.item.url = "createthread";
|
||||
table.insert( std::make_pair(f.item.url, f) );
|
||||
|
||||
f.code = FUN_THREAD;
|
||||
f.item.url = "thread";
|
||||
table.insert( std::make_pair(f.item.url, f) );
|
||||
|
||||
// -----------
|
||||
// FunctionCodeParser fc;
|
||||
// fc.Parse(Item()); // temporary for linking
|
||||
|
66
core/mount.h
Executable file
66
core/mount.h
Executable file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef headerfilecoremount
|
||||
#define headerfilecoremount
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class Mount
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
enum Type
|
||||
{
|
||||
cms = 0,
|
||||
thread
|
||||
};
|
||||
|
||||
|
||||
long dir_id;
|
||||
Type type;
|
||||
|
||||
// in the future can be more parameters to a mount point
|
||||
|
||||
|
||||
const char * TypeToStr()
|
||||
{
|
||||
static char buffer[30];
|
||||
|
||||
switch( type )
|
||||
{
|
||||
case cms:
|
||||
sprintf(buffer, "cms");
|
||||
break;
|
||||
|
||||
case thread:
|
||||
sprintf(buffer, "thread");
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf(buffer, "the name is not set");
|
||||
break;
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
146
core/mountparser.cpp
Executable file
146
core/mountparser.cpp
Executable file
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mountparser.h"
|
||||
#include "data.h"
|
||||
|
||||
|
||||
|
||||
bool MountParser::IsWhite(int c)
|
||||
{
|
||||
if( c==' ' || c=='\t' || c==13 )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void MountParser::SkipWhite()
|
||||
{
|
||||
while( IsWhite(*pinput) )
|
||||
++pinput;
|
||||
}
|
||||
|
||||
|
||||
void MountParser::SkipLine()
|
||||
{
|
||||
while( *pinput && *pinput != 10 )
|
||||
++pinput;
|
||||
|
||||
if( *pinput == 10 )
|
||||
++pinput;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MountParser::ReadWord(std::string & res)
|
||||
{
|
||||
res.clear();
|
||||
|
||||
while( *pinput && *pinput!=10 && !IsWhite(*pinput) )
|
||||
{
|
||||
res += *pinput;
|
||||
++pinput;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MountParser::ReadMountType()
|
||||
{
|
||||
SkipWhite();
|
||||
ReadWord(temp);
|
||||
|
||||
if( temp == "cms" )
|
||||
{
|
||||
mount_type = Mount::cms;
|
||||
log << log3 << "MP: mount type: cms" << logend;
|
||||
}
|
||||
else
|
||||
if( temp == "thread" )
|
||||
{
|
||||
mount_type = Mount::thread;
|
||||
log << log3 << "MP: mount type: thread" << logend;
|
||||
}
|
||||
else
|
||||
{
|
||||
err = Error::mount_unknown;
|
||||
log << log1 << "MP: unknown mount type: " << temp << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MountParser::ReadMountPoint()
|
||||
{
|
||||
SkipWhite();
|
||||
|
||||
// !! narazie bez cudzyslowow
|
||||
ReadWord(temp);
|
||||
|
||||
pdir = data.dirs.GetDir(temp);
|
||||
|
||||
if( pdir )
|
||||
{
|
||||
log << log3 << "MP: mount point: " << temp << logend;
|
||||
}
|
||||
else
|
||||
{
|
||||
err == Error::no_mountpoint;
|
||||
log << log1 << "MP: there is no such a mount point: " << temp << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MountParser::ReadRow(std::map<long, Mount> & output)
|
||||
{
|
||||
ReadMountType();
|
||||
|
||||
if( err == Error::ok )
|
||||
ReadMountPoint();
|
||||
|
||||
|
||||
if( err == Error::ok )
|
||||
{
|
||||
Mount m;
|
||||
m.dir_id = pdir->id;
|
||||
m.type = mount_type;
|
||||
|
||||
output.insert( std::make_pair(pdir->id, m) );
|
||||
}
|
||||
|
||||
SkipLine();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Error MountParser::Parse(const std::string & input, std::map<long, Mount> & output)
|
||||
{
|
||||
pinput = input.c_str();
|
||||
err = Error::ok;
|
||||
output.clear();
|
||||
|
||||
while( *pinput && err == Error::ok )
|
||||
ReadRow(output);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
49
core/mountparser.h
Executable file
49
core/mountparser.h
Executable file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecoremountparser
|
||||
#define headerfilecoremountparser
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "log.h"
|
||||
#include "mount.h"
|
||||
#include "error.h"
|
||||
#include "item.h"
|
||||
|
||||
|
||||
|
||||
|
||||
class MountParser
|
||||
{
|
||||
public:
|
||||
|
||||
Error Parse(const std::string & input, std::map<long, Mount> & output);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
bool IsWhite(int c);
|
||||
void SkipWhite();
|
||||
void SkipLine();
|
||||
void ReadWord(std::string & res);
|
||||
void ReadMountType();
|
||||
void ReadMountPoint();
|
||||
void ReadRow(std::map<long, Mount> & output);
|
||||
|
||||
const char * pinput;
|
||||
std::string temp;
|
||||
Mount::Type mount_type;
|
||||
Item * pdir;
|
||||
Error err;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
81
core/mounts.cpp
Executable file
81
core/mounts.cpp
Executable file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mounts.h"
|
||||
#include "data.h"
|
||||
|
||||
|
||||
void Mounts::ReadMounts()
|
||||
{
|
||||
MountParser mp;
|
||||
|
||||
// !! tymczasowo - bedzie odczyt z bazy z /etc/fstab
|
||||
std::string temp = "thread /forum";
|
||||
|
||||
Error err = mp.Parse(temp, mount_table);
|
||||
|
||||
if( err != Error::ok )
|
||||
{
|
||||
log << log1 << "M: some problems with mountpoints (mountpoints table will be empty)" << logend;
|
||||
mount_table.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Mount Mounts::GetCurrentMountPoint()
|
||||
{
|
||||
return current_dir;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Mounts::MountCmsForRoot()
|
||||
{
|
||||
current_dir.type = Mount::cms;
|
||||
|
||||
Item * proot = data.dirs.GetRootDir();
|
||||
|
||||
if( proot )
|
||||
current_dir.dir_id = proot->id;
|
||||
else
|
||||
{
|
||||
current_dir.dir_id = -1;
|
||||
log << log1 << "M: there is no a root dir" << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Mounts::CalculateCurrentMountType()
|
||||
{
|
||||
std::vector<Item*>::reverse_iterator i;
|
||||
|
||||
|
||||
for(i = request.dir_table.rbegin() ; i!=request.dir_table.rend() ; ++i)
|
||||
{
|
||||
std::map<long, Mount>::iterator m = mount_table.find( (*i)->id );
|
||||
|
||||
if( m != mount_table.end() )
|
||||
{
|
||||
current_dir = m->second;
|
||||
log << log2 << "M: current mount point is: " << current_dir.TypeToStr() << logend;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// we assume that 'cms' mount point is used
|
||||
MountCmsForRoot();
|
||||
log << log2 << "M: current mount point is: cms (default)" << logend;
|
||||
}
|
45
core/mounts.h
Executable file
45
core/mounts.h
Executable file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef headerfilecoremounts
|
||||
#define headerfilecoremounts
|
||||
|
||||
|
||||
#include <map>
|
||||
#include "mount.h"
|
||||
#include "request.h"
|
||||
#include "log.h"
|
||||
#include "mountparser.h"
|
||||
|
||||
|
||||
|
||||
class Mounts
|
||||
{
|
||||
public:
|
||||
|
||||
void ReadMounts();
|
||||
|
||||
void CalculateCurrentMountType();
|
||||
Mount GetCurrentMountPoint();
|
||||
void MountCmsForRoot();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Mount current_dir;
|
||||
|
||||
// dir_id, mount_point
|
||||
std::map<long, Mount> mount_table;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
@@ -100,6 +100,7 @@ bool RequestController::Init()
|
||||
data.users.ReadUsers();
|
||||
data.groups.ReadGroups();
|
||||
data.functions.ReadFunctions();
|
||||
data.mounts.ReadMounts();
|
||||
//
|
||||
|
||||
if( !content.Init() )
|
||||
@@ -150,6 +151,7 @@ void RequestController::Loop()
|
||||
request.session->CheckTimers();
|
||||
|
||||
function_parser.Parse();
|
||||
data.mounts.CalculateCurrentMountType();
|
||||
|
||||
content.Make();
|
||||
}
|
||||
|
Reference in New Issue
Block a user