changed: some refactoring in System: in IsMemberOfGroup method
changed: some log messages at startup (about non existing empty group for uploads directory) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1001 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -742,7 +742,7 @@ int System::NewDirPrivileges()
|
||||
|
||||
bool System::CanUseHtml(long user_id)
|
||||
{
|
||||
return IsMemberOfGroup(user_id, L"allow_html");
|
||||
return IsSuperUser(user_id) || IsMemberOfGroup(user_id, L"allow_html");
|
||||
}
|
||||
|
||||
|
||||
@@ -755,11 +755,22 @@ bool System::CanUseBBCode(long user_id)
|
||||
|
||||
bool System::CanUseRaw(long user_id)
|
||||
{
|
||||
return IsMemberOfGroup(user_id, L"allow_raw");
|
||||
return IsSuperUser(user_id) || IsMemberOfGroup(user_id, L"allow_raw");
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool System::IsSuperUser(long user_id)
|
||||
{
|
||||
User * puser = users.GetUser(user_id);
|
||||
|
||||
if( !puser )
|
||||
return false;
|
||||
|
||||
return puser->super_user;
|
||||
}
|
||||
|
||||
|
||||
bool System::IsMemberOfGroup(long user_id, const wchar_t * group_name)
|
||||
{
|
||||
User * puser = users.GetUser(user_id);
|
||||
@@ -767,9 +778,6 @@ bool System::IsMemberOfGroup(long user_id, const wchar_t * group_name)
|
||||
if( !puser )
|
||||
return false;
|
||||
|
||||
if( puser->super_user )
|
||||
return true; // !! ?? zakladamy ze administrator jest czlonkiem wszystkich grup? dlaczego?
|
||||
|
||||
long group = groups.GetGroupId(group_name);
|
||||
|
||||
if( group == -1 )
|
||||
|
Reference in New Issue
Block a user