diff --git a/addons/userrights/userrightsmatrix.class.inc.php b/addons/userrights/userrightsmatrix.class.inc.php index 75becda13..8bbe15cc8 100644 --- a/addons/userrights/userrightsmatrix.class.inc.php +++ b/addons/userrights/userrightsmatrix.class.inc.php @@ -312,7 +312,7 @@ class UserRightsMatrix extends UserRightsAddOnAPI $oLogin = $oSet->Fetch(); if ($oLogin->Get('password') == $sPassword) { - return true; + return $oLogin->Get('userid'); } // todo: throw an exception? return false; @@ -324,7 +324,7 @@ class UserRightsMatrix extends UserRightsAddOnAPI return $oNullFilter; } - public function IsActionAllowed($sUserName, $sClass, $iActionCode, dbObjectSet $aInstances) + public function IsActionAllowed($iUserId, $sClass, $iActionCode, dbObjectSet $aInstances) { if (!array_key_exists($iActionCode, self::$m_aActionCodes)) { @@ -332,7 +332,7 @@ class UserRightsMatrix extends UserRightsAddOnAPI } $sAction = self::$m_aActionCodes[$iActionCode]; - $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixClassGrant WHERE class = '$sClass' AND action = '$sAction' AND login = '$sUserName'")); + $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixClassGrant WHERE class = '$sClass' AND action = '$sAction' AND userid = '$iUserId'")); if ($oSet->Count() < 1) { return UR_ALLOWED_NO; @@ -352,7 +352,7 @@ class UserRightsMatrix extends UserRightsAddOnAPI return $iRetCode; } - public function IsActionAllowedOnAttribute($sUserName, $sClass, $sAttCode, $iActionCode, dbObjectSet $aInstances) + public function IsActionAllowedOnAttribute($iUserId, $sClass, $sAttCode, $iActionCode, dbObjectSet $aInstances) { if (!array_key_exists($iActionCode, self::$m_aActionCodes)) { @@ -360,7 +360,7 @@ class UserRightsMatrix extends UserRightsAddOnAPI } $sAction = self::$m_aActionCodes[$iActionCode]; - $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixAttributeGrant WHERE UserRightsMatrixAttributeGrant.class = '$sClass' AND UserRightsMatrixAttributeGrant.attcode = '$sAttCode' AND UserRightsMatrixAttributeGrant.action = '$sAction' AND UserRightsMatrixAttributeGrant.login = '$sUserName'")); + $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixAttributeGrant WHERE class = '$sClass' AND attcode = '$sAttCode' AND action = '$sAction' AND userid = '$iUserId'")); if ($oSet->Count() < 1) { return UR_ALLOWED_NO; @@ -380,9 +380,9 @@ class UserRightsMatrix extends UserRightsAddOnAPI return $iRetCode; } - public function IsStimulusAllowed($sUserName, $sClass, $sStimulusCode, dbObjectSet $aInstances) + public function IsStimulusAllowed($iUserId, $sClass, $sStimulusCode, dbObjectSet $aInstances) { - $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixClassStimulusGrant WHERE class = '$sClass' AND stimulus = '$sStimulusCode' AND login = '$sUserName'")); + $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixClassStimulusGrant WHERE class = '$sClass' AND stimulus = '$sStimulusCode' AND userid = '$iUserId'")); if ($oSet->Count() < 1) { return UR_ALLOWED_NO; diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index d29008dd2..3bd6401a5 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -142,7 +142,7 @@ abstract class cmdbAbstractObject extends CMDBObject if (!empty($sTemplate)) { $oTemplate = new DisplayTemplate($sTemplate); - $oTemplate->Render($oPage, array('class'=> get_class($this),'pkey'=> $this->GetKey(), 'name' => $this->GetName())); + $oTemplate->Render($oPage, array('class_name'=> MetaModel::GetName(get_class($this)),'class'=> get_class($this),'pkey'=> $this->GetKey(), 'name' => $this->GetName())); } else { @@ -152,7 +152,7 @@ abstract class cmdbAbstractObject extends CMDBObject $oSingletonFilter->AddCondition('pkey', array($this->GetKey())); $oBlock = new MenuBlock($oSingletonFilter, 'popup', false); $oBlock->Display($oPage, -1); - $oPage->add("
| '; + $sColspan = 'colspan="2"'; + $sHtml .= ' | |
| '.$oSet->Count().' object(s) | '; $sHtml .= $oMenuBlock->GetRenderContent($oPage, $sLinkageAttribute); $sHtml .= ' |
| '; + $sHtml .= " | |
| "; $sHtml .= $oPage->GetTable($aAttribs, $aValues, array('class'=>$sClassName, 'filter'=>$oSet->GetFilter()->serialize(), 'preview' => true)); $sHtml .= ' |
diff --git a/business/templates/application.html b/business/templates/application.html
index 4e3c7575e..f934b7b48 100644
--- a/business/templates/application.html
+++ b/business/templates/application.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/change.html b/business/templates/change.html
index 694b26fd6..f2bcd67d7 100644
--- a/business/templates/change.html
+++ b/business/templates/change.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/contract.html b/business/templates/contract.html
index 574c6e37e..110fcdb0e 100644
--- a/business/templates/contract.html
+++ b/business/templates/contract.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/default.html b/business/templates/default.html
index 238a714d8..564b009b5 100644
--- a/business/templates/default.html
+++ b/business/templates/default.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/document.html b/business/templates/document.html
index 470559e8f..cd40cfe78 100644
--- a/business/templates/document.html
+++ b/business/templates/document.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/group.html b/business/templates/group.html
index 11bc83845..fca5fb154 100644
--- a/business/templates/group.html
+++ b/business/templates/group.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/interface.html b/business/templates/interface.html
index 3f1fe7f95..ffa8c7495 100644
--- a/business/templates/interface.html
+++ b/business/templates/interface.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/knownError.html b/business/templates/knownError.html
index 3c321384d..75bcc9eaf 100644
--- a/business/templates/knownError.html
+++ b/business/templates/knownError.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/network.device.html b/business/templates/network.device.html
index cb3a32385..01085e2ec 100644
--- a/business/templates/network.device.html
+++ b/business/templates/network.device.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/pc.html b/business/templates/pc.html
index 55597a4ac..9323a913d 100644
--- a/business/templates/pc.html
+++ b/business/templates/pc.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/person.html b/business/templates/person.html
index 9bc09ad33..567f7b543 100644
--- a/business/templates/person.html
+++ b/business/templates/person.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/server.html b/business/templates/server.html
index f6f5793ed..98185836b 100644
--- a/business/templates/server.html
+++ b/business/templates/server.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/service.html b/business/templates/service.html
index 747ab187a..7e6443eba 100644
--- a/business/templates/service.html
+++ b/business/templates/service.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/software.html b/business/templates/software.html
index ee51b9651..3f690daad 100644
--- a/business/templates/software.html
+++ b/business/templates/software.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/team.html b/business/templates/team.html
index 05e0ec2d2..7e1e5cd6e 100644
--- a/business/templates/team.html
+++ b/business/templates/team.html
@@ -1,6 +1,6 @@
diff --git a/business/templates/ticket.html b/business/templates/ticket.html
index 1c034cc7b..425c92840 100644
--- a/business/templates/ticket.html
+++ b/business/templates/ticket.html
@@ -1,6 +1,6 @@
diff --git a/core/userrights.class.inc.php b/core/userrights.class.inc.php
index b62c8a042..01428ae73 100644
--- a/core/userrights.class.inc.php
+++ b/core/userrights.class.inc.php
@@ -176,7 +176,7 @@ class UserRights
public static function GetFilter($sClass)
{
- if (!MetaModel::HasCategory($sClass, 'bizModel')) return new DBObjectSearch($sClass);
+ if (!MetaModel::HasCategory($sClass, 'bizmodel')) return new DBObjectSearch($sClass);
if (!self::CheckLogin()) return false;
return self::$m_oAddOn->GetFilter(self::$m_iUserId, $sClass);
@@ -184,7 +184,7 @@ class UserRights
public static function IsActionAllowed($sClass, $iActionCode, dbObjectSet $aInstances)
{
- if (!MetaModel::HasCategory($sClass, 'bizModel')) return true;
+ if (!MetaModel::HasCategory($sClass, 'bizmodel')) return true;
if (!self::CheckLogin()) return false;
return self::$m_oAddOn->IsActionAllowed(self::$m_iUserId, $sClass, $iActionCode, $aInstances);
@@ -192,7 +192,7 @@ class UserRights
public static function IsStimulusAllowed($sClass, $sStimulusCode, dbObjectSet $aInstances)
{
- if (!MetaModel::HasCategory($sClass, 'bizModel')) return true;
+ if (!MetaModel::HasCategory($sClass, 'bizmodel')) return true;
if (!self::CheckLogin()) return false;
return self::$m_oAddOn->IsStimulusAllowed(self::$m_iUserId, $sClass, $sStimulusCode, $aInstances);
@@ -200,7 +200,7 @@ class UserRights
public static function IsActionAllowedOnAttribute($sClass, $sAttCode, $iActionCode, dbObjectSet $aInstances)
{
- if (!MetaModel::HasCategory($sClass, 'bizModel')) return true;
+ if (!MetaModel::HasCategory($sClass, 'bizmodel')) return true;
if (!self::CheckLogin()) return false;
return self::$m_oAddOn->IsActionAllowedOnAttribute(self::$m_iUserId, $sClass, $sAttCode, $iActionCode, $aInstances);
diff --git a/pages/UI.php b/pages/UI.php
index 3b77f4ce7..48bd6081b 100644
--- a/pages/UI.php
+++ b/pages/UI.php
@@ -243,22 +243,17 @@ switch($operation)
$oP->add_linked_script("../js/jquery.blockUI.js");
$oWizard = new UIWizard($oP, $sClass, $sStateCode);
$sStateCode = $oWizard->GetTargetState(); // Will computes the default state if none was supplied
+ $sClassLabel = MetaModel::GetName($sClass);
+ $oP->p("