112 lines
1.5 KiB
C++
Executable File
112 lines
1.5 KiB
C++
Executable File
/*
|
|
* This file is a part of Winix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2010, Tomasz Sowa
|
|
* All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#ifndef headerfilecmslucoreapp
|
|
#define headerfilecmslucoreapp
|
|
|
|
#include <iostream>
|
|
#include <ctime>
|
|
#include <unistd.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/types.h>
|
|
#include <pwd.h>
|
|
#include <grp.h>
|
|
#include <errno.h>
|
|
|
|
#include "config.h"
|
|
#include "system.h"
|
|
#include "mounts.h"
|
|
#include "request.h"
|
|
#include "sessionmanager.h"
|
|
#include "notify.h"
|
|
#include "db.h"
|
|
#include "functions/functions.h"
|
|
#include "templates/templates.h"
|
|
#include "templatesnotify/templatesnotify.h"
|
|
|
|
|
|
|
|
|
|
class App
|
|
{
|
|
public:
|
|
|
|
App();
|
|
|
|
bool Init();
|
|
void Start();
|
|
void Close();
|
|
|
|
|
|
|
|
// configuration read from a config file
|
|
Config config;
|
|
|
|
// current request
|
|
Request request;
|
|
|
|
// users sessions
|
|
SessionManager session_manager;
|
|
|
|
// notifications (by emails)
|
|
Notify notify;
|
|
|
|
// database
|
|
Db db;
|
|
|
|
|
|
|
|
|
|
/*
|
|
model
|
|
*/
|
|
|
|
// file system
|
|
System system;
|
|
|
|
// false at the beginning
|
|
bool stdout_is_closed;
|
|
|
|
|
|
|
|
|
|
/*
|
|
controller
|
|
*/
|
|
|
|
// functions (ls, cat, emacs, ...)
|
|
Functions functions;
|
|
|
|
|
|
/*
|
|
view
|
|
*/
|
|
|
|
Templates templates;
|
|
TemplatesNotify templates_notify;
|
|
|
|
|
|
private:
|
|
bool CreateFCGISocket();
|
|
void ProcessRequest();
|
|
bool BaseUrlRedirect();
|
|
void DeleteAllPluginsData();
|
|
void MakePage();
|
|
void Make();
|
|
void ReadAdditionalInfo();
|
|
void SaveSessionsIfNeeded(); // !! wywalic do managara sesji??
|
|
|
|
// !! dodac do session managera?
|
|
time_t last_sessions_save;
|
|
};
|
|
|
|
#endif
|
|
|
|
|