diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 06d766fec..0a2eb1f35 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -242,7 +242,7 @@ class Context else { $site_module_info = new stdClass; - $site_module_info->domain = $_SERVER['HTTP_HOST']; + $site_module_info->domain = Rhymix\Framework\URL::getCurrentDomain(); $site_module_info->security = RX_SSL ? 'always' : 'none'; $site_module_info->settings = new stdClass; $site_module_info->is_default_replaced = true; diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index b23d108f5..5b910d223 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -147,7 +147,11 @@ class ModuleHandler extends Handler return true; case 'display': - // pass + $site_module_info->domain_srl = -1; + $site_module_info->domain = Rhymix\Framework\URL::getCurrentDomain(); + $site_module_info->is_default_domain = 'N'; + $site_module_info->is_default_replaced = true; + Context::set('site_module_info', $site_module_info); } } } @@ -182,8 +186,11 @@ class ModuleHandler extends Handler } } + // Initialize module info. + $module_info = null; + // Get module info from document_srl. - if($this->document_srl) + if($this->document_srl && !preg_match('/Admin/', $this->act)) { $module_info = $this->_checkDocumentSrl(); if ($module_info === false) @@ -191,23 +198,21 @@ class ModuleHandler extends Handler return false; } } - else - { - $module_info = null; - } // Get module info from mid. if(!$module_info && $this->mid) { $module_info = ModuleModel::getModuleInfoByMid($this->mid); - if($module_info && isset($module_info->domain_srl) && $module_info->domain_srl > -1) + } + + // If the module does not belong to the current domain, throw a 404. + if($module_info && isset($module_info->domain_srl) && $module_info->domain_srl > -1) + { + if($module_info->domain_srl != $site_module_info->domain_srl) { - if($module_info->domain_srl != $site_module_info->domain_srl) - { - $this->error = 'msg_module_is_not_exists'; - $this->httpStatusCode = 404; - return true; - } + $this->error = 'msg_module_is_not_exists'; + $this->httpStatusCode = 404; + return true; } } @@ -783,6 +788,14 @@ class ModuleHandler extends Handler } } + // Redirect if a member action is requested with an unnecessary document_srl. (For backward compatibility) + if(preg_match('/^disp(Member|Communication)/', $this->act)) + { + Context::setCacheControl(0); + header('Location: ' . getNotEncodedUrl('document_srl', null), true, 301); + return false; + } + // Remove module info if a different module has already been selected for the current request. if($this->module && $module_info->module !== $this->module) { diff --git a/common/constants.php b/common/constants.php index 9a11bed4a..341009623 100644 --- a/common/constants.php +++ b/common/constants.php @@ -3,7 +3,7 @@ /** * RX_VERSION is the version number of the Rhymix CMS. */ -define('RX_VERSION', '2.1.26'); +define('RX_VERSION', '2.1.27'); /** * RX_MICROTIME is the startup time of the current script, in microseconds since the Unix epoch. diff --git a/common/framework/parsers/DBQueryParser.php b/common/framework/parsers/DBQueryParser.php index ecbf7d958..898e90a41 100644 --- a/common/framework/parsers/DBQueryParser.php +++ b/common/framework/parsers/DBQueryParser.php @@ -175,9 +175,10 @@ class DBQueryParser extends BaseParser foreach ($xml->groups->children() as $tag) { $name = $tag->getName(); + $ifvar = trim($tag['if'] ?? '') ?: null; if ($name === 'group') { - $query->groupby->columns[] = trim($tag['column'] ?? ''); + $query->groupby->columns[] = [trim($tag['column'] ?? ''), $ifvar]; } elseif ($name === 'having') { diff --git a/common/framework/parsers/dbquery/Query.php b/common/framework/parsers/dbquery/Query.php index 6a0a71170..34e680bef 100644 --- a/common/framework/parsers/dbquery/Query.php +++ b/common/framework/parsers/dbquery/Query.php @@ -222,6 +222,14 @@ class Query extends VariableBase $columns = array(); foreach ($this->groupby->columns as $column_name) { + if (is_array($column_name)) + { + list($column_name, $ifvar) = $column_name; + if ($ifvar && empty($this->_args[$ifvar])) + { + continue; + } + } if (self::isValidColumnName($column_name)) { $columns[] = self::quoteName($column_name); diff --git a/common/framework/parsers/template/TemplateParser_v1.php b/common/framework/parsers/template/TemplateParser_v1.php index 5c97346d3..a2ab34197 100644 --- a/common/framework/parsers/template/TemplateParser_v1.php +++ b/common/framework/parsers/template/TemplateParser_v1.php @@ -278,7 +278,7 @@ class TemplateParser_v1 $skip = sprintf('(?!%s)', implode('|', ['marquee'])); $split_regex = "@([^<>{}\"]+|.*?|{[^}]*}|\"(?>'.*?'|.)*?\"|.)*?>)@s"; - $nodes = preg_split($split_regex, $content, -1, PREG_SPLIT_DELIM_CAPTURE); + $nodes = preg_split($split_regex, $content, -1, PREG_SPLIT_DELIM_CAPTURE) ?: []; for($idx = 1, $node_len = count($nodes); $idx < $node_len; $idx+=2) { diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php index f078d6d7c..95b693aea 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php @@ -106,7 +106,7 @@ class Swift_Encoder_QpEncoder implements Swift_Encoder * @param Swift_CharacterStream $charStream to use for reading characters * @param Swift_StreamFilter $filter if input should be canonicalized */ - public function __construct(Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null) + public function __construct(Swift_CharacterStream $charStream, ?Swift_StreamFilter $filter = null) { $this->charStream = $charStream; if (!isset(self::$safeMapShare[$this->getSafeMapShareId()])) { diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php index 87f6a0742..3a000523c 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php @@ -56,7 +56,7 @@ interface Swift_KeyCache * * @return Swift_InputByteStream */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $is = null); + public function getInputByteStream($nsKey, $itemKey, ?Swift_InputByteStream $is = null); /** * Get data back out of the cache as a string. diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php index e8fef1c95..44765b768 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php @@ -105,7 +105,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache * * @return Swift_InputByteStream */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) + public function getInputByteStream($nsKey, $itemKey, ?Swift_InputByteStream $writeThrough = null) { $is = clone $this->stream; $is->setKeyCache($this); diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php index 33b6367cb..3e158273f 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php @@ -128,7 +128,7 @@ class Swift_KeyCache_DiskKeyCache implements Swift_KeyCache * * @return Swift_InputByteStream */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) + public function getInputByteStream($nsKey, $itemKey, ?Swift_InputByteStream $writeThrough = null) { $is = clone $this->stream; $is->setKeyCache($this); diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/NullKeyCache.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/NullKeyCache.php index 957b1b2a0..6bddd9ec1 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/NullKeyCache.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/NullKeyCache.php @@ -52,7 +52,7 @@ class Swift_KeyCache_NullKeyCache implements Swift_KeyCache * * @return Swift_InputByteStream */ - public function getInputByteStream($nsKey, $itemKey, Swift_InputByteStream $writeThrough = null) + public function getInputByteStream($nsKey, $itemKey, ?Swift_InputByteStream $writeThrough = null) { } diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php index 03bab481e..8dd3e2bb1 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php @@ -49,7 +49,7 @@ class Swift_KeyCache_SimpleKeyCacheInputStream implements Swift_KeyCache_KeyCach * @param string $bytes * @param Swift_InputByteStream $is optional */ - public function write($bytes, Swift_InputByteStream $is = null) + public function write($bytes, ?Swift_InputByteStream $is = null) { $this->keyCache->setString( $this->nsKey, $this->itemKey, $bytes, Swift_KeyCache::MODE_APPEND diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php index 465ffd878..2c8a5760e 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php @@ -24,7 +24,7 @@ class Swift_Mime_ContentEncoder_QpContentEncoder extends Swift_Encoder_QpEncoder * @param Swift_StreamFilter $filter if canonicalization should occur * @param bool $dotEscape if dot stuffing workaround must be enabled */ - public function __construct(Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null, $dotEscape = false) + public function __construct(Swift_CharacterStream $charStream, ?Swift_StreamFilter $filter = null, $dotEscape = false) { $this->dotEscape = $dotEscape; parent::__construct($charStream, $filter); diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php index 25740d115..66dfeacd3 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php @@ -200,7 +200,7 @@ abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header * * @return string */ - protected function createPhrase(Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder = null, $shorten = false) + protected function createPhrase(Swift_Mime_Header $header, $string, $charset, ?Swift_Mime_HeaderEncoder $encoder = null, $shorten = false) { // Treat token as exactly what was given $phraseStr = $string; diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php index 4fcdff418..fd5b4b20f 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php @@ -42,7 +42,7 @@ class Swift_Mime_Headers_IdentificationHeader extends Swift_Mime_Headers_Abstrac * * @param string $name */ - public function __construct($name, EmailValidator $emailValidator, Swift_AddressEncoder $addressEncoder = null) + public function __construct($name, EmailValidator $emailValidator, ?Swift_AddressEncoder $addressEncoder = null) { $this->setFieldName($name); $this->emailValidator = $emailValidator; diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php index ddd5e8cff..f6e3989c9 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php @@ -39,7 +39,7 @@ class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader * * @param string $name of Header */ - public function __construct($name, Swift_Mime_HeaderEncoder $encoder, EmailValidator $emailValidator, Swift_AddressEncoder $addressEncoder = null) + public function __construct($name, Swift_Mime_HeaderEncoder $encoder, EmailValidator $emailValidator, ?Swift_AddressEncoder $addressEncoder = null) { $this->setFieldName($name); $this->setEncoder($encoder); diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php index 47c15e6c0..30e2096d8 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php @@ -41,7 +41,7 @@ class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_Unstruct * * @param string $name */ - public function __construct($name, Swift_Mime_HeaderEncoder $encoder, Swift_Encoder $paramEncoder = null) + public function __construct($name, Swift_Mime_HeaderEncoder $encoder, ?Swift_Encoder $paramEncoder = null) { parent::__construct($name, $encoder); $this->paramEncoder = $paramEncoder; diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php index 81b421ee7..4261d6865 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php @@ -39,7 +39,7 @@ class Swift_Mime_Headers_PathHeader extends Swift_Mime_Headers_AbstractHeader * * @param string $name */ - public function __construct($name, EmailValidator $emailValidator, Swift_AddressEncoder $addressEncoder = null) + public function __construct($name, EmailValidator $emailValidator, ?Swift_AddressEncoder $addressEncoder = null) { $this->setFieldName($name); $this->emailValidator = $emailValidator; diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php index ab3ce6b19..4e3740310 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php @@ -37,7 +37,7 @@ class Swift_Mime_SimpleHeaderFactory implements Swift_Mime_CharsetObserver * * @param string|null $charset */ - public function __construct(Swift_Mime_HeaderEncoder $encoder, Swift_Encoder $paramEncoder, EmailValidator $emailValidator, $charset = null, Swift_AddressEncoder $addressEncoder = null) + public function __construct(Swift_Mime_HeaderEncoder $encoder, Swift_Encoder $paramEncoder, EmailValidator $emailValidator, $charset = null, ?Swift_AddressEncoder $addressEncoder = null) { $this->encoder = $encoder; $this->paramEncoder = $paramEncoder; @@ -72,7 +72,7 @@ class Swift_Mime_SimpleHeaderFactory implements Swift_Mime_CharsetObserver * * @return Swift_Mime_Header */ - public function createDateHeader($name, DateTimeInterface $dateTime = null) + public function createDateHeader($name, ?DateTimeInterface $dateTime = null) { $header = new Swift_Mime_Headers_DateHeader($name); if (isset($dateTime)) { diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php index 5195bcf48..3af1a3e63 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php @@ -76,7 +76,7 @@ class Swift_Mime_SimpleHeaderSet implements Swift_Mime_CharsetObserver * * @param string $name */ - public function addDateHeader($name, DateTimeInterface $dateTime = null) + public function addDateHeader($name, ?DateTimeInterface $dateTime = null) { $this->storeHeader($name, $this->factory->createDateHeader($name, $dateTime)); } diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/AntiFloodPlugin.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/AntiFloodPlugin.php index 5b1d7deef..a9e75e88b 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/AntiFloodPlugin.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/AntiFloodPlugin.php @@ -50,7 +50,7 @@ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_ * @param int $sleep time * @param Swift_Plugins_Sleeper $sleeper (not needed really) */ - public function __construct($threshold = 99, $sleep = 0, Swift_Plugins_Sleeper $sleeper = null) + public function __construct($threshold = 99, $sleep = 0, ?Swift_Plugins_Sleeper $sleeper = null) { $this->setThreshold($threshold); $this->setSleepTime($sleep); diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php index 83d304492..b05ba8779 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php @@ -76,7 +76,7 @@ class Swift_Plugins_ThrottlerPlugin extends Swift_Plugins_BandwidthMonitorPlugin * @param Swift_Plugins_Sleeper $sleeper (only needed in testing) * @param Swift_Plugins_Timer $timer (only needed in testing) */ - public function __construct($rate, $mode = self::BYTES_PER_MINUTE, Swift_Plugins_Sleeper $sleeper = null, Swift_Plugins_Timer $timer = null) + public function __construct($rate, $mode = self::BYTES_PER_MINUTE, ?Swift_Plugins_Sleeper $sleeper = null, ?Swift_Plugins_Timer $timer = null) { $this->rate = $rate; $this->mode = $mode; diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php index d2dbd7a66..80800ede2 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php @@ -46,7 +46,7 @@ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport * * @param string $localDomain */ - public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', Swift_AddressEncoder $addressEncoder = null) + public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', ?Swift_AddressEncoder $addressEncoder = null) { $this->buffer = $buf; $this->eventDispatcher = $dispatcher; diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php index 36545f51f..dc0487ebb 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php @@ -51,7 +51,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo * @param Swift_Transport_EsmtpHandler[] $extensionHandlers * @param string $localDomain */ - public function __construct(Swift_Transport_IoBuffer $buf, array $extensionHandlers, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', Swift_AddressEncoder $addressEncoder = null) + public function __construct(Swift_Transport_IoBuffer $buf, array $extensionHandlers, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', ?Swift_AddressEncoder $addressEncoder = null) { parent::__construct($buf, $dispatcher, $localDomain, $addressEncoder); $this->setExtensionHandlers($extensionHandlers); diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php index 65a434d11..4b0e83d10 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php @@ -36,7 +36,7 @@ class Swift_Transport_SendmailTransport extends Swift_Transport_AbstractSmtpTran * * @param string $localDomain */ - public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', Swift_AddressEncoder $addressEncoder = null) + public function __construct(Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher, $localDomain = '127.0.0.1', ?Swift_AddressEncoder $addressEncoder = null) { parent::__construct($buf, $dispatcher, $localDomain, $addressEncoder); } diff --git a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SpoolTransport.php b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SpoolTransport.php index 0cb6a5b80..d32a9ccdb 100644 --- a/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SpoolTransport.php +++ b/common/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SpoolTransport.php @@ -24,7 +24,7 @@ class Swift_Transport_SpoolTransport implements Swift_Transport /** * Constructor. */ - public function __construct(Swift_Events_EventDispatcher $eventDispatcher, Swift_Spool $spool = null) + public function __construct(Swift_Events_EventDispatcher $eventDispatcher, ?Swift_Spool $spool = null) { $this->eventDispatcher = $eventDispatcher; $this->spool = $spool; diff --git a/modules/board/board.admin.controller.php b/modules/board/board.admin.controller.php index c69742341..d1f0c329c 100644 --- a/modules/board/board.admin.controller.php +++ b/modules/board/board.admin.controller.php @@ -88,6 +88,7 @@ class BoardAdminController extends Board { $args->meta_description = trim(utf8_normalize_spaces($args->meta_description)); $args->header_text = Rhymix\Modules\Admin\Models\Utility::cleanHeaderAndFooterScripts($args->header_text ?? ''); $args->footer_text = Rhymix\Modules\Admin\Models\Utility::cleanHeaderAndFooterScripts($args->footer_text ?? ''); + $args->admin_mail = implode(', ', array_map('trim', explode(',', $args->admin_mail ?? ''))); // if there is an existed module if ($args->module_srl && $module_info->module_srl != $args->module_srl) diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index 766535f41..64ce66cb8 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -258,7 +258,7 @@ class BoardController extends Board $oDocument->setGrantForSession(); // send an email to admin user - if ($this->module_info->admin_mail && config('mail.default_from')) + if (isset($this->module_info->admin_mail) && $this->module_info->admin_mail && config('mail.default_from')) { $browser_title = Context::replaceUserLang($this->module_info->browser_title); $mail_title = sprintf(lang('msg_document_notify_mail'), $browser_title, cut_str($obj->title, 20, '...')); diff --git a/modules/board/lang/en.php b/modules/board/lang/en.php index e5c95a83f..94247fb95 100644 --- a/modules/board/lang/en.php +++ b/modules/board/lang/en.php @@ -18,7 +18,7 @@ $lang->consultation = 'Consultation'; $lang->use_consultation = 'Use as Consultation Board'; $lang->secret = 'Secret'; $lang->thisissecret = 'This is a secret post.'; -$lang->admin_mail = 'Administrator\'s Mail'; +$lang->admin_mail = 'Administrator Mail'; $lang->update_log = 'Update Log'; $lang->last_updater = 'Latest Update by'; $lang->cmd_board_list = 'Boards List'; @@ -40,7 +40,7 @@ $lang->about_anonymous_name = 'You can customize the anonymous name that will be $lang->about_board = 'This module is for creating and managing boards.'; $lang->about_consultation = 'Members who are not managers will only see their own posts.
When this feature is enabled, non-members cannot read or write any posts on this board.'; $lang->about_secret = 'Users will be able to write secret posts or comments.'; -$lang->about_admin_mail = 'A mail will be sent when a post or comment is submitted. Mails can be sent to mutiple mail addresses if connecting addresses with commas(,).'; +$lang->about_admin_mail = 'Send an e-mail when a new post or comment is submitted. Separate multiple recipients with a comma.'; $lang->about_list_config = 'If using list-style skin, you may arrange items to display. However, this feature might not be availble for non-official skins. If you double-click target items and display items, then you can add / remove them'; $lang->about_use_status = 'Please select status that can be selected when you write a post.'; $lang->about_protect_comment = 'Prevent updating or deleting a comment if it has children.'; diff --git a/modules/board/lang/ko.php b/modules/board/lang/ko.php index 5f73c5afa..36155b9ae 100644 --- a/modules/board/lang/ko.php +++ b/modules/board/lang/ko.php @@ -40,7 +40,7 @@ $lang->about_anonymous_name = '익명 기능을 사용할 때 표시할 익명 $lang->about_board = '게시판을 생성하고 관리할 수 있습니다.'; $lang->about_consultation = '관리 권한이 없는 회원은 자신이 쓴 글만 보이도록 합니다.
상담 기능 사용시 비회원 글쓰기는 금지됩니다.'; $lang->about_secret = '게시판 및 댓글의 비밀글 기능을 사용할 수 있도록 합니다.'; -$lang->about_admin_mail = '글이나 댓글이 등록될때 등록된 메일주소로 메일이 발송됩니다. 콤마(,)로 연결시 다수의 메일주소로 발송할 수 있습니다.'; +$lang->about_admin_mail = '새 글이나 댓글이 등록되면 지정된 메일 주소로 알림을 받습니다. 여러 메일 주소를 지정하려면 쉼표(,)로 구분하세요.'; $lang->about_list_config = '게시판의 목록형식 사용시 원하는 항목들로 배치를 할 수 있습니다. 단 스킨에서 지원하지 않는 경우 불가능합니다. 대상항목/ 표시항목의 항목을 더블클릭하면 추가/ 제거가 됩니다.'; $lang->about_use_status = '글 작성 시 선택할 수 있는 상태를 지정해주세요.'; $lang->about_protect_comment = '댓글의 댓글이 있을경우 해당댓글을 삭제 및 수정을 할 수 없도록 합니다.'; diff --git a/modules/board/tpl/board_insert.html b/modules/board/tpl/board_insert.html index f66a1d6e3..0478aa728 100644 --- a/modules/board/tpl/board_insert.html +++ b/modules/board/tpl/board_insert.html @@ -68,8 +68,6 @@ - {$lang->help} -

{$lang->about_layout}

@@ -423,8 +421,7 @@
- {$lang->help} -

{$lang->about_admin_mail}

+

{$lang->about_admin_mail}

@@ -434,16 +431,13 @@ - {$lang->help} -

{$lang->about_module_category}

+

{$lang->about_module_category}

- {$lang->help} -

{$lang->about_description}

diff --git a/modules/comment/queries/getModuleList.xml b/modules/comment/queries/getModuleList.xml index 35c3b1c85..3e380a1dd 100644 --- a/modules/comment/queries/getModuleList.xml +++ b/modules/comment/queries/getModuleList.xml @@ -3,6 +3,7 @@ + diff --git a/modules/comment/tpl/comment_list.html b/modules/comment/tpl/comment_list.html index 6b71dce04..71d9b2c87 100644 --- a/modules/comment/tpl/comment_list.html +++ b/modules/comment/tpl/comment_list.html @@ -49,10 +49,16 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}'; {@ $comment = $val->getContentText(200)}
- - {$module_list[$val->module_srl]->browser_title} - - - {$comment}{$lang->no_text_comment} + {@ $comment_url = getUrl(['mid' => $module_list[$val->module_srl]->mid ?? null, 'document_srl' => $val->document_srl, 'comment_srl' => $val->comment_srl]) . '#comment_' . $val->comment_srl} + + + {$module_list[$val->module_srl]->browser_title} - + + {@ $module_url = ModuleModel::getDomainByModuleSrl($val->module_srl); $comment_url = $module_url . $comment_url; } + {$module_list[$val->module_srl]->browser_title} - + + + {$comment}{$lang->no_text_comment} {$val->getNickName()} diff --git a/modules/counter/counter.class.php b/modules/counter/counter.class.php index 4038ac3dd..dbf2dc36a 100644 --- a/modules/counter/counter.class.php +++ b/modules/counter/counter.class.php @@ -31,6 +31,20 @@ class counter extends ModuleObject return true; } + // Index optimization + if (!$oDB->isIndexExists('counter_log', 'idx_regdate_ipaddress')) + { + return true; + } + if ($oDB->isIndexExists('counter_log', 'idx_site_counter_log')) + { + return true; + } + if ($oDB->isIndexExists('counter_log', 'idx_counter_log')) + { + return true; + } + return false; } @@ -46,6 +60,20 @@ class counter extends ModuleObject { $oDB->dropTable('counter_site_status'); } + + // Index optimization + if (!$oDB->isIndexExists('counter_log', 'idx_regdate_ipaddress')) + { + $oDB->addIndex('counter_log', 'idx_regdate_ipaddress', ['regdate(8)', 'ipaddress']); + } + if ($oDB->isIndexExists('counter_log', 'idx_site_counter_log')) + { + $oDB->dropIndex('counter_log', 'idx_site_counter_log'); + } + if ($oDB->isIndexExists('counter_log', 'idx_counter_log')) + { + $oDB->dropIndex('counter_log', 'idx_counter_log'); + } } /** diff --git a/modules/counter/schemas/counter_log.xml b/modules/counter/schemas/counter_log.xml index 3860de488..41aae4466 100644 --- a/modules/counter/schemas/counter_log.xml +++ b/modules/counter/schemas/counter_log.xml @@ -1,6 +1,8 @@ - - - + + + + +
diff --git a/modules/counter/schemas/counter_status.xml b/modules/counter/schemas/counter_status.xml index a9cf7dbb7..f79ded8ef 100644 --- a/modules/counter/schemas/counter_status.xml +++ b/modules/counter/schemas/counter_status.xml @@ -1,5 +1,5 @@ - - - + + +
diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 6ae7a2f11..770fde429 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -3408,8 +3408,12 @@ class DocumentController extends Document $obj->target_module_srl = intval(Context::get('module_srl') ?: Context::get('target_module_srl')); $obj->target_category_srl = intval(Context::get('target_category_srl')); $obj->manager_message = Context::get('message_content') ? nl2br(escape(strip_tags(Context::get('message_content')))) : ''; - $obj->send_message = $obj->manager_message || Context::get('send_default_message') == 'Y'; + $obj->send_message = Context::get('send_message') ?? 'default'; $obj->return_message = ''; + if (Context::get('send_default_message') === 'Y') + { + $obj->send_message = 'default'; + } // Check permission of target module if($obj->target_module_srl) @@ -3540,40 +3544,42 @@ class DocumentController extends Document // Send a message $actions = lang('default_message_verbs'); - if(isset($actions[$obj->type]) && $obj->send_message) + if(isset($actions[$obj->type]) && $obj->send_message !== 'none') { // Set message $title = sprintf(lang('default_message_format'), $actions[$obj->type]); - $content = <<< Content -
{$title}
-

