function response($oAlert) { global $gConf; $iProfileId = $oAlert->iObject; if (!$iProfileId || $oAlert->sUnit != 'profile' || 'delete' != $oAlert->sAction && 'edit' != $oAlert->sAction) { return; } $sUsername = '******' == $oAlert->sAction ? $oAlert->aExtras['profile_info']['NickName'] : getUsername($iProfileId); if ('edit' == $oAlert->sAction && $oAlert->aExtras['OldProfileInfo']['NickName'] == $sUsername) { return; } $oDb = new DbForum(); $sOldUsername = '******' == $oAlert->sAction ? $sUsername : $oAlert->aExtras['OldProfileInfo']['NickName']; $sNewUsername = '******' == $oAlert->sAction ? $gConf['anonymous'] : $sUsername; $oDb->renameUser($sOldUsername, $sNewUsername); }