Files
winix/functions/privchanger.h
Tomasz Sowa a589e5a090 added: TextStream a class similar to std::ostringstream
but with a Clear() method
       the dynamic allocated buffer can be easily reused
added: DbTextStream a special version of a stream
       used to create a database string query
       everything is escaped by default
added: DbBase a base class with some basic methods for communicating
       with the database
added: DbConn a class for managing connection to the database
changed: some refactoring in Db class       



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@655 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-09-18 00:51:12 +00:00

58 lines
1.3 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 headerfilecmslucontentprivchanger
#define headerfilecmslucontentprivchanger
#include "core/request.h"
#include "core/system.h"
#include "db/db.h"
class PrivChanger
{
public:
bool CheckAccess();
void Change(bool change_owner_, bool change_priv_);
void SetRequest(Request * prequest);
void SetSystem(System * psystem);
void SetDb(Db * pdb);
private:
Request * request;
System * system;
Db * db;
long user_id_file, group_id_file, user_id_dir, group_id_dir;
int priv_file, priv_dir;
bool subdirectories;
bool change_owner, change_priv;
bool ChangeOwner(Item & item, long user_id, long group_id);
bool ChangePrivileges(Item & item, int privileges);
void ChangePriv(Item & item, long user_id, long group_id, int privileges);
void PrivLogStart(const char * what, long user, long group, int priv);
void PrivLog(const char * what, long id, const std::string & url);
void PrivFilesInDir(long parent_id);
void PrivDir(long parent_id);
void ReadPriv(const char * user_in, const char * group_in, const char * priv_in,
long & user_id, long & group_id, int & priv);
void PrivDir();
void PrivOneItem();
};
#endif