mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 07:42:17 +02:00
- Fixed bug (Trac #49) display of user's grant matrix not refreshed properly. Actually it was not a display issue but the cache was not flushed at the right time and the flush was just loading more entries in the cache without clearing the current ones.
SVN:trunk[219]
This commit is contained in:
@@ -18,6 +18,25 @@ define('ADMIN_PROFILE_ID', 1);
|
|||||||
|
|
||||||
class UserRightsBaseClass extends cmdbAbstractObject
|
class UserRightsBaseClass extends cmdbAbstractObject
|
||||||
{
|
{
|
||||||
|
// Whenever something changes, reload the privileges
|
||||||
|
|
||||||
|
public function DBInsertTracked(CMDBChange $oChange)
|
||||||
|
{
|
||||||
|
parent::DBInsertTracked($oChange);
|
||||||
|
UserRights::FlushPrivileges();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function DBUpdateTracked(CMDBChange $oChange)
|
||||||
|
{
|
||||||
|
parent::DBUpdateTracked($oChange);
|
||||||
|
UserRights::FlushPrivileges();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function DBDeleteTracked(CMDBChange $oChange)
|
||||||
|
{
|
||||||
|
parent::DBDeleteTracked($oChange);
|
||||||
|
UserRights::FlushPrivileges();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -131,9 +150,6 @@ class URP_Users extends UserRightsBaseClass
|
|||||||
|
|
||||||
function DisplayBareRelations(web_page $oPage)
|
function DisplayBareRelations(web_page $oPage)
|
||||||
{
|
{
|
||||||
// We may have just added a user, then we have to reset any existing cache
|
|
||||||
UserRights::FlushPrivileges();
|
|
||||||
|
|
||||||
parent::DisplayBareRelations($oPage);
|
parent::DisplayBareRelations($oPage);
|
||||||
|
|
||||||
$oPage->SetCurrentTabContainer('Related Objects');
|
$oPage->SetCurrentTabContainer('Related Objects');
|
||||||
@@ -258,9 +274,6 @@ class URP_Profiles extends UserRightsBaseClass
|
|||||||
|
|
||||||
function DisplayBareRelations(web_page $oPage)
|
function DisplayBareRelations(web_page $oPage)
|
||||||
{
|
{
|
||||||
// We may have just added a user, then we have to reset any existing cache
|
|
||||||
UserRights::FlushPrivileges();
|
|
||||||
|
|
||||||
parent::DisplayBareRelations($oPage);
|
parent::DisplayBareRelations($oPage);
|
||||||
|
|
||||||
$oPage->SetCurrentTabContainer('Related Objects');
|
$oPage->SetCurrentTabContainer('Related Objects');
|
||||||
@@ -851,6 +864,8 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
// Could be loaded in a shared memory (?)
|
// Could be loaded in a shared memory (?)
|
||||||
|
|
||||||
$oUserSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_Users"));
|
$oUserSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_Users"));
|
||||||
|
$this->m_aUsers = array();
|
||||||
|
$this->m_aLogin2UserId = array();
|
||||||
while ($oUser = $oUserSet->Fetch())
|
while ($oUser = $oUserSet->Fetch())
|
||||||
{
|
{
|
||||||
$this->m_aUsers[$oUser->GetKey()] = $oUser;
|
$this->m_aUsers[$oUser->GetKey()] = $oUser;
|
||||||
@@ -858,24 +873,29 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
}
|
}
|
||||||
|
|
||||||
$oDimensionSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_Dimensions"));
|
$oDimensionSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_Dimensions"));
|
||||||
|
$this->m_aDimensions = array();
|
||||||
while ($oDimension = $oDimensionSet->Fetch())
|
while ($oDimension = $oDimensionSet->Fetch())
|
||||||
{
|
{
|
||||||
$this->m_aDimensions[$oDimension->GetKey()] = $oDimension;
|
$this->m_aDimensions[$oDimension->GetKey()] = $oDimension;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oClassProjSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_ClassProjection"));
|
$oClassProjSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_ClassProjection"));
|
||||||
|
$this->m_aClassProjs = array();
|
||||||
while ($oClassProj = $oClassProjSet->Fetch())
|
while ($oClassProj = $oClassProjSet->Fetch())
|
||||||
{
|
{
|
||||||
$this->m_aClassProjs[$oClassProj->Get('class')][$oClassProj->Get('dimensionid')] = $oClassProj;
|
$this->m_aClassProjs[$oClassProj->Get('class')][$oClassProj->Get('dimensionid')] = $oClassProj;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oProfileSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_Profiles"));
|
$oProfileSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_Profiles"));
|
||||||
|
$this->m_aProfiles = array();
|
||||||
while ($oProfile = $oProfileSet->Fetch())
|
while ($oProfile = $oProfileSet->Fetch())
|
||||||
{
|
{
|
||||||
$this->m_aProfiles[$oProfile->GetKey()] = $oProfile;
|
$this->m_aProfiles[$oProfile->GetKey()] = $oProfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oUserProfileSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_UserProfile"));
|
$oUserProfileSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_UserProfile"));
|
||||||
|
$this->m_aUserProfiles = array();
|
||||||
|
$this->m_aAdmins = array();
|
||||||
while ($oUserProfile = $oUserProfileSet->Fetch())
|
while ($oUserProfile = $oUserProfileSet->Fetch())
|
||||||
{
|
{
|
||||||
$this->m_aUserProfiles[$oUserProfile->Get('userid')][$oUserProfile->Get('profileid')] = $oUserProfile;
|
$this->m_aUserProfiles[$oUserProfile->Get('userid')][$oUserProfile->Get('profileid')] = $oUserProfile;
|
||||||
@@ -886,6 +906,7 @@ class UserRightsProfile extends UserRightsAddOnAPI
|
|||||||
}
|
}
|
||||||
|
|
||||||
$oProProSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_ProfileProjection"));
|
$oProProSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT URP_ProfileProjection"));
|
||||||
|
$this->m_aProPros = array();
|
||||||
while ($oProPro = $oProProSet->Fetch())
|
while ($oProPro = $oProProSet->Fetch())
|
||||||
{
|
{
|
||||||
$this->m_aProPros[$oProPro->Get('profileid')][$oProPro->Get('dimensionid')] = $oProPro;
|
$this->m_aProPros[$oProPro->Get('profileid')][$oProPro->Get('dimensionid')] = $oProPro;
|
||||||
|
|||||||
Reference in New Issue
Block a user