58 lines
1.3 KiB
C++
Executable File
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 "core/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);
|
|
bool 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
|