constant APP_DUMMY to \RainLoop\Actions::APP_DUMMY

This commit is contained in:
the-djmaze 2022-11-18 09:18:28 +01:00
parent 7da3ba8c61
commit 4a2dcbc1f7
5 changed files with 13 additions and 12 deletions

View file

@ -42,7 +42,7 @@ class DemoAccountPlugin extends \RainLoop\Plugins\AbstractPlugin
{ {
if (!$bAdmin && \is_array($aResult) && empty($aResult['Auth'])) { if (!$bAdmin && \is_array($aResult) && empty($aResult['Auth'])) {
$aResult['DevEmail'] = $this->Config()->Get('plugin', 'email', $aResult['DevEmail']); $aResult['DevEmail'] = $this->Config()->Get('plugin', 'email', $aResult['DevEmail']);
$aResult['DevPassword'] = APP_DUMMY; $aResult['DevPassword'] = '********';
} }
} }

View file

@ -39,6 +39,8 @@ class Actions
const AUTH_SPEC_LOGOUT_TOKEN_KEY = 'smspeclogout'; const AUTH_SPEC_LOGOUT_TOKEN_KEY = 'smspeclogout';
const AUTH_SPEC_LOGOUT_CUSTOM_MSG_KEY = 'smspeclogoutcmk'; const AUTH_SPEC_LOGOUT_CUSTOM_MSG_KEY = 'smspeclogoutcmk';
const APP_DUMMY = '********';
/** /**
* @var \MailSo\Base\Http * @var \MailSo\Base\Http
*/ */
@ -650,7 +652,7 @@ class Actions
$aResult['ContactsPdoDsn'] = (string)$oConfig->Get('contacts', 'pdo_dsn', ''); $aResult['ContactsPdoDsn'] = (string)$oConfig->Get('contacts', 'pdo_dsn', '');
$aResult['ContactsPdoType'] = (string)$oConfig->Get('contacts', 'type', ''); $aResult['ContactsPdoType'] = (string)$oConfig->Get('contacts', 'type', '');
$aResult['ContactsPdoUser'] = (string)$oConfig->Get('contacts', 'pdo_user', ''); $aResult['ContactsPdoUser'] = (string)$oConfig->Get('contacts', 'pdo_user', '');
$aResult['ContactsPdoPassword'] = (string)APP_DUMMY; $aResult['ContactsPdoPassword'] = static::APP_DUMMY;
$aResult['FaviconUrl'] = $oConfig->Get('webmail', 'favicon_url', ''); $aResult['FaviconUrl'] = $oConfig->Get('webmail', 'favicon_url', '');
@ -743,7 +745,7 @@ class Actions
$aResult['ContactsSyncMode'] = isset($mData['Mode']) ? $mData['Mode'] : 0; $aResult['ContactsSyncMode'] = isset($mData['Mode']) ? $mData['Mode'] : 0;
$aResult['ContactsSyncUrl'] = isset($mData['Url']) ? \trim($mData['Url']) : ''; $aResult['ContactsSyncUrl'] = isset($mData['Url']) ? \trim($mData['Url']) : '';
$aResult['ContactsSyncUser'] = isset($mData['User']) ? \trim($mData['User']) : ''; $aResult['ContactsSyncUser'] = isset($mData['User']) ? \trim($mData['User']) : '';
$aResult['ContactsSyncPassword'] = APP_DUMMY; $aResult['ContactsSyncPassword'] = static::APP_DUMMY;
} }
} }

View file

@ -22,8 +22,9 @@ trait Contacts
$bResult = $this->setContactsSyncData($oAccount, array( $bResult = $this->setContactsSyncData($oAccount, array(
'Mode' => \intval($this->GetActionParam('Mode', '0')), 'Mode' => \intval($this->GetActionParam('Mode', '0')),
'User' => $this->GetActionParam('User', ''), 'User' => $this->GetActionParam('User', ''),
'Password' => APP_DUMMY === $sPassword && isset($mData['Password']) 'Password' => static::APP_DUMMY === $sPassword
? $mData['Password'] : (APP_DUMMY === $sPassword ? '' : $sPassword), ? (isset($mData['Password']) ? $mData['Password'] : '')
: $sPassword,
'Url' => $this->GetActionParam('Url', '') 'Url' => $this->GetActionParam('Url', '')
)); ));

View file

@ -567,7 +567,7 @@ class ActionsAdmin extends Actions
if ($oItem) { if ($oItem) {
if ($oItem instanceof \RainLoop\Plugins\Property) { if ($oItem instanceof \RainLoop\Plugins\Property) {
if (PluginPropertyType::PASSWORD === $oItem->Type()) { if (PluginPropertyType::PASSWORD === $oItem->Type()) {
$oItem->SetValue(APP_DUMMY); $oItem->SetValue(static::APP_DUMMY);
} else { } else {
$oItem->SetValue($oConfig->Get('plugin', $oItem->Name(), '')); $oItem->SetValue($oConfig->Get('plugin', $oItem->Name(), ''));
} }
@ -576,7 +576,7 @@ class ActionsAdmin extends Actions
foreach ($oItem as $oSubItem) { foreach ($oItem as $oSubItem) {
if ($oSubItem && $oSubItem instanceof \RainLoop\Plugins\Property) { if ($oSubItem && $oSubItem instanceof \RainLoop\Plugins\Property) {
if (PluginPropertyType::PASSWORD === $oSubItem->Type()) { if (PluginPropertyType::PASSWORD === $oSubItem->Type()) {
$oSubItem->SetValue(APP_DUMMY); $oSubItem->SetValue(static::APP_DUMMY);
} else { } else {
$oSubItem->SetValue($oConfig->Get('plugin', $oSubItem->Name(), '')); $oSubItem->SetValue($oConfig->Get('plugin', $oSubItem->Name(), ''));
} }
@ -614,7 +614,7 @@ class ActionsAdmin extends Actions
{ {
$sKey = $oItem->Name(); $sKey = $oItem->Name();
$sValue = $aSettings[$sKey] ?? $oConfig->Get('plugin', $sKey); $sValue = $aSettings[$sKey] ?? $oConfig->Get('plugin', $sKey);
if (PluginPropertyType::PASSWORD !== $oItem->Type() || APP_DUMMY !== $sValue) if (PluginPropertyType::PASSWORD !== $oItem->Type() || static::APP_DUMMY !== $sValue)
{ {
$mResultValue = null; $mResultValue = null;
switch ($oItem->Type()) { switch ($oItem->Type()) {
@ -734,8 +734,8 @@ class ActionsAdmin extends Actions
break; break;
case 'dummy': case 'dummy':
$sValue = (string) $this->GetActionParam($sParamName, APP_DUMMY); $sValue = (string) $this->GetActionParam($sParamName, static::APP_DUMMY);
if (APP_DUMMY !== $sValue) { if (static::APP_DUMMY !== $sValue) {
$oConfig->Set($sConfigSector, $sConfigName, $sValue); $oConfig->Set($sConfigSector, $sConfigName, $sValue);
} }
break; break;

View file

@ -52,8 +52,6 @@ define('APP_VERSION_ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
define('APP_DUMMY', '********');
$sCustomDataPath = ''; $sCustomDataPath = '';
$sCustomConfiguration = ''; $sCustomConfiguration = '';