diff --git a/application/loginwebpage.class.inc.php b/application/loginwebpage.class.inc.php
index 2a1eb406b..4e34b8cf4 100644
--- a/application/loginwebpage.class.inc.php
+++ b/application/loginwebpage.class.inc.php
@@ -237,7 +237,7 @@ class LoginWebPage extends NiceWebPage
}
// This token allows the user to change the password without knowing the previous one
- $sToken = substr(md5(APPROOT.uniqid()), 0, 16);
+ $sToken = bin2hex(random_bytes(32));
$oUser->Set('reset_pwd_token', $sToken);
CMDBObject::SetTrackInfo('Reset password');
$oUser->AllowWrite(true);
diff --git a/core/dbobject.class.php b/core/dbobject.class.php
index 68adf3495..ce7e74775 100644
--- a/core/dbobject.class.php
+++ b/core/dbobject.class.php
@@ -3202,15 +3202,15 @@ abstract class DBObject implements iDisplay
// - TriggerOnObjectMention
$this->ActivateOnMentionTriggers(false);
- $bHasANewExternalKeyValue = false;
+ $bNeedReload = false;
$aHierarchicalKeys = array();
$aDBChanges = array();
foreach ($aChanges as $sAttCode => $valuecurr)
{
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
- if ($oAttDef->IsExternalKey())
+ if ($oAttDef->IsExternalKey() || $oAttDef->IsLinkSet())
{
- $bHasANewExternalKeyValue = true;
+ $bNeedReload = true;
}
if ($oAttDef->IsBasedOnDBColumns())
{
@@ -3368,24 +3368,10 @@ abstract class DBObject implements iDisplay
$this->m_aModifiedAtt = array();
try {
- // - TriggerOnObjectUpdate
- $aParams = array('class_list' => MetaModel::EnumParentClasses($sClass, ENUM_PARENT_CLASSES_ALL));
- $oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT TriggerOnObjectUpdate AS t WHERE t.target_class IN (:class_list)"),
- array(), $aParams);
- while ($oTrigger = $oSet->Fetch()) {
- /** @var \TriggerOnObjectUpdate $oTrigger */
- try {
- $oTrigger->DoActivate($this->ToArgs('this'));
- }
- catch (Exception $e) {
- utils::EnrichRaisedException($oTrigger, $e);
- }
- }
-
$this->AfterUpdate();
// Reload to get the external attributes
- if ($bHasANewExternalKeyValue) {
+ if ($bNeedReload) {
$this->Reload(true /* AllowAllData */);
} else {
// Reset original values although the object has not been reloaded
@@ -3398,6 +3384,20 @@ abstract class DBObject implements iDisplay
}
}
}
+
+ // - TriggerOnObjectUpdate
+ $aParams = array('class_list' => MetaModel::EnumParentClasses($sClass, ENUM_PARENT_CLASSES_ALL));
+ $oSet = new DBObjectSet(DBObjectSearch::FromOQL('SELECT TriggerOnObjectUpdate AS t WHERE t.target_class IN (:class_list)'),
+ array(), $aParams);
+ while ($oTrigger = $oSet->Fetch()) {
+ /** @var \TriggerOnObjectUpdate $oTrigger */
+ try {
+ $oTrigger->DoActivate($this->ToArgs('this'));
+ }
+ catch (Exception $e) {
+ utils::EnrichRaisedException($oTrigger, $e);
+ }
+ }
}
catch (Exception $e)
{
diff --git a/datamodels/2.x/itop-oauth-client/datamodel.itop-oauth-client.xml b/datamodels/2.x/itop-oauth-client/datamodel.itop-oauth-client.xml
index df80f7eb2..b774720b8 100644
--- a/datamodels/2.x/itop-oauth-client/datamodel.itop-oauth-client.xml
+++ b/datamodels/2.x/itop-oauth-client/datamodel.itop-oauth-client.xml
@@ -134,15 +134,14 @@
$sLabel = Dict::S('itop-oauth-client:UsedForSMTP');
$sTestLabel = Dict::S('itop-oauth-client:TestSMTP');
$sTestURL = utils::GetAbsoluteUrlAppRoot().'setup/email.test.php';
- $sLabel = Dict::S('itop-oauth-client:UsedForSMTP')." $sTestLabel";
+ $sLabel = Dict::S('itop-oauth-client:UsedForSMTP')." $sTestLabel";
$sTitle = '';
- $aTags['oauth-message'] = ['title' => $sTitle, 'css_classes' => 'ibo-object-details--tag--oauth-message', 'decoration_classes' => 'far fa-envelope', 'label' => $sLabel];
+ $aTags['oauth-message'] = ['title' => $sTitle, 'css_classes' => 'ibo-object-details--tag--oauth-message', 'decoration_classes' => 'fas fa-envelope', 'label' => $sLabel];
}
}
foreach ($aTags as $sIconId => $aIconData) {
- $sTagTooltipContent = utils::EscapeHtml($aIconData['title']);
$aHeaderBlocks['subtitle'][static::HEADER_BLOCKS_SUBTITLE_TAG_PREFIX.$sIconId] = new Combodo\iTop\Application\UI\Base\Component\Html\Html(<<{$aIconData['label']}
+ {$aIconData['label']}
HTML
);
}