{$obj->manager_message}

-
-
    %1\$s
-Content; - $document_item = '
  • %2$s
  • '; + $content = <<{$title} +

    {$obj->manager_message}

    +
    +
      %1\$s
    + EOT; // Set recipient $recipients = array(); foreach ($obj->document_list as $document_srl => $oDocument) { - if(!($member_srl = abs($oDocument->get('member_srl'))) || $logged_info->member_srl == $member_srl) + $member_srl = abs($oDocument->get('member_srl')); + if(!$member_srl || $logged_info->member_srl == $member_srl) { continue; } - if(!isset($recipients[$member_srl])) { $recipients[$member_srl] = array(); } - - $recipients[$member_srl][] = sprintf($document_item, $oDocument->getPermanentUrl(), $oDocument->getTitleText()); + $recipients[$member_srl][] = vsprintf('
  • %2$s
  • ', [ + escape($oDocument->getPermanentUrl()), + $oDocument->getTitleText(), + ]); } // Send $oCommunicationController = CommunicationController::getInstance(); foreach ($recipients as $member_srl => $items) { - $oCommunicationController->sendMessage($this->user->member_srl, $member_srl, $title, sprintf($content, implode('', $items)), true, null, false); + $content = sprintf($content, implode('', $items)); + $oCommunicationController->sendMessage($this->user->member_srl, $member_srl, $title, $content, true, null, false); } } diff --git a/modules/document/lang/en.php b/modules/document/lang/en.php index be4e6afe2..d535400fd 100644 --- a/modules/document/lang/en.php +++ b/modules/document/lang/en.php @@ -104,7 +104,9 @@ $lang->select_module_id = 'Select a module ID.'; $lang->select_category = 'Select a category.'; $lang->category_description = 'Category Description'; $lang->no_title_document = 'No title in this document.'; -$lang->send_default_message = 'Send the default message'; +$lang->send_default_message = 'Send default message'; +$lang->send_custom_message = 'Send message with content below'; +$lang->send_no_message = 'Don\'t send message'; $lang->msg_admin_document_no_move_to_trash = 'You are not allowed to move the superadmin\'s article to the trash bin.'; $lang->default_message_format = '%1$s the document by manager.'; $lang->default_message_verbs['move'] = 'moved'; diff --git a/modules/document/lang/ko.php b/modules/document/lang/ko.php index ff141bcba..f271c30b2 100644 --- a/modules/document/lang/ko.php +++ b/modules/document/lang/ko.php @@ -96,7 +96,9 @@ $lang->select_category = '분류를 선택하세요.'; $lang->category_description = '분류 설명'; $lang->no_title_document = '제목이 없는 문서입니다.'; $lang->msg_admin_document_no_move_to_trash = '최고 관리자의 게시물을 휴지통으로 이동시킬 권한이 없습니다.'; -$lang->send_default_message = '기본 내용으로만 쪽지 보내기'; +$lang->send_default_message = '기본 내용으로 쪽지 보내기'; +$lang->send_custom_message = '아래 내용으로 쪽지 보내기'; +$lang->send_no_message = '쪽지 보내지 않음'; $lang->default_message_format = '관리자에 의해 게시물이 %1$s되었습니다.'; $lang->default_message_verbs['move'] = '다른 게시판으로 이동'; $lang->default_message_verbs['copy'] = '다른 게시판에 복사'; diff --git a/modules/document/queries/getModuleList.xml b/modules/document/queries/getModuleList.xml index f674afea2..e57b94b5f 100644 --- a/modules/document/queries/getModuleList.xml +++ b/modules/document/queries/getModuleList.xml @@ -3,6 +3,7 @@ + diff --git a/modules/document/tpl/checked_list.html b/modules/document/tpl/checked_list.html index bda080d0c..9cfd75554 100644 --- a/modules/document/tpl/checked_list.html +++ b/modules/document/tpl/checked_list.html @@ -1,8 +1,9 @@ {@Context::addMetaTag('viewport', 'width=device-width', FALSE);} -
    + +

    {$lang->cmd_manage_document}

    @@ -40,9 +41,21 @@
    -
    - - +
    + + + +
    +
    @@ -60,20 +73,19 @@ diff --git a/modules/document/tpl/document_list.html b/modules/document/tpl/document_list.html index db538d2ee..575db6a0b 100644 --- a/modules/document/tpl/document_list.html +++ b/modules/document/tpl/document_list.html @@ -50,11 +50,18 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
    + + + {escape($oDocument->getTitleText(), false)}{$lang->no_title_document} + - {$module_list[$oDocument->get('module_srl')]->browser_title} + + {escape($oDocument->getTitleText(), false)}{$lang->no_title_document} + - {$module_list[$oDocument->get('module_srl')]->browser_title} + + + {escape($oDocument->getTitleText(), false)}{$lang->no_title_document} + +
    - {escape($oDocument->getTitleText(), false)}{$lang->no_title_document} - - - - {$module_list[$oDocument->get('module_srl')]->browser_title} - {$oDocument->getNickName()} ({$member_nick_name[abs($oDocument->get('member_srl'))]}) diff --git a/modules/file/queries/getModuleList.xml b/modules/file/queries/getModuleList.xml index f03e896b4..0fbffa3b7 100644 --- a/modules/file/queries/getModuleList.xml +++ b/modules/file/queries/getModuleList.xml @@ -3,6 +3,7 @@ + diff --git a/modules/file/tpl/file_list.html b/modules/file/tpl/file_list.html index 06fb7bd02..ba4ec7439 100644 --- a/modules/file/tpl/file_list.html +++ b/modules/file/tpl/file_list.html @@ -84,11 +84,18 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}'; [{$lang->cmd_temp_save}] [{$lang->cmd_trash}] - - {$module_list[$val->module_srl]->browser_title} - + + + + {$module_list[$val->module_srl]->browser_title} - + + {@ $module_url = ModuleModel::getDomainByModuleSrl($val->module_srl); $move_uri = $module_url . $move_uri; } + {$module_list[$val->module_srl]->browser_title} - + + + - - {$document_list[$document_srl]->getTitle()}{$document_list[$document_srl]->getTitle()} + {$document_list[$document_srl]->getTitle()}{$document_list[$document_srl]->getTitle()} diff --git a/modules/menu/tpl/sitemap.html b/modules/menu/tpl/sitemap.html index c5f05d700..95748979d 100644 --- a/modules/menu/tpl/sitemap.html +++ b/modules/menu/tpl/sitemap.html @@ -2374,7 +2374,7 @@ jQuery(function($){ case 'member': case 'not_member': case 'site': - $node.find('._group_loggedin').prop('selected', true); + //$node.find('._group_loggedin').prop('selected', true); break; case 'manager': case 'root': diff --git a/modules/module/lang/en.php b/modules/module/lang/en.php index 6fa5a0cff..7f0bd914a 100644 --- a/modules/module/lang/en.php +++ b/modules/module/lang/en.php @@ -80,8 +80,7 @@ $lang->msg_extra_name_exists = 'Already registered field ID. Please input anothe $lang->about_browser_title = 'It will be shown in the browser title. It will be also used in a RSS/Trackback.'; $lang->about_mid = 'The module name must begin with a Latin alphabet, and only consist of Latin alphabets, numerals, and underscores.'; $lang->about_default = 'If checked, this module will be shown when users access the site without mid value (mid=NoValue).'; -$lang->about_module_category = 'It enables you to manage it through a module category. - The URL for the module manager is Module category .'; +$lang->about_module_category = 'Module categories can be edited in Module category.'; $lang->about_description = 'This description is only for a manager.'; $lang->about_header_text = 'The contents will be shown on the top of the module. (html tags available)'; $lang->about_footer_text = 'The contents will be shown on the bottom of the module. (html tags available)'; diff --git a/modules/module/lang/ko.php b/modules/module/lang/ko.php index 512e752df..0501bc905 100644 --- a/modules/module/lang/ko.php +++ b/modules/module/lang/ko.php @@ -80,7 +80,7 @@ $lang->msg_extra_name_exists = '이미 존재하는 확장 변수 ID입니다. $lang->about_browser_title = '브라우저 제목에 나타나는 값입니다. RSS/Trackback에서도 사용됩니다.'; $lang->about_mid = 'URL상의 모듈 이름은 영문, 숫자, _ 만으로 이루어져야 하며, 첫 글자는 반드시 영문 알파벳이어야 합니다.'; $lang->about_default = '선택하면 사이트에 mid값 없이 접속하였을 경우 기본으로 보여줍니다.'; -$lang->about_module_category = '분류를 통한 관리를 할 수 있도록 합니다. 모듈 분류 관리는 모듈분류에서 할 수 있습니다.'; +$lang->about_module_category = '모듈 분류 관리는 모듈 분류에서 할 수 있습니다.'; $lang->about_description = '관리용으로 사용되는 설명입니다.'; $lang->about_header_text = '콘텐츠 상단에 표시되는 내용입니다. (HTML 태그 사용 가능)'; $lang->about_footer_text = '콘텐츠 하단에 표시되는 내용입니다. (HTML 태그 사용 가능)'; diff --git a/modules/module/module.controller.php b/modules/module/module.controller.php index c2e9006eb..7831e9f72 100644 --- a/modules/module/module.controller.php +++ b/modules/module/module.controller.php @@ -656,8 +656,8 @@ class ModuleController extends Module { unset($args); $args = new stdClass; - $args->menu_srl = $output->data->menu_srl; - $args->menu_item_srl = $output->data->menu_item_srl; + $args->menu_srl = $output->data->menu_srl ?: 0; + $args->menu_item_srl = $output->data->menu_item_srl ?: 0; $args->is_force = 'N'; $oMenuAdminController = getAdminController('menu'); diff --git a/modules/module/module.model.php b/modules/module/module.model.php index 32f7d0479..3c4182a46 100644 --- a/modules/module/module.model.php +++ b/modules/module/module.model.php @@ -12,6 +12,7 @@ class ModuleModel extends Module */ public static $_mid_map = []; public static $_module_srl_map = []; + public static $_domain_map = []; /** * @brief Initialization @@ -708,13 +709,13 @@ class ModuleModel extends Module $mid = Rhymix\Framework\Cache::get('site_and_module:module_srl_mid:' . $module_srl); if (isset($mid)) { - return $mid; + return self::$_module_srl_map[$module_srl] = $mid; } $args = new stdClass; $args->module_srls = $module_srl; $output = executeQuery('module.getModuleInfoByModuleSrl', $args, ['mid']); - if ($output->data) + if (is_object($output->data)) { $mid = self::$_module_srl_map[$module_srl] = $output->data->mid; Rhymix\Framework\Cache::set('site_and_module:module_srl_mid:' . $module_srl, $mid, 0, true); @@ -726,6 +727,60 @@ class ModuleModel extends Module } } + /** + * Return the domain (including scheme and port) by module_srl + * + * @param int $module_srl + * @return ?string + */ + public static function getDomainByModuleSrl(int $module_srl): ?string + { + $module_srl = intval($module_srl); + if (isset(self::$_domain_map[$module_srl])) + { + return self::$_domain_map[$module_srl]; + } + + $prefix = Rhymix\Framework\Cache::get('site_and_module:module_srl_prefix:' . $module_srl); + if (isset($prefix)) + { + self::$_domain_map[$module_srl] = $prefix; + return $prefix; + } + + $args = new stdClass; + $args->module_srls = $module_srl; + $args->include_domain_info = true; + $output = executeQuery('module.getModuleInfoByModuleSrl', $args); + if (is_object($output->data)) + { + $info = self::$_module_srl_map[$module_srl] = $output->data; + if (!$info->domain_srl || $info->domain_srl == -1 || !isset($info->domain)) + { + $prefix = ''; + } + else + { + $prefix = $info->security === 'always' ? 'https://' : 'http://'; + $prefix .= $info->domain; + if ($info->security === 'always' && $info->https_port) + { + $prefix .= ':' . $info->https_port; + } + if ($info->security !== 'always' && $info->http_port) + { + $prefix .= ':' . $info->http_port; + } + } + Rhymix\Framework\Cache::set('site_and_module:module_srl_prefix:' . $module_srl, $prefix, 0, true); + return $prefix; + } + else + { + return null; + } + } + /** * @brief Get forward value by the value of act */ diff --git a/modules/module/queries/getModuleInfoByModuleSrl.xml b/modules/module/queries/getModuleInfoByModuleSrl.xml index f00824f94..83c1064a6 100644 --- a/modules/module/queries/getModuleInfoByModuleSrl.xml +++ b/modules/module/queries/getModuleInfoByModuleSrl.xml @@ -1,8 +1,20 @@
    +
    + + + +
    + + + + + + + - + diff --git a/modules/point/point.admin.controller.php b/modules/point/point.admin.controller.php index f5721015d..235f97067 100644 --- a/modules/point/point.admin.controller.php +++ b/modules/point/point.admin.controller.php @@ -231,32 +231,72 @@ class PointAdminController extends Point function procPointAdminInsertPointModuleConfig() { $module_srl = Context::get('target_module_srl'); - if(!$module_srl) throw new Rhymix\Framework\Exceptions\InvalidRequest; + if (!$module_srl) + { + throw new Rhymix\Framework\Exceptions\InvalidRequest; + } + // In case of batch configuration of several modules - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); - else $module_srl = array($module_srl); + if (preg_match('/^([0-9,]+)$/',$module_srl)) + { + $module_srl = explode(',',$module_srl); + } + else + { + $module_srl = array($module_srl); + } + // Save configurations $oModuleController = getController('module'); for($i=0;$iinsertModulePartConfig('point', $srl, $config); } diff --git a/modules/point/point.controller.php b/modules/point/point.controller.php index d900569e1..a40e1b30b 100644 --- a/modules/point/point.controller.php +++ b/modules/point/point.controller.php @@ -211,8 +211,8 @@ class PointController extends Point } // Return if disabled - $config = $this->getConfig(); - if ($config->insert_document_revert_on_delete === false) + $revert = PointModel::getModulePointConfig($module_srl, 'insert_document_revert_on_delete'); + if ($revert === false) { return; } @@ -319,8 +319,8 @@ class PointController extends Point } // Return if disabled - $config = $this->getConfig(); - if ($config->insert_comment_revert_on_delete === false) + $revert = PointModel::getModulePointConfig($module_srl, 'insert_comment_revert_on_delete'); + if ($revert === false) { return; } @@ -333,6 +333,7 @@ class PointController extends Point } // Abort if the document is older than a configured limit. + $config = $this->getConfig(); $time_limit = $config->insert_comment_limit ?: $config->no_point_date; if ($time_limit > 0 && ztime($oDocument->get('regdate')) < RX_TIME - ($time_limit * 86400)) { @@ -381,14 +382,12 @@ class PointController extends Point } // Return if disabled - $config = $this->getConfig(); - if ($config->upload_file_revert_on_delete === false) + $revert = PointModel::getModulePointConfig($module_srl, 'upload_file_revert_on_delete'); + if ($revert === false) { return; } - // Get the points of the member - // Subtract points for the file. $diff = PointModel::getModulePointConfig($module_srl, 'upload_file'); diff --git a/modules/point/point.model.php b/modules/point/point.model.php index a9cfb5599..ae81a9714 100644 --- a/modules/point/point.model.php +++ b/modules/point/point.model.php @@ -271,7 +271,7 @@ class PointModel extends Point * * @param int $module_srl * @param string $config_key - * @return int + * @return int|bool */ public static function getModulePointConfig($module_srl, $config_key) { @@ -306,10 +306,10 @@ class PointModel extends Point else { $default_config = self::getConfig(); - $point = $default_config->{$config_key}; + $point = $default_config->{$config_key} ?? 0; } - return intval($point); + return is_bool($point) ? $point : intval($point); } } /* End of file point.model.php */ diff --git a/modules/point/tpl/point_module_config.html b/modules/point/tpl/point_module_config.html index 2461a319c..e8e5f822a 100644 --- a/modules/point/tpl/point_module_config.html +++ b/modules/point/tpl/point_module_config.html @@ -1,101 +1,118 @@

    {$lang->point}

    -
    - +
    - {$module_config['point_name']} + {$module_config['point_name']} +   {$lang->cmd_point_revert_on_delete} +
    - {$module_config['point_name']} + {$module_config['point_name']} +   {$lang->cmd_point_revert_on_delete} +
    - {$module_config['point_name']} + {$module_config['point_name']} +   {$lang->cmd_point_revert_on_delete} +
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    - {$module_config['point_name']} + {$module_config['point_name']}
    diff --git a/tests/_data/dbquery/selectJoinTest1.xml b/tests/_data/dbquery/selectJoinTest1.xml index 29296c688..4efedd9c8 100644 --- a/tests/_data/dbquery/selectJoinTest1.xml +++ b/tests/_data/dbquery/selectJoinTest1.xml @@ -15,6 +15,7 @@ + diff --git a/tests/unit/framework/parsers/DBQueryParserTest.php b/tests/unit/framework/parsers/DBQueryParserTest.php index d08f8ab25..f46e99c22 100644 --- a/tests/unit/framework/parsers/DBQueryParserTest.php +++ b/tests/unit/framework/parsers/DBQueryParserTest.php @@ -178,7 +178,8 @@ class DBQueryParserTest extends \Codeception\Test\Unit $this->assertEquals('AND', $query->conditions[1]->pipe); $this->assertTrue($query->groupby instanceof Rhymix\Framework\Parsers\DBQuery\GroupBy); - $this->assertEquals('member.member_srl', $query->groupby->columns[0]); + $this->assertEquals(['member.member_srl', null], $query->groupby->columns[0]); + $this->assertEquals(['member.nick_name', 'if_groupby_nick_name'], $query->groupby->columns[1]); $this->assertEquals(1, count($query->groupby->having)); $this->assertTrue($query->groupby->having[0] instanceof Rhymix\Framework\Parsers\DBQuery\Condition); $this->assertEquals('member.member_srl', $query->groupby->having[0]->column); @@ -196,6 +197,12 @@ class DBQueryParserTest extends \Codeception\Test\Unit 'AND `documents`.`document_srl` IN (?, ?, ?) GROUP BY `member`.`member_srl` HAVING `member`.`member_srl` != ?', $sql); $this->assertEquals(['12', '34', '56', '4'], $params); + $args['if_groupby_nick_name'] = true; + $sql = $query->getQueryString('rx_', $args); + $this->assertEquals('SELECT `member`.`member_srl`, COUNT(*) AS `count` FROM `rx_documents` AS `documents`, `rx_member` AS `member` ' . + 'WHERE `documents`.`member_srl` = `member`.`member_srl` AND `documents`.`member_srl` = `member`.`member_srl` ' . + 'AND `documents`.`document_srl` IN (?, ?, ?) GROUP BY `member`.`member_srl`, `member`.`nick_name` HAVING `member`.`member_srl` != ?', $sql); + $args = array( 'document_srl_list' => [12, 34, 56], 'exclude_member_srl' => 4, 'exclude_document_srl_list' => '78,90', 'if_table' => true, 'if_column' => true, 'if_condition2' => true, diff --git a/widgets/content/skins/simple_rectangle/content.html b/widgets/content/skins/simple_rectangle/content.html index 76b708923..aea9b7366 100644 --- a/widgets/content/skins/simple_rectangle/content.html +++ b/widgets/content/skins/simple_rectangle/content.html @@ -1,6 +1,6 @@ -{@$layout_info = Context::get('layout_info')} +{@$layout_info = Context::get('layout_info') ?? new stdClass();} {@ if(!$layout_info->primary_color) @@ -85,4 +85,4 @@
    - \ No newline at end of file +