Remove trailing whitespace

This commit is contained in:
Kijin Sung 2023-01-30 21:43:21 +09:00
parent c5267b42fd
commit 37b0d3a1e6
71 changed files with 806 additions and 806 deletions

View file

@ -143,7 +143,7 @@ class addonAdminController extends addonController
$this->makeCacheFile($site_srl, 'mobile', 'site'); $this->makeCacheFile($site_srl, 'mobile', 'site');
Rhymix\Framework\Cache::clearGroup('addonConfig'); Rhymix\Framework\Cache::clearGroup('addonConfig');
} }
$this->setMessage('success_updated', 'info'); $this->setMessage('success_updated', 'info');
if(Context::get('success_return_url')) if(Context::get('success_return_url'))
{ {
@ -245,7 +245,7 @@ class addonAdminController extends addonController
{ {
$args->is_used = $isUsed === 'Y' ? 'Y' : 'N'; $args->is_used = $isUsed === 'Y' ? 'Y' : 'N';
} }
if($gtype == 'global') if($gtype == 'global')
{ {
$output = executeQuery('addon.insertAddon', $args); $output = executeQuery('addon.insertAddon', $args);
@ -256,7 +256,7 @@ class addonAdminController extends addonController
$args->site_srl = $site_srl; $args->site_srl = $site_srl;
$output = executeQuery('addon.insertSiteAddon', $args); $output = executeQuery('addon.insertSiteAddon', $args);
} }
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any'));
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc'));
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile'));
@ -293,7 +293,7 @@ class addonAdminController extends addonController
$args->site_srl = $site_srl; $args->site_srl = $site_srl;
$output = executeQuery('addon.updateSiteAddon', $args); $output = executeQuery('addon.updateSiteAddon', $args);
} }
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any'));
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc'));
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile'));
@ -329,7 +329,7 @@ class addonAdminController extends addonController
$args->site_srl = $site_srl; $args->site_srl = $site_srl;
$output = executeQuery('addon.updateSiteAddon', $args); $output = executeQuery('addon.updateSiteAddon', $args);
} }
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any'));
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc'));
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile'));
@ -338,4 +338,4 @@ class addonAdminController extends addonController
} }
/* End of file addon.admin.controller.php */ /* End of file addon.admin.controller.php */
/* Location: ./modules/addon/addon.admin.controller.php */ /* Location: ./modules/addon/addon.admin.controller.php */

View file

@ -48,7 +48,7 @@ class addonAdminModel extends addon
{ {
// check blacklist // check blacklist
$addonList[$key]->isBlacklisted = Context::isBlacklistedPlugin($addon->addon, 'addon'); $addonList[$key]->isBlacklisted = Context::isBlacklistedPlugin($addon->addon, 'addon');
// get easyinstall remove url // get easyinstall remove url
$packageSrl = $oAutoinstallModel->getPackageSrlByPath($addon->path); $packageSrl = $oAutoinstallModel->getPackageSrlByPath($addon->path);
$addonList[$key]->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl); $addonList[$key]->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl);
@ -109,7 +109,7 @@ class addonAdminModel extends addon
$path = $this->getAddonPath($addon_name); $path = $this->getAddonPath($addon_name);
// Wanted information on the add-on // Wanted information on the add-on
$info = $this->getAddonInfoXml($addon_name, $site_srl, $gtype); $info = $this->getAddonInfoXml($addon_name, $site_srl, $gtype);
if(!$info) $info = new stdClass(); if(!$info) $info = new stdClass();
$info->addon = $addon_name; $info->addon = $addon_name;
@ -331,16 +331,16 @@ class addonAdminModel extends addon
$addon_info->title = $xml_obj->title->body; $addon_info->title = $xml_obj->title->body;
$addon_info->description = trim($xml_obj->author->description->body); $addon_info->description = trim($xml_obj->author->description->body);
$addon_info->version = $xml_obj->attrs->version; $addon_info->version = $xml_obj->attrs->version;
$date_obj = new stdClass(); $date_obj = new stdClass();
sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d); sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
$addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); $addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
$author_obj = new stdClass(); $author_obj = new stdClass();
$author_obj->name = $xml_obj->author->name->body; $author_obj->name = $xml_obj->author->name->body;
$author_obj->email_address = $xml_obj->author->attrs->email_address; $author_obj->email_address = $xml_obj->author->attrs->email_address;
$author_obj->homepage = $xml_obj->author->attrs->link; $author_obj->homepage = $xml_obj->author->attrs->link;
$addon_info->author = array(); $addon_info->author = array();
$addon_info->author[] = $author_obj; $addon_info->author[] = $author_obj;
@ -462,7 +462,7 @@ class addonAdminModel extends addon
); );
$always_return_false_for_compatibility = array( $always_return_false_for_compatibility = array(
); );
if(isset($always_return_true_for_compatibility[$addon])) if(isset($always_return_true_for_compatibility[$addon]))
{ {
return true; return true;
@ -471,7 +471,7 @@ class addonAdminModel extends addon
{ {
return false; return false;
} }
$args = new stdClass(); $args = new stdClass();
$args->addon = $addon; $args->addon = $addon;
if($gtype == 'global') if($gtype == 'global')

View file

@ -8,7 +8,7 @@
class addonController extends addon class addonController extends addon
{ {
public $addon_file_called = false; public $addon_file_called = false;
/** /**
* Initialization * Initialization
* *
@ -78,41 +78,41 @@ class addonController extends addon
foreach($addon_list as $addon => $val) foreach($addon_list as $addon => $val)
{ {
if(Context::isBlacklistedPlugin($addon, 'addon') if(Context::isBlacklistedPlugin($addon, 'addon')
|| ($type == "pc" && $val->is_used != 'Y') || ($type == "pc" && $val->is_used != 'Y')
|| ($type == "mobile" && $val->is_used_m != 'Y') || ($type == "mobile" && $val->is_used_m != 'Y')
|| ($gtype == 'global' && $val->is_fixed != 'Y') || ($gtype == 'global' && $val->is_fixed != 'Y')
|| !is_dir(RX_BASEDIR . 'addons/' . $addon)) || !is_dir(RX_BASEDIR . 'addons/' . $addon))
{ {
continue; continue;
} }
$extra_vars = unserialize($val->extra_vars); $extra_vars = unserialize($val->extra_vars);
if(!$extra_vars) if(!$extra_vars)
{ {
$extra_vars = new stdClass; $extra_vars = new stdClass;
} }
$mid_list = $extra_vars->mid_list ?? []; $mid_list = $extra_vars->mid_list ?? [];
if(!is_array($mid_list)) if(!is_array($mid_list))
{ {
$mid_list = array(); $mid_list = array();
} }
// Initialize // Initialize
$buff[] = '$before_time = microtime(true);'; $buff[] = '$before_time = microtime(true);';
// Run method and mid list // Run method and mid list
$run_method = ($extra_vars->xe_run_method ?? null) ?: 'run_selected'; $run_method = ($extra_vars->xe_run_method ?? null) ?: 'run_selected';
$buff[] = '$rm = \'' . $run_method . "';"; $buff[] = '$rm = \'' . $run_method . "';";
$buff[] = '$ml = ' . var_export(array_fill_keys($mid_list, true), true) . ';'; $buff[] = '$ml = ' . var_export(array_fill_keys($mid_list, true), true) . ';';
$buff[] = '$_m = Context::get(\'mid\');'; $buff[] = '$_m = Context::get(\'mid\');';
// Addon filename // Addon filename
$buff[] = sprintf('$addon_file = RX_BASEDIR . \'addons/%s/%s.addon.php\';', $addon, $addon); $buff[] = sprintf('$addon_file = RX_BASEDIR . \'addons/%s/%s.addon.php\';', $addon, $addon);
// Addon configuration // Addon configuration
$buff[] = '$addon_info = unserialize(' . var_export(serialize($extra_vars), true) . ');'; $buff[] = '$addon_info = unserialize(' . var_export(serialize($extra_vars), true) . ');';
// Decide whether to run in this mid // Decide whether to run in this mid
if ($run_method === 'no_run_selected') if ($run_method === 'no_run_selected')
{ {
@ -126,7 +126,7 @@ class addonController extends addon
{ {
$buff[] = '$run = isset($ml[$_m]);'; $buff[] = '$run = isset($ml[$_m]);';
} }
// Write debug info // Write debug info
$buff[] = 'if ($run && file_exists($addon_file)):'; $buff[] = 'if ($run && file_exists($addon_file)):';
$buff[] = ' include($addon_file);'; $buff[] = ' include($addon_file);';
@ -142,7 +142,7 @@ class addonController extends addon
$buff[] = 'endif;'; $buff[] = 'endif;';
$buff[] = ''; $buff[] = '';
} }
// Write file in new location // Write file in new location
$addon_file = RX_BASEDIR . 'files/cache/addons/' . $type . '.php'; $addon_file = RX_BASEDIR . 'files/cache/addons/' . $type . '.php';
FileHandler::writeFile($addon_file, join(PHP_EOL, $buff)); FileHandler::writeFile($addon_file, join(PHP_EOL, $buff));
@ -176,7 +176,7 @@ class addonController extends addon
$args->site_srl = $site_srl; $args->site_srl = $site_srl;
$output = executeQuery('addon.updateSiteAddon', $args); $output = executeQuery('addon.updateSiteAddon', $args);
} }
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any'));
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc'));
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile')); Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile'));

View file

@ -4,7 +4,7 @@ class AddonModel extends Addon
{ {
/** /**
* Get configuration for addon * Get configuration for addon
* *
* @param string $addon_name * @param string $addon_name
* @param string $type * @param string $type
* @return object|null * @return object|null
@ -15,14 +15,14 @@ class AddonModel extends Addon
{ {
$type = 'any'; $type = 'any';
} }
$cache_key = sprintf('addonConfig:%s:%s', $addon_name, $type); $cache_key = sprintf('addonConfig:%s:%s', $addon_name, $type);
$config = Rhymix\Framework\Cache::get($cache_key); $config = Rhymix\Framework\Cache::get($cache_key);
if ($config !== null) if ($config !== null)
{ {
return $config; return $config;
} }
$args = new stdClass(); $args = new stdClass();
$args->addon = $addon_name; $args->addon = $addon_name;
$args->site_srl = 0; $args->site_srl = 0;
@ -31,7 +31,7 @@ class AddonModel extends Addon
{ {
return null; return null;
} }
$result = array_first($output->data); $result = array_first($output->data);
if ($type === 'pc' && $result->is_used !== 'Y') if ($type === 'pc' && $result->is_used !== 'Y')
{ {
@ -45,7 +45,7 @@ class AddonModel extends Addon
{ {
return null; return null;
} }
$config = unserialize($result->extra_vars); $config = unserialize($result->extra_vars);
unset($config->xe_validator_id); unset($config->xe_validator_id);
if (!isset($config->mid_list)) if (!isset($config->mid_list))
@ -54,7 +54,7 @@ class AddonModel extends Addon
} }
$config->use_pc = $result->is_used; $config->use_pc = $result->is_used;
$config->use_mobile = $result->is_used_m; $config->use_mobile = $result->is_used_m;
Rhymix\Framework\Cache::set($cache_key, $config, 0, true); Rhymix\Framework\Cache::set($cache_key, $config, 0, true);
return $config; return $config;
} }

View file

@ -15,7 +15,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
{ {
// Get and validate the new configuration. // Get and validate the new configuration.
$vars = Context::getRequestVars(); $vars = Context::getRequestVars();
// Update the current module's configuration. // Update the current module's configuration.
$config = $this->getConfig(); $config = $this->getConfig();
$config->log_sent_mail = toBool($vars->log_sent_mail); $config->log_sent_mail = toBool($vars->log_sent_mail);
@ -33,7 +33,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
{ {
return $output; return $output;
} }
if (Context::get('success_return_url')) if (Context::get('success_return_url'))
{ {
$this->setRedirectUrl(Context::get('success_return_url')); $this->setRedirectUrl(Context::get('success_return_url'));
@ -43,7 +43,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminConfig')); $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminConfig'));
} }
} }
/** /**
* Save the exception configuration. * Save the exception configuration.
*/ */
@ -52,7 +52,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
// Get the current configuration. // Get the current configuration.
$config = $this->getConfig(); $config = $this->getConfig();
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
// Get and validate the list of exceptions. // Get and validate the list of exceptions.
$exceptions = array(); $exceptions = array();
for ($i = 1; $i <= 3; $i++) for ($i = 1; $i <= 3; $i++)
@ -77,7 +77,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
} }
$exceptions[$i]['method'] = $method; $exceptions[$i]['method'] = $method;
$exceptions[$i]['domains'] = array(); $exceptions[$i]['domains'] = array();
$domains = array_map('trim', preg_split('/[,\n]/', $domains, null, PREG_SPLIT_NO_EMPTY)); $domains = array_map('trim', preg_split('/[,\n]/', $domains, null, PREG_SPLIT_NO_EMPTY));
foreach ($domains as $domain) foreach ($domains as $domain)
{ {
@ -89,7 +89,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
} }
} }
} }
// Save the new configuration. // Save the new configuration.
$config->exceptions = $exceptions; $config->exceptions = $exceptions;
$output = getController('module')->insertModuleConfig('advanced_mailer', $config); $output = getController('module')->insertModuleConfig('advanced_mailer', $config);
@ -101,7 +101,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
{ {
return $output; return $output;
} }
if (Context::get('success_return_url')) if (Context::get('success_return_url'))
{ {
$this->setRedirectUrl(Context::get('success_return_url')); $this->setRedirectUrl(Context::get('success_return_url'));
@ -111,7 +111,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminExceptions')); $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminExceptions'));
} }
} }
/** /**
* Check the DNS record of a domain. * Check the DNS record of a domain.
*/ */
@ -128,14 +128,14 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->add('record_content', false); $this->add('record_content', false);
return; return;
} }
$records = @dns_get_record($check_config->hostname, constant('DNS_' . $check_config->record_type)); $records = @dns_get_record($check_config->hostname, constant('DNS_' . $check_config->record_type));
if ($records === false) if ($records === false)
{ {
$this->add('record_content', false); $this->add('record_content', false);
return; return;
} }
$return_values = array(); $return_values = array();
foreach ($records as $record) foreach ($records as $record)
{ {
@ -147,7 +147,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->add('record_content', implode("\n\n", $return_values)); $this->add('record_content', implode("\n\n", $return_values));
return; return;
} }
/** /**
* Clear old mail sending log. * Clear old mail sending log.
*/ */
@ -163,15 +163,15 @@ class Advanced_MailerAdminController extends Advanced_Mailer
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
$obj = new stdClass(); $obj = new stdClass();
$obj->status = $status; $obj->status = $status;
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap()); $obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
$output = executeQuery('advanced_mailer.deleteMailLogs', $obj); $output = executeQuery('advanced_mailer.deleteMailLogs', $obj);
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailLog', 'status', $status)); $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailLog', 'status', $status));
} }
/** /**
* Clear old SMS sending log. * Clear old SMS sending log.
*/ */
@ -187,15 +187,15 @@ class Advanced_MailerAdminController extends Advanced_Mailer
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
$obj = new stdClass(); $obj = new stdClass();
$obj->status = $status; $obj->status = $status;
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap()); $obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
$output = executeQuery('advanced_mailer.deleteSMSLogs', $obj); $output = executeQuery('advanced_mailer.deleteSMSLogs', $obj);
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSLog', 'status', $status)); $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSLog', 'status', $status));
} }
/** /**
* Clear old Push sending log. * Clear old Push sending log.
*/ */
@ -211,15 +211,15 @@ class Advanced_MailerAdminController extends Advanced_Mailer
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
$obj = new stdClass(); $obj = new stdClass();
$obj->status = $status; $obj->status = $status;
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap()); $obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
$output = executeQuery('advanced_mailer.deletePushLogs', $obj); $output = executeQuery('advanced_mailer.deletePushLogs', $obj);
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminPushLog', 'status', $status)); $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminPushLog', 'status', $status));
} }
/** /**
* Send a test mail. * Send a test mail.
*/ */
@ -228,7 +228,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$recipient_config = Context::gets('recipient_name', 'recipient_email'); $recipient_config = Context::gets('recipient_name', 'recipient_email');
$recipient_name = $recipient_config->recipient_name; $recipient_name = $recipient_config->recipient_name;
$recipient_email = $recipient_config->recipient_email; $recipient_email = $recipient_config->recipient_email;
if (!$recipient_name) if (!$recipient_name)
{ {
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_name_is_empty')); $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_name_is_empty'));
@ -244,10 +244,10 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_email_is_invalid')); $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_email_is_invalid'));
return; return;
} }
$oAdvancedMailerController = getController('advanced_mailer'); $oAdvancedMailerController = getController('advanced_mailer');
$sending_method = $oAdvancedMailerController->getSendingMethodForEmailAddress($recipient_email) ?: config('mail.type'); $sending_method = $oAdvancedMailerController->getSendingMethodForEmailAddress($recipient_email) ?: config('mail.type');
try try
{ {
$oMail = new Rhymix\Framework\Mail(); $oMail = new Rhymix\Framework\Mail();
@ -256,7 +256,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
'<p>고급 메일 발송 모듈 <b>테스트</b> 메일입니다.</p><p>메일이 정상적으로 발송되고 있습니다.</p>'); '<p>고급 메일 발송 모듈 <b>테스트</b> 메일입니다.</p><p>메일이 정상적으로 발송되고 있습니다.</p>');
$oMail->addTo($recipient_email, $recipient_name); $oMail->addTo($recipient_email, $recipient_name);
$result = $oMail->send(); $result = $oMail->send();
if (!$result) if (!$result)
{ {
if (count($oMail->getErrors())) if (count($oMail->getErrors()))
@ -274,7 +274,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
return; return;
} }
} }
$this->add('test_result', nl2br(htmlspecialchars(implode("\n", $oMail->getErrors())))); $this->add('test_result', nl2br(htmlspecialchars(implode("\n", $oMail->getErrors()))));
return; return;
} }
@ -290,11 +290,11 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->add('test_result', nl2br(htmlspecialchars($e->getMessage()))); $this->add('test_result', nl2br(htmlspecialchars($e->getMessage())));
return; return;
} }
$this->add('test_result', Context::getLang('msg_advanced_mailer_test_success')); $this->add('test_result', Context::getLang('msg_advanced_mailer_test_success'));
return; return;
} }
/** /**
* Send a test SMS. * Send a test SMS.
*/ */
@ -303,7 +303,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$recipient_number = Context::get('recipient_number'); $recipient_number = Context::get('recipient_number');
$country_code = intval(Context::get('country_code')); $country_code = intval(Context::get('country_code'));
$content = trim(Context::get('content')); $content = trim(Context::get('content'));
if (!$recipient_number) if (!$recipient_number)
{ {
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_number_is_empty')); $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_number_is_empty'));
@ -314,14 +314,14 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_content_is_empty')); $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_content_is_empty'));
return; return;
} }
try try
{ {
$oSMS = new Rhymix\Framework\SMS(); $oSMS = new Rhymix\Framework\SMS();
$oSMS->addTo($recipient_number, $country_code); $oSMS->addTo($recipient_number, $country_code);
$oSMS->setBody($content); $oSMS->setBody($content);
$result = $oSMS->send(); $result = $oSMS->send();
if (!$result) if (!$result)
{ {
if (count($oSMS->getErrors())) if (count($oSMS->getErrors()))
@ -341,11 +341,11 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->add('test_result', nl2br(htmlspecialchars($e->getMessage()))); $this->add('test_result', nl2br(htmlspecialchars($e->getMessage())));
return; return;
} }
$this->add('test_result', Context::getLang('msg_advanced_mailer_test_success_sms')); $this->add('test_result', Context::getLang('msg_advanced_mailer_test_success_sms'));
return; return;
} }
/** /**
* Send a test Push Notification. * Send a test Push Notification.
*/ */
@ -355,14 +355,14 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$subject = trim(Context::get('subject')); $subject = trim(Context::get('subject'));
$content = trim(Context::get('content')); $content = trim(Context::get('content'));
$url = trim(Context::get('url')); $url = trim(Context::get('url'));
$member_info = MemberModel::getMemberInfoByUserID($recipient_user_id); $member_info = MemberModel::getMemberInfoByUserID($recipient_user_id);
if (!$member_info || !$member_info->member_srl) if (!$member_info || !$member_info->member_srl)
{ {
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_user_id_not_found')); $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_user_id_not_found'));
return; return;
} }
$args = new stdClass; $args = new stdClass;
$args->member_srl = $member_info->member_srl; $args->member_srl = $member_info->member_srl;
$output = executeQueryArray('member.getMemberDeviceTokensByMemberSrl', $args); $output = executeQueryArray('member.getMemberDeviceTokensByMemberSrl', $args);
@ -371,7 +371,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_has_no_devices')); $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_has_no_devices'));
return; return;
} }
if (!$subject) if (!$subject)
{ {
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_subject_is_empty')); $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_subject_is_empty'));
@ -387,7 +387,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_url_is_invalid')); $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_url_is_invalid'));
return; return;
} }
try try
{ {
$oPush = new Rhymix\Framework\Push; $oPush = new Rhymix\Framework\Push;
@ -396,7 +396,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$oPush->setContent($content); $oPush->setContent($content);
$oPush->setURL($url); $oPush->setURL($url);
$result = $oPush->send(); $result = $oPush->send();
if (!$result) if (!$result)
{ {
if (count($oPush->getErrors())) if (count($oPush->getErrors()))
@ -416,7 +416,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
$this->add('test_result', nl2br(htmlspecialchars($e->getMessage()))); $this->add('test_result', nl2br(htmlspecialchars($e->getMessage())));
return; return;
} }
$this->add('test_result', Context::getLang('msg_advanced_mailer_test_success_sms')); $this->add('test_result', Context::getLang('msg_advanced_mailer_test_success_sms'));
return; return;
} }

View file

@ -15,11 +15,11 @@ class Advanced_MailerAdminView extends Advanced_Mailer
{ {
$advanced_mailer_config = $this->getConfig(); $advanced_mailer_config = $this->getConfig();
Context::set('advanced_mailer_config', $advanced_mailer_config); Context::set('advanced_mailer_config', $advanced_mailer_config);
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('config'); $this->setTemplateFile('config');
} }
/** /**
* Display the exception domains configuration form. * Display the exception domains configuration form.
*/ */
@ -27,7 +27,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
{ {
$advanced_mailer_config = $this->getConfig(); $advanced_mailer_config = $this->getConfig();
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
for ($i = 1; $i <= 3; $i++) for ($i = 1; $i <= 3; $i++)
{ {
if (!isset($advanced_mailer_config->exceptions[$i])) if (!isset($advanced_mailer_config->exceptions[$i]))
@ -39,15 +39,15 @@ class Advanced_MailerAdminView extends Advanced_Mailer
$advanced_mailer_config->exceptions[$i]['method'] = 'mailfunction'; $advanced_mailer_config->exceptions[$i]['method'] = 'mailfunction';
} }
} }
Context::set('advanced_mailer_config', $advanced_mailer_config); Context::set('advanced_mailer_config', $advanced_mailer_config);
Context::set('sending_methods', $sending_methods); Context::set('sending_methods', $sending_methods);
Context::set('sending_method', config('mail.type')); Context::set('sending_method', config('mail.type'));
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('exceptions'); $this->setTemplateFile('exceptions');
} }
/** /**
* Display the SPF/DKIM setting guide. * Display the SPF/DKIM setting guide.
*/ */
@ -55,7 +55,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
{ {
$advanced_mailer_config = $this->getConfig(); $advanced_mailer_config = $this->getConfig();
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
Context::set('advanced_mailer_config', $advanced_mailer_config); Context::set('advanced_mailer_config', $advanced_mailer_config);
Context::set('sending_methods', $sending_methods); Context::set('sending_methods', $sending_methods);
Context::set('sending_method', config('mail.type')); Context::set('sending_method', config('mail.type'));
@ -67,7 +67,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
{ {
Context::set('sending_domain', preg_replace('/^www\./', '', $_SERVER['HTTP_HOST'])); Context::set('sending_domain', preg_replace('/^www\./', '', $_SERVER['HTTP_HOST']));
} }
$used_methods = array(config('mail.type')); $used_methods = array(config('mail.type'));
$advanced_mailer_config->exceptions = $advanced_mailer_config->exceptions ?: array(); $advanced_mailer_config->exceptions = $advanced_mailer_config->exceptions ?: array();
foreach ($advanced_mailer_config->exceptions as $exception) foreach ($advanced_mailer_config->exceptions as $exception)
@ -78,7 +78,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
} }
} }
Context::set('used_methods', $used_methods); Context::set('used_methods', $used_methods);
$used_methods_with_usable_spf = array(); $used_methods_with_usable_spf = array();
$used_methods_with_usable_dkim = array(); $used_methods_with_usable_dkim = array();
foreach ($used_methods as $method) foreach ($used_methods as $method)
@ -104,11 +104,11 @@ class Advanced_MailerAdminView extends Advanced_Mailer
ksort($used_methods_with_usable_dkim); ksort($used_methods_with_usable_dkim);
Context::set('used_methods_with_usable_spf', $used_methods_with_usable_spf); Context::set('used_methods_with_usable_spf', $used_methods_with_usable_spf);
Context::set('used_methods_with_usable_dkim', $used_methods_with_usable_dkim); Context::set('used_methods_with_usable_dkim', $used_methods_with_usable_dkim);
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('spf_dkim'); $this->setTemplateFile('spf_dkim');
} }
/** /**
* Display the mail test form. * Display the mail test form.
*/ */
@ -116,15 +116,15 @@ class Advanced_MailerAdminView extends Advanced_Mailer
{ {
$advanced_mailer_config = $this->getConfig(); $advanced_mailer_config = $this->getConfig();
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
Context::set('advanced_mailer_config', $advanced_mailer_config); Context::set('advanced_mailer_config', $advanced_mailer_config);
Context::set('sending_methods', $sending_methods); Context::set('sending_methods', $sending_methods);
Context::set('sending_method', config('mail.type')); Context::set('sending_method', config('mail.type'));
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('mail_test'); $this->setTemplateFile('mail_test');
} }
/** /**
* Display the mail log. * Display the mail log.
*/ */
@ -137,20 +137,20 @@ class Advanced_MailerAdminView extends Advanced_Mailer
$maillog = $maillog->toBool() ? $this->procMailLog($maillog->data) : array(); $maillog = $maillog->toBool() ? $this->procMailLog($maillog->data) : array();
Context::set('advanced_mailer_log', $maillog); Context::set('advanced_mailer_log', $maillog);
Context::set('advanced_mailer_status', $obj->status); Context::set('advanced_mailer_status', $obj->status);
$paging = $this->procPaging($obj->status, 'mail', $page); $paging = $this->procPaging($obj->status, 'mail', $page);
Context::set('total_count', $paging->total_count); Context::set('total_count', $paging->total_count);
Context::set('total_page', $paging->total_page); Context::set('total_page', $paging->total_page);
Context::set('page', $paging->page); Context::set('page', $paging->page);
Context::set('page_navigation', $paging->page_navigation); Context::set('page_navigation', $paging->page_navigation);
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
Context::set('sending_methods', $sending_methods); Context::set('sending_methods', $sending_methods);
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('mail_log'); $this->setTemplateFile('mail_log');
} }
/** /**
* Display the SMS test form. * Display the SMS test form.
*/ */
@ -158,15 +158,15 @@ class Advanced_MailerAdminView extends Advanced_Mailer
{ {
$advanced_mailer_config = $this->getConfig(); $advanced_mailer_config = $this->getConfig();
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
Context::set('advanced_mailer_config', $advanced_mailer_config); Context::set('advanced_mailer_config', $advanced_mailer_config);
Context::set('sending_methods', $sending_methods); Context::set('sending_methods', $sending_methods);
Context::set('sending_method', config('mail.type')); Context::set('sending_method', config('mail.type'));
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('sms_test'); $this->setTemplateFile('sms_test');
} }
/** /**
* Display the SMS log. * Display the SMS log.
*/ */
@ -179,20 +179,20 @@ class Advanced_MailerAdminView extends Advanced_Mailer
$smslog = $smslog->toBool() ? $smslog->data : array(); $smslog = $smslog->toBool() ? $smslog->data : array();
Context::set('advanced_mailer_log', $smslog); Context::set('advanced_mailer_log', $smslog);
Context::set('advanced_mailer_status', $obj->status); Context::set('advanced_mailer_status', $obj->status);
$paging = $this->procPaging($obj->status, 'sms', $page); $paging = $this->procPaging($obj->status, 'sms', $page);
Context::set('total_count', $paging->total_count); Context::set('total_count', $paging->total_count);
Context::set('total_page', $paging->total_page); Context::set('total_page', $paging->total_page);
Context::set('page', $paging->page); Context::set('page', $paging->page);
Context::set('page_navigation', $paging->page_navigation); Context::set('page_navigation', $paging->page_navigation);
$sending_methods = Rhymix\Framework\SMS::getSupportedDrivers(); $sending_methods = Rhymix\Framework\SMS::getSupportedDrivers();
Context::set('sending_methods', $sending_methods); Context::set('sending_methods', $sending_methods);
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('sms_log'); $this->setTemplateFile('sms_log');
} }
/** /**
* Display the Push test form. * Display the Push test form.
*/ */
@ -200,11 +200,11 @@ class Advanced_MailerAdminView extends Advanced_Mailer
{ {
$advanced_mailer_config = $this->getConfig(); $advanced_mailer_config = $this->getConfig();
Context::set('advanced_mailer_config', $advanced_mailer_config); Context::set('advanced_mailer_config', $advanced_mailer_config);
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('push_test'); $this->setTemplateFile('push_test');
} }
/** /**
* Display the Push log. * Display the Push log.
*/ */
@ -217,17 +217,17 @@ class Advanced_MailerAdminView extends Advanced_Mailer
$pushlog = $pushlog->toBool() ? $pushlog->data : array(); $pushlog = $pushlog->toBool() ? $pushlog->data : array();
Context::set('advanced_mailer_log', $pushlog); Context::set('advanced_mailer_log', $pushlog);
Context::set('advanced_mailer_status', $obj->status); Context::set('advanced_mailer_status', $obj->status);
$paging = $this->procPaging($obj->status, 'push', $page); $paging = $this->procPaging($obj->status, 'push', $page);
Context::set('total_count', $paging->total_count); Context::set('total_count', $paging->total_count);
Context::set('total_page', $paging->total_page); Context::set('total_page', $paging->total_page);
Context::set('page', $paging->page); Context::set('page', $paging->page);
Context::set('page_navigation', $paging->page_navigation); Context::set('page_navigation', $paging->page_navigation);
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('push_log'); $this->setTemplateFile('push_log');
} }
/** /**
* Process mail log for display. * Process mail log for display.
*/ */
@ -248,7 +248,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
} }
} }
$item->mail_from = $from; $item->mail_from = $from;
$to = explode("\n", $item->mail_to); $to = explode("\n", $item->mail_to);
foreach($to as &$toitem) foreach($to as &$toitem)
{ {
@ -263,10 +263,10 @@ class Advanced_MailerAdminView extends Advanced_Mailer
} }
$item->mail_to = $to; $item->mail_to = $to;
} }
return $log; return $log;
} }
/** /**
* Process paging. * Process paging.
*/ */
@ -288,7 +288,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
} }
$total_count = $count->data->count; $total_count = $count->data->count;
$total_page = max(1, ceil($total_count / 20)); $total_page = max(1, ceil($total_count / 20));
$output = new stdClass; $output = new stdClass;
$output->total_count = $total_count; $output->total_count = $total_count;
$output->total_page = $total_page; $output->total_page = $total_page;
@ -296,7 +296,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
$output->page_navigation = new PageHandler($total_count, $total_page, $page, 10); $output->page_navigation = new PageHandler($total_count, $total_page, $page, 10);
return $output; return $output;
} }
/** /**
* Get the public IPv4 address of the current server. * Get the public IPv4 address of the current server.
*/ */

View file

@ -18,23 +18,23 @@ class Advanced_Mailer extends ModuleObject
{ {
$config = new stdClass(); $config = new stdClass();
} }
if (isset($config->is_enabled) || isset($config->sending_method) || isset($config->send_type)) if (isset($config->is_enabled) || isset($config->sending_method) || isset($config->send_type))
{ {
$config = $this->migrateConfig($config); $config = $this->migrateConfig($config);
getController('module')->insertModuleConfig('advanced_mailer', $config); getController('module')->insertModuleConfig('advanced_mailer', $config);
} }
return $config; return $config;
} }
/** /**
* Migrate from previous configuration format. * Migrate from previous configuration format.
*/ */
public function migrateConfig($config) public function migrateConfig($config)
{ {
$systemconfig = array(); $systemconfig = array();
if (isset($config->sending_method)) if (isset($config->sending_method))
{ {
$systemconfig['mail.type'] = $config->sending_method; $systemconfig['mail.type'] = $config->sending_method;
@ -47,7 +47,7 @@ class Advanced_Mailer extends ModuleObject
{ {
$systemconfig['mail.type'] = 'mailfunction'; $systemconfig['mail.type'] = 'mailfunction';
} }
if (isset($config->username)) if (isset($config->username))
{ {
if (in_array('username', $this->sending_methods[$config->sending_method]['conf'])) if (in_array('username', $this->sending_methods[$config->sending_method]['conf']))
@ -56,7 +56,7 @@ class Advanced_Mailer extends ModuleObject
} }
unset($config->username); unset($config->username);
} }
if (isset($config->password)) if (isset($config->password))
{ {
if (in_array('password', $this->sending_methods[$config->sending_method]['conf'])) if (in_array('password', $this->sending_methods[$config->sending_method]['conf']))
@ -65,7 +65,7 @@ class Advanced_Mailer extends ModuleObject
} }
unset($config->password); unset($config->password);
} }
if (isset($config->domain)) if (isset($config->domain))
{ {
if (in_array('domain', $this->sending_methods[$config->sending_method]['conf'])) if (in_array('domain', $this->sending_methods[$config->sending_method]['conf']))
@ -74,7 +74,7 @@ class Advanced_Mailer extends ModuleObject
} }
unset($config->domain); unset($config->domain);
} }
if (isset($config->api_key)) if (isset($config->api_key))
{ {
if (in_array('api_key', $this->sending_methods[$config->sending_method]['conf'])) if (in_array('api_key', $this->sending_methods[$config->sending_method]['conf']))
@ -83,7 +83,7 @@ class Advanced_Mailer extends ModuleObject
} }
unset($config->api_key); unset($config->api_key);
} }
if (isset($config->account_type)) if (isset($config->account_type))
{ {
if (in_array('account_type', $this->sending_methods[$config->sending_method]['conf'])) if (in_array('account_type', $this->sending_methods[$config->sending_method]['conf']))
@ -92,25 +92,25 @@ class Advanced_Mailer extends ModuleObject
} }
unset($config->account_type); unset($config->account_type);
} }
if (isset($config->aws_region)) if (isset($config->aws_region))
{ {
$config->ses_region = $config->aws_region; $config->ses_region = $config->aws_region;
unset($config->aws_region); unset($config->aws_region);
} }
if (isset($config->aws_access_key)) if (isset($config->aws_access_key))
{ {
$config->ses_access_key = $config->aws_access_key; $config->ses_access_key = $config->aws_access_key;
unset($config->aws_access_key); unset($config->aws_access_key);
} }
if (isset($config->aws_secret_key)) if (isset($config->aws_secret_key))
{ {
$config->ses_secret_key = $config->aws_secret_key; $config->ses_secret_key = $config->aws_secret_key;
unset($config->aws_secret_key); unset($config->aws_secret_key);
} }
$mail_drivers = Rhymix\Framework\Mail::getSupportedDrivers(); $mail_drivers = Rhymix\Framework\Mail::getSupportedDrivers();
foreach ($mail_drivers as $driver_name => $driver_definition) foreach ($mail_drivers as $driver_name => $driver_definition)
{ {
@ -153,7 +153,7 @@ class Advanced_Mailer extends ModuleObject
} }
} }
} }
if (count($systemconfig)) if (count($systemconfig))
{ {
foreach ($systemconfig as $key => $value) foreach ($systemconfig as $key => $value)
@ -162,7 +162,7 @@ class Advanced_Mailer extends ModuleObject
} }
Rhymix\Framework\Config::save(); Rhymix\Framework\Config::save();
} }
unset($config->is_enabled); unset($config->is_enabled);
unset($config->sending_method); unset($config->sending_method);
unset($config->send_type); unset($config->send_type);
@ -173,10 +173,10 @@ class Advanced_Mailer extends ModuleObject
{ {
$config->exceptions = array(); $config->exceptions = array();
} }
return $config; return $config;
} }
/** /**
* Register triggers. * Register triggers.
*/ */
@ -205,7 +205,7 @@ class Advanced_Mailer extends ModuleObject
$oModuleController->insertTrigger('push.send', 'advanced_mailer', 'controller', 'triggerAfterPushSend', 'after'); $oModuleController->insertTrigger('push.send', 'advanced_mailer', 'controller', 'triggerAfterPushSend', 'after');
} }
} }
/** /**
* Install. * Install.
*/ */
@ -213,7 +213,7 @@ class Advanced_Mailer extends ModuleObject
{ {
$this->registerTriggers(); $this->registerTriggers();
} }
/** /**
* Check update. * Check update.
*/ */
@ -242,7 +242,7 @@ class Advanced_Mailer extends ModuleObject
} }
return false; return false;
} }
/** /**
* Update. * Update.
*/ */
@ -250,7 +250,7 @@ class Advanced_Mailer extends ModuleObject
{ {
$this->registerTriggers(); $this->registerTriggers();
} }
public function recompileCache() public function recompileCache()
{ {
// no-op // no-op

View file

@ -14,7 +14,7 @@ class Advanced_MailerController extends Advanced_Mailer
public function triggerBeforeMailSend($mail) public function triggerBeforeMailSend($mail)
{ {
$config = $this->getConfig(); $config = $this->getConfig();
$recipients = $mail->message->getTo() ?: array(); $recipients = $mail->message->getTo() ?: array();
if ($recipients) if ($recipients)
{ {
@ -28,7 +28,7 @@ class Advanced_MailerController extends Advanced_Mailer
} }
} }
} }
if (!$mail->getFrom()) if (!$mail->getFrom())
{ {
list($default_from, $default_name) = $this->getDefaultEmailIdentity(); list($default_from, $default_name) = $this->getDefaultEmailIdentity();
@ -58,20 +58,20 @@ class Advanced_MailerController extends Advanced_Mailer
} }
} }
} }
/** /**
* After mail send trigger. * After mail send trigger.
*/ */
public function triggerAfterMailSend($mail) public function triggerAfterMailSend($mail)
{ {
$config = $this->getConfig(); $config = $this->getConfig();
if (toBool($config->log_sent_mail ?? 'N') || (toBool($config->log_errors ?? 'N') && count($mail->errors))) if (toBool($config->log_sent_mail ?? 'N') || (toBool($config->log_errors ?? 'N') && count($mail->errors)))
{ {
$obj = new \stdClass(); $obj = new \stdClass();
$obj->mail_from = ''; $obj->mail_from = '';
$obj->mail_to = ''; $obj->mail_to = '';
if ($real_sender = $mail->message->getFrom()) if ($real_sender = $mail->message->getFrom())
{ {
foreach($real_sender as $email => $name) foreach($real_sender as $email => $name)
@ -79,7 +79,7 @@ class Advanced_MailerController extends Advanced_Mailer
$obj->mail_from .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n"; $obj->mail_from .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n";
} }
} }
if ($real_to = $mail->message->getTo()) if ($real_to = $mail->message->getTo())
{ {
foreach($real_to as $email => $name) foreach($real_to as $email => $name)
@ -87,7 +87,7 @@ class Advanced_MailerController extends Advanced_Mailer
$obj->mail_to .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n"; $obj->mail_to .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n";
} }
} }
if ($real_cc = $mail->message->getCc()) if ($real_cc = $mail->message->getCc())
{ {
foreach($real_cc as $email => $name) foreach($real_cc as $email => $name)
@ -95,7 +95,7 @@ class Advanced_MailerController extends Advanced_Mailer
$obj->mail_to .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n"; $obj->mail_to .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n";
} }
} }
if ($real_bcc = $mail->message->getBcc()) if ($real_bcc = $mail->message->getBcc())
{ {
foreach($real_bcc as $email => $name) foreach($real_bcc as $email => $name)
@ -103,7 +103,7 @@ class Advanced_MailerController extends Advanced_Mailer
$obj->mail_to .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n"; $obj->mail_to .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n";
} }
} }
$obj->mail_from = trim($obj->mail_from); $obj->mail_from = trim($obj->mail_from);
$obj->mail_to = trim($obj->mail_to); $obj->mail_to = trim($obj->mail_to);
$obj->subject = $mail->message->getSubject(); $obj->subject = $mail->message->getSubject();
@ -118,10 +118,10 @@ class Advanced_MailerController extends Advanced_Mailer
} }
} }
} }
/** /**
* Get the default identity for sending email. * Get the default identity for sending email.
* *
* @return array * @return array
*/ */
public function getDefaultEmailIdentity() public function getDefaultEmailIdentity()
@ -134,13 +134,13 @@ class Advanced_MailerController extends Advanced_Mailer
$email = $member_config->webmaster_email; $email = $member_config->webmaster_email;
$name = $member_config->webmaster_name ?: 'webmaster'; $name = $member_config->webmaster_name ?: 'webmaster';
} }
return [$email, $name]; return [$email, $name];
} }
/** /**
* Check if an email address is on a list of exceptions. * Check if an email address is on a list of exceptions.
* *
* @param string $email * @param string $email
* @param object $config (optional) * @param object $config (optional)
* @return string|null * @return string|null
@ -151,14 +151,14 @@ class Advanced_MailerController extends Advanced_Mailer
{ {
$config = $this->getConfig(); $config = $this->getConfig();
} }
if (!isset($config->exceptions) || !is_array($config->exceptions) || !count($config->exceptions)) if (!isset($config->exceptions) || !is_array($config->exceptions) || !count($config->exceptions))
{ {
return null; return null;
} }
$email = Rhymix\Framework\URL::encodeIdna($email); $email = Rhymix\Framework\URL::encodeIdna($email);
foreach ($config->exceptions as $exception) foreach ($config->exceptions as $exception)
{ {
$domains = array(); $domains = array();
@ -171,17 +171,17 @@ class Advanced_MailerController extends Advanced_Mailer
return $exception['method']; return $exception['method'];
} }
} }
return null; return null;
} }
/** /**
* After SMS send trigger. * After SMS send trigger.
*/ */
public function triggerAfterSMSSend($sms) public function triggerAfterSMSSend($sms)
{ {
$config = $this->getConfig(); $config = $this->getConfig();
if (toBool($config->log_sent_sms ?? 'N') || (toBool($config->log_sms_errors ?? 'N') && count($sms->errors))) if (toBool($config->log_sent_sms ?? 'N') || (toBool($config->log_sms_errors ?? 'N') && count($sms->errors)))
{ {
$obj = new \stdClass(); $obj = new \stdClass();
@ -211,14 +211,14 @@ class Advanced_MailerController extends Advanced_Mailer
} }
} }
} }
/** /**
* After Push send trigger. * After Push send trigger.
*/ */
public function triggerAfterPushSend($push) public function triggerAfterPushSend($push)
{ {
$config = $this->getConfig(); $config = $this->getConfig();
if (toBool($config->log_sent_push ?? 'N') || (toBool($config->log_push_errors ?? 'N') && count($push->getErrors()))) if (toBool($config->log_sent_push ?? 'N') || (toBool($config->log_push_errors ?? 'N') && count($push->getErrors())))
{ {
$obj = new \stdClass(); $obj = new \stdClass();

View file

@ -13,6 +13,6 @@ class Advanced_MailerModel extends Advanced_Mailer
*/ */
public function triggerReplaceMailClass() public function triggerReplaceMailClass()
{ {
} }
} }

View file

@ -38,7 +38,7 @@ class communicationAdminController extends communication
$output = $oModuleController->insertModuleConfig('communication', $args); $output = $oModuleController->insertModuleConfig('communication', $args);
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispCommunicationAdminConfig'); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispCommunicationAdminConfig');
return $this->setRedirectUrl($returnUrl, $output); return $this->setRedirectUrl($returnUrl, $output);
} }

View file

@ -46,7 +46,7 @@ class communicationAdminModel extends communication
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir); $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir);
Context::set('skin_info', $skin_info); Context::set('skin_info', $skin_info);
Context::set('communication_config', CommunicationModel::getConfig()); Context::set('communication_config', CommunicationModel::getConfig());
$security = new Security(); $security = new Security();
$security->encodeHTML('skin_info.colorset..title', 'skin_info.colorset..name'); $security->encodeHTML('skin_info.colorset..title', 'skin_info.colorset..name');
$security->encodeHTML('skin_info.colorset..name'); $security->encodeHTML('skin_info.colorset..name');

View file

@ -2,7 +2,7 @@
/* Copyright (C) NAVER <http://www.navercorp.com> */ /* Copyright (C) NAVER <http://www.navercorp.com> */
/** /**
* @class communication * @class communication
* @author NAVER (developers@xpressengine.com) * @author NAVER (developers@xpressengine.com)
* communication module of the high class * communication module of the high class
*/ */
@ -22,7 +22,7 @@ class communication extends ModuleObject
function moduleInstall() function moduleInstall()
{ {
$oModuleController = getController('module'); $oModuleController = getController('module');
foreach($this->triggers as $trigger) foreach($this->triggers as $trigger)
{ {
$oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]); $oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
@ -39,7 +39,7 @@ class communication extends ModuleObject
function checkUpdate() function checkUpdate()
{ {
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');
foreach($this->triggers as $trigger) foreach($this->triggers as $trigger)
{ {
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
@ -65,7 +65,7 @@ class communication extends ModuleObject
return TRUE; return TRUE;
} }
} }
return FALSE; return FALSE;
} }
@ -77,7 +77,7 @@ class communication extends ModuleObject
{ {
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');
$oModuleController = getController('module'); $oModuleController = getController('module');
foreach($this->triggers as $trigger) foreach($this->triggers as $trigger)
{ {
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
@ -106,7 +106,7 @@ class communication extends ModuleObject
*/ */
function recompileCache() function recompileCache()
{ {
} }
} }

View file

@ -42,7 +42,7 @@ class communicationController extends communication
{ {
return $output; return $output;
} }
MemberController::clearMemberCache($args->member_srl); MemberController::clearMemberCache($args->member_srl);
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispCommunicationMessages', 'message_type', Context::get('message_type')); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispCommunicationMessages', 'message_type', Context::get('message_type'));
@ -82,7 +82,7 @@ class communicationController extends communication
{ {
throw new Rhymix\Framework\Exception('msg_content_is_null'); throw new Rhymix\Framework\Exception('msg_content_is_null');
} }
$temp_srl = intval(Context::get('temp_srl')) ?: null; $temp_srl = intval(Context::get('temp_srl')) ?: null;
if($temp_srl && !$_SESSION['upload_info'][$temp_srl]->enabled) if($temp_srl && !$_SESSION['upload_info'][$temp_srl]->enabled)
{ {
@ -241,7 +241,7 @@ class communicationController extends communication
$oDB->rollback(); $oDB->rollback();
return $output; return $output;
} }
// update attached files // update attached files
if ($temp_srl) if ($temp_srl)
{ {
@ -251,10 +251,10 @@ class communicationController extends communication
// Call a trigger (after) // Call a trigger (after)
ModuleHandler::triggerCall('communication.sendMessage', 'after', $trigger_obj); ModuleHandler::triggerCall('communication.sendMessage', 'after', $trigger_obj);
$oDB->commit(); $oDB->commit();
// create a flag that message is sent (in file format) // create a flag that message is sent (in file format)
$this->updateFlagFile($receiver_srl); $this->updateFlagFile($receiver_srl);
return new BaseObject(0, 'success_sended'); return new BaseObject(0, 'success_sended');
@ -395,7 +395,7 @@ class communicationController extends communication
{ {
return $output; return $output;
} }
// Delete attachment, only if related message has also been deleted // Delete attachment, only if related message has also been deleted
$related = $message->related_srl ? $oCommunicationModel->getSelectedMessage($message->related_srl) : true; $related = $message->related_srl ? $oCommunicationModel->getSelectedMessage($message->related_srl) : true;
if (!$related) if (!$related)
@ -404,7 +404,7 @@ class communicationController extends communication
$oFileController->deleteFiles($message->message_srl); $oFileController->deleteFiles($message->message_srl);
$oFileController->deleteFiles($message->related_srl); $oFileController->deleteFiles($message->related_srl);
} }
$this->updateFlagFile($member_srl); $this->updateFlagFile($member_srl);
$this->setMessage('success_deleted'); $this->setMessage('success_deleted');
} }
@ -467,7 +467,7 @@ class communicationController extends communication
// Organize variables // Organize variables
$args = new stdClass(); $args = new stdClass();
$args->message_srls = implode(',', $target); $args->message_srls = implode(',', $target);
if ($message_type === 'N') if ($message_type === 'N')
{ {
$args->message_type = 'R'; $args->message_type = 'R';
@ -476,7 +476,7 @@ class communicationController extends communication
{ {
$args->message_type = $message_type; $args->message_type = $message_type;
} }
if($message_type == 'S') if($message_type == 'S')
{ {
$args->sender_srl = $member_srl; $args->sender_srl = $member_srl;
@ -503,14 +503,14 @@ class communicationController extends communication
unset($related[$item->message_srl]); unset($related[$item->message_srl]);
} }
} }
// Delete // Delete
$output = executeQuery('communication.deleteMessages', $args); $output = executeQuery('communication.deleteMessages', $args);
if(!$output->toBool()) if(!$output->toBool())
{ {
return $output; return $output;
} }
// Delete attachment, only if related message has also been deleted // Delete attachment, only if related message has also been deleted
$oFileController = getController('file'); $oFileController = getController('file');
foreach ($related as $message_srl => $related_srl) foreach ($related as $message_srl => $related_srl)
@ -518,7 +518,7 @@ class communicationController extends communication
$oFileController->deleteFiles($message_srl); $oFileController->deleteFiles($message_srl);
$oFileController->deleteFiles($related_srl); $oFileController->deleteFiles($related_srl);
} }
$this->updateFlagFile($member_srl); $this->updateFlagFile($member_srl);
$this->setMessage('success_deleted'); $this->setMessage('success_deleted');
@ -549,7 +549,7 @@ class communicationController extends communication
{ {
throw new Rhymix\Framework\Exception('msg_no_self_friend'); throw new Rhymix\Framework\Exception('msg_no_self_friend');
} }
// Check duplicate friend // Check duplicate friend
$args = new stdClass(); $args = new stdClass();
$args->member_srl = $logged_info->member_srl; $args->member_srl = $logged_info->member_srl;
@ -567,7 +567,7 @@ class communicationController extends communication
{ {
return $trigger_output; return $trigger_output;
} }
// Variable // Variable
$args->friend_srl = getNextSequence(); $args->friend_srl = getNextSequence();
$args->list_order = $args->friend_srl * -1; $args->list_order = $args->friend_srl * -1;
@ -579,7 +579,7 @@ class communicationController extends communication
// Call trigger (after) // Call trigger (after)
$trigger_output = ModuleHandler::triggerCall('communication.addFriend', 'after', $args); $trigger_output = ModuleHandler::triggerCall('communication.addFriend', 'after', $args);
$this->add('member_srl', $target_srl); $this->add('member_srl', $target_srl);
$this->setMessage('success_registed'); $this->setMessage('success_registed');
@ -663,7 +663,7 @@ class communicationController extends communication
} }
/** /**
* Delete a friend * Delete a friend
* @return void|Object (success : void, fail : Object) * @return void|Object (success : void, fail : Object)
*/ */
function procCommunicationDeleteFriend() function procCommunicationDeleteFriend()
@ -693,14 +693,14 @@ class communicationController extends communication
$args = new stdClass(); $args = new stdClass();
$args->member_srl = $logged_info->member_srl; $args->member_srl = $logged_info->member_srl;
$args->friend_srl_list = $friend_srl_list; $args->friend_srl_list = $friend_srl_list;
// Call trigger (before) // Call trigger (before)
$trigger_output = ModuleHandler::triggerCall('communication.deleteFriend', 'before', $args); $trigger_output = ModuleHandler::triggerCall('communication.deleteFriend', 'before', $args);
if(!$trigger_output->toBool()) if(!$trigger_output->toBool())
{ {
return $trigger_output; return $trigger_output;
} }
// Delete // Delete
$output = executeQuery('communication.deleteFriend', $args); $output = executeQuery('communication.deleteFriend', $args);
if(!$output->toBool()) if(!$output->toBool())
@ -710,7 +710,7 @@ class communicationController extends communication
// Call trigger (after) // Call trigger (after)
$trigger_output = ModuleHandler::triggerCall('communication.deleteFriend', 'after', $args); $trigger_output = ModuleHandler::triggerCall('communication.deleteFriend', 'after', $args);
$this->setMessage('success_deleted'); $this->setMessage('success_deleted');
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispCommunicationFriend'); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispCommunicationFriend');
@ -855,7 +855,7 @@ class communicationController extends communication
/** /**
* set a message status to be 'already read' * set a message status to be 'already read'
* @param int $message_srl * @param int $message_srl
* @return Object * @return Object
*/ */
function setMessageReaded($message_srl) function setMessageReaded($message_srl)
@ -864,14 +864,14 @@ class communicationController extends communication
$args->message_srl = $message_srl; $args->message_srl = $message_srl;
$args->related_srl = $message_srl; $args->related_srl = $message_srl;
$output = executeQuery('communication.setMessageReaded', $args); $output = executeQuery('communication.setMessageReaded', $args);
// Update flag file // Update flag file
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
$this->updateFlagFile($logged_info->member_srl); $this->updateFlagFile($logged_info->member_srl);
return $output; return $output;
} }
/** /**
* Update flag file * Update flag file
* @param int $member_srl * @param int $member_srl
@ -897,12 +897,12 @@ class communicationController extends communication
// Add menus on the member login information // Add menus on the member login information
$config = getModel('communication')->getConfig(); $config = getModel('communication')->getConfig();
$oMemberController = getController('member'); $oMemberController = getController('member');
if($config->enable_message == 'Y') if($config->enable_message == 'Y')
{ {
$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box'); $oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
} }
if($config->enable_friend == 'Y') if($config->enable_friend == 'Y')
{ {
$oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend'); $oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
@ -921,10 +921,10 @@ class communicationController extends communication
{ {
return; return;
} }
$oCommunicationModel = getModel('communication'); $oCommunicationModel = getModel('communication');
$config = $oCommunicationModel->getConfig(); $config = $oCommunicationModel->getConfig();
if($config->enable_message == 'N' && $config->enable_friend == 'N') if($config->enable_message == 'N' && $config->enable_friend == 'N')
{ {
return; return;
@ -933,12 +933,12 @@ class communicationController extends communication
{ {
return; return;
} }
$mid = Context::get('cur_mid'); $mid = Context::get('cur_mid');
$member_srl = Context::get('target_srl'); $member_srl = Context::get('target_srl');
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
$oMemberController = getController('member'); $oMemberController = getController('member');
// Add a feature to display own message box. // Add a feature to display own message box.
if($logged_info->member_srl == $member_srl) if($logged_info->member_srl == $member_srl)
{ {
@ -947,7 +947,7 @@ class communicationController extends communication
{ {
$oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationMessages'), 'cmd_view_message_box', '', 'self'); $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationMessages'), 'cmd_view_message_box', '', 'self');
} }
// Display a list of friends // Display a list of friends
if($config->enable_friend == 'Y') if($config->enable_friend == 'Y')
{ {
@ -970,7 +970,7 @@ class communicationController extends communication
{ {
$oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup'); $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup');
} }
// Add a menu for listing friends (if a friend is new) // Add a menu for listing friends (if a friend is new)
if($config->enable_friend == 'Y' && !$oCommunicationModel->isAddedFriend($member_srl)) if($config->enable_friend == 'Y' && !$oCommunicationModel->isAddedFriend($member_srl))
{ {

View file

@ -41,7 +41,7 @@ class communicationMobile extends communicationView
$this->module_info->mlayout_srl = $this->config->mlayout_srl; $this->module_info->mlayout_srl = $this->config->mlayout_srl;
$this->setLayoutPath($layout_info->path); $this->setLayoutPath($layout_info->path);
} }
$this->setTemplatePath($template_path); $this->setTemplatePath($template_path);
} }

View file

@ -30,7 +30,7 @@ class communicationModel extends communication
{ {
$config = new stdClass(); $config = new stdClass();
} }
$config->enable_message = $config->enable_message ?? 'Y'; $config->enable_message = $config->enable_message ?? 'Y';
$config->enable_friend = $config->enable_friend ?? 'Y'; $config->enable_friend = $config->enable_friend ?? 'Y';
$config->enable_attachment = $config->enable_attachment ?? 'N'; $config->enable_attachment = $config->enable_attachment ?? 'N';
@ -42,12 +42,12 @@ class communicationModel extends communication
$config->mskin = $config->mskin ?? 'default'; $config->mskin = $config->mskin ?? 'default';
$config->mcolorset = $config->mcolorset ?? 'white'; $config->mcolorset = $config->mcolorset ?? 'white';
$config->grant_send = $config->grant_send ?? array('default' => 'member'); $config->grant_send = $config->grant_send ?? array('default' => 'member');
return $config; return $config;
} }
/** /**
* @brief get grant array for insert to database. table module_config's config field * @brief get grant array for insert to database. table module_config's config field
* @param string $default * @param string $default
* @param array $group * @param array $group
* @return array * @return array
@ -59,17 +59,17 @@ class communicationModel extends communication
{ {
$grant = array('default' => $default); $grant = array('default' => $default);
} }
else if(is_array($group)) else if(is_array($group))
{ {
$grant_group = array(); $grant_group = array();
foreach($group as $group_srl) foreach($group as $group_srl)
{ {
$grant_group[$group_srl] = true; $grant_group[$group_srl] = true;
} }
$grant = array('group' => $grant_group); $grant = array('group' => $grant_group);
} }
return $grant; return $grant;
} }
@ -81,7 +81,7 @@ class communicationModel extends communication
public static function checkGrant($arrGrant) public static function checkGrant($arrGrant)
{ {
if(!$arrGrant) return false; if(!$arrGrant) return false;
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
if($logged_info->is_admin == 'Y') return true; if($logged_info->is_admin == 'Y') return true;
@ -194,7 +194,7 @@ class communicationModel extends communication
$oCommunicationController = getController('communication'); $oCommunicationController = getController('communication');
$oCommunicationController->setMessageReaded($message->message_srl); $oCommunicationController->setMessageReaded($message->message_srl);
if (!$message->member_srl) if (!$message->member_srl)
{ {
$message->member_srl = $message->sender_srl; $message->member_srl = $message->sender_srl;
@ -280,13 +280,13 @@ class communicationModel extends communication
$message->user_name = $message->nick_name; $message->user_name = $message->nick_name;
} }
} }
return $output; return $output;
} }
/** /**
* Get a list of files attached to a message. * Get a list of files attached to a message.
* *
* @param object $message * @param object $message
* @return array * @return array
*/ */
@ -318,7 +318,7 @@ class communicationModel extends communication
$args->page_count = 10; $args->page_count = 10;
$output = executeQuery('communication.getFriends', $args, $columnList); $output = executeQuery('communication.getFriends', $args, $columnList);
return $output; return $output;
} }
@ -334,7 +334,7 @@ class communicationModel extends communication
$args = new stdClass(); $args = new stdClass();
$args->member_srl = $logged_info->member_srl; $args->member_srl = $logged_info->member_srl;
$args->target_srl = $member_srl; $args->target_srl = $member_srl;
$output = executeQuery('communication.isAddedFriend', $args); $output = executeQuery('communication.isAddedFriend', $args);
return $output->data->count; return $output->data->count;
@ -354,7 +354,7 @@ class communicationModel extends communication
$args->friend_group_srl = $friend_group_srl; $args->friend_group_srl = $friend_group_srl;
$output = executeQuery('communication.getFriendGroup', $args); $output = executeQuery('communication.getFriendGroup', $args);
return $output->data; return $output->data;
} }
@ -372,15 +372,15 @@ class communicationModel extends communication
$friend_group_list = array(); $friend_group_list = array();
foreach ($output->data as $item) foreach ($output->data as $item)
{ {
$friend_group_list[$item->friend_group_srl] = $item; $friend_group_list[$item->friend_group_srl] = $item;
} }
return $friend_group_list; return $friend_group_list;
} }
/** /**
* check whether to be added in the friend list * check whether to be added in the friend list
* @param int $target_srl * @param int $target_srl
* @return boolean (true : friend, false : not friend) * @return boolean (true : friend, false : not friend)
*/ */
public static function isFriend($target_srl) public static function isFriend($target_srl)
{ {

View file

@ -54,7 +54,7 @@ class communicationView extends communication
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
// Error appears if not logged-in // Error appears if not logged-in
if(!Context::get('is_logged')) if(!Context::get('is_logged'))
{ {
@ -117,7 +117,7 @@ class communicationView extends communication
stripEmbedTagForAdmin($message->content, $message->sender_srl); stripEmbedTagForAdmin($message->content, $message->sender_srl);
Context::set('message', $message); Context::set('message', $message);
Context::set('message_files', CommunicationModel::getMessageFiles($message)); Context::set('message_files', CommunicationModel::getMessageFiles($message));
if(Mobile::isFromMobilePhone() && file_exists($this->getTemplatePath() . 'read_message.html')) if(Mobile::isFromMobilePhone() && file_exists($this->getTemplatePath() . 'read_message.html'))
{ {
$template_filename = 'read_message'; $template_filename = 'read_message';
@ -132,7 +132,7 @@ class communicationView extends communication
// Extract a list // Extract a list
$columnList = array('message_srl', 'message_type', 'related_srl', 'readed', 'title', 'member.member_srl', 'member.nick_name', 'message.regdate', 'readed_date'); $columnList = array('message_srl', 'message_type', 'related_srl', 'readed', 'title', 'member.member_srl', 'member.nick_name', 'message.regdate', 'readed_date');
$output = $oCommunicationModel->getMessages($message_type, $columnList); $output = $oCommunicationModel->getMessages($message_type, $columnList);
// set a template file // set a template file
Context::set('total_count', $output->total_count); Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page); Context::set('total_page', $output->total_page);
@ -159,7 +159,7 @@ class communicationView extends communication
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
// Error appears if not logged-in // Error appears if not logged-in
if(!Context::get('is_logged')) if(!Context::get('is_logged'))
{ {
@ -200,13 +200,13 @@ class communicationView extends communication
{ {
throw new Rhymix\Framework\Exceptions\NotPermitted; throw new Rhymix\Framework\Exceptions\NotPermitted;
} }
// Fix missing mid (it causes errors when uploading) // Fix missing mid (it causes errors when uploading)
if(!Context::get('mid')) if(!Context::get('mid'))
{ {
Context::set('mid', Context::get('site_module_info')->mid); Context::set('mid', Context::get('site_module_info')->mid);
} }
// Error appears if not logged-in // Error appears if not logged-in
if(!Context::get('is_logged')) if(!Context::get('is_logged'))
{ {
@ -231,7 +231,7 @@ class communicationView extends communication
$oCommunicationModel = getModel('communication'); $oCommunicationModel = getModel('communication');
$oMemberModel = getModel('member'); $oMemberModel = getModel('member');
// get message_srl of the original message if it is a reply // get message_srl of the original message if it is a reply
$message_srl = Context::get('message_srl'); $message_srl = Context::get('message_srl');
if($message_srl) if($message_srl)
@ -292,13 +292,13 @@ class communicationView extends communication
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
// Error appears if not logged-in // Error appears if not logged-in
if(!Context::get('is_logged')) if(!Context::get('is_logged'))
{ {
throw new Rhymix\Framework\Exceptions\MustLogin; throw new Rhymix\Framework\Exceptions\MustLogin;
} }
$oCommunicationModel = getModel('communication'); $oCommunicationModel = getModel('communication');
// get a group list // get a group list
@ -346,12 +346,12 @@ class communicationView extends communication
{ {
$this->setLayoutPath('./common/tpl/'); $this->setLayoutPath('./common/tpl/');
$this->setLayoutFile("popup_layout"); $this->setLayoutFile("popup_layout");
if($this->config->enable_friend == 'N') if($this->config->enable_friend == 'N')
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
// error appears if not logged-in // error appears if not logged-in
if(!Context::get('is_logged')) if(!Context::get('is_logged'))
{ {
@ -396,12 +396,12 @@ class communicationView extends communication
{ {
$this->setLayoutPath('./common/tpl/'); $this->setLayoutPath('./common/tpl/');
$this->setLayoutFile("popup_layout"); $this->setLayoutFile("popup_layout");
if($this->config->enable_friend == 'N') if($this->config->enable_friend == 'N')
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
// error apprears if not logged-in // error apprears if not logged-in
if(!Context::get('is_logged')) if(!Context::get('is_logged'))
{ {

View file

@ -144,7 +144,7 @@ class editorAdminController extends editor
{ {
$oModuleController = getController('module'); $oModuleController = getController('module');
$configVars = Context::getRequestVars(); $configVars = Context::getRequestVars();
$config = new stdClass; $config = new stdClass;
$config->editor_skin = $configVars->editor_skin; $config->editor_skin = $configVars->editor_skin;
$config->editor_colorset = $configVars->editor_colorset; $config->editor_colorset = $configVars->editor_colorset;
@ -166,7 +166,7 @@ class editorAdminController extends editor
$config->mobile_comment_editor_height = $configVars->mobile_comment_editor_height; $config->mobile_comment_editor_height = $configVars->mobile_comment_editor_height;
$config->mobile_comment_editor_toolbar = $configVars->mobile_comment_editor_toolbar; $config->mobile_comment_editor_toolbar = $configVars->mobile_comment_editor_toolbar;
$config->mobile_comment_editor_toolbar_hide = $configVars->mobile_comment_editor_toolbar_hide === 'Y' ? 'Y' : 'N'; $config->mobile_comment_editor_toolbar_hide = $configVars->mobile_comment_editor_toolbar_hide === 'Y' ? 'Y' : 'N';
if ($configVars->font_defined === 'Y') if ($configVars->font_defined === 'Y')
{ {
$config->font_defined = 'Y'; $config->font_defined = 'Y';
@ -177,7 +177,7 @@ class editorAdminController extends editor
$config->font_defined = $configVars->font_defined = 'N'; $config->font_defined = $configVars->font_defined = 'N';
$config->content_font = $configVars->content_font; $config->content_font = $configVars->content_font;
} }
if ($configVars->additional_css) if ($configVars->additional_css)
{ {
$additional_css = array_map('trim', explode("\n", $configVars->additional_css)); $additional_css = array_map('trim', explode("\n", $configVars->additional_css));
@ -188,7 +188,7 @@ class editorAdminController extends editor
{ {
$config->additional_css = array(); $config->additional_css = array();
} }
if ($configVars->additional_mobile_css) if ($configVars->additional_mobile_css)
{ {
$additional_mobile_css = array_map('trim', explode("\n", $configVars->additional_mobile_css)); $additional_mobile_css = array_map('trim', explode("\n", $configVars->additional_mobile_css));
@ -199,7 +199,7 @@ class editorAdminController extends editor
{ {
$config->additional_mobile_css = array(); $config->additional_mobile_css = array();
} }
if ($configVars->additional_plugins) if ($configVars->additional_plugins)
{ {
$additional_plugins = array_map('trim', explode(',', $configVars->additional_plugins)); $additional_plugins = array_map('trim', explode(',', $configVars->additional_plugins));
@ -210,7 +210,7 @@ class editorAdminController extends editor
{ {
$config->additional_plugins = array(); $config->additional_plugins = array();
} }
if ($configVars->remove_plugins) if ($configVars->remove_plugins)
{ {
$remove_plugins = array_map('trim', explode(',', $configVars->remove_plugins)); $remove_plugins = array_map('trim', explode(',', $configVars->remove_plugins));
@ -221,7 +221,7 @@ class editorAdminController extends editor
{ {
$config->remove_plugins = array(); $config->remove_plugins = array();
} }
$config->content_font_size = trim($configVars->content_font_size); $config->content_font_size = trim($configVars->content_font_size);
$config->content_font_size = ctype_digit($config->content_font_size) ? ($config->content_font_size . 'px') : $config->content_font_size; $config->content_font_size = ctype_digit($config->content_font_size) ? ($config->content_font_size . 'px') : $config->content_font_size;
$config->content_line_height = trim($configVars->content_line_height); $config->content_line_height = trim($configVars->content_line_height);

View file

@ -36,7 +36,7 @@ class editorAdminView extends editor
$editor_config->$key = $val; $editor_config->$key = $val;
} }
} }
// Get skin info // Get skin info
$editor_skin_list = array(); $editor_skin_list = array();
$skin_dir_list = FileHandler::readDir($this->module_path . 'skins'); $skin_dir_list = FileHandler::readDir($this->module_path . 'skins');
@ -46,7 +46,7 @@ class editorAdminView extends editor
{ {
continue; continue;
} }
$skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin); $skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin);
foreach ($skin_info->colorset ?: [] as $colorset) foreach ($skin_info->colorset ?: [] as $colorset)
{ {
@ -81,7 +81,7 @@ class editorAdminView extends editor
$xml_info->need_update = $packages[$xml_info->package_srl]->need_update; $xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
} }
} }
Context::set('editor_config', $editor_config); Context::set('editor_config', $editor_config);
Context::set('editor_skin_list', $editor_skin_list); Context::set('editor_skin_list', $editor_skin_list);
Context::set('component_list', $component_list); Context::set('component_list', $component_list);
@ -108,7 +108,7 @@ class editorAdminView extends editor
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
Context::set('component', $component); Context::set('component', $component);
// Get a group list to set a group // Get a group list to set a group
$group_list = MemberModel::getGroups(0); $group_list = MemberModel::getGroups(0);
Context::set('group_list', $group_list); Context::set('group_list', $group_list);

View file

@ -3,7 +3,7 @@
/** /**
* @class editorAPI * @class editorAPI
* @author NAVER (developers@xpressengine.com) * @author NAVER (developers@xpressengine.com)
* @brief * @brief
*/ */
class editorAPI extends editor class editorAPI extends editor
{ {

View file

@ -3,7 +3,7 @@
/** /**
* @class editor * @class editor
* @author NAVER (developers@xpressengine.com) * @author NAVER (developers@xpressengine.com)
* @brief high class of the editor odule * @brief high class of the editor odule
*/ */
class editor extends ModuleObject class editor extends ModuleObject
{ {
@ -17,7 +17,7 @@ class editor extends ModuleObject
'default_paragraph_spacing' => '0', 'default_paragraph_spacing' => '0',
'default_word_break' => 'normal', 'default_word_break' => 'normal',
); );
/** /**
* @brief Default editor config * @brief Default editor config
*/ */
@ -58,7 +58,7 @@ class editor extends ModuleObject
'additional_plugins' => array(), 'additional_plugins' => array(),
'remove_plugins' => array('liststyle', 'tabletools', 'tableselection', 'contextmenu', 'exportpdf'), 'remove_plugins' => array('liststyle', 'tabletools', 'tableselection', 'contextmenu', 'exportpdf'),
); );
/** /**
* @brief Implement if additional tasks are necessary when installing * @brief Implement if additional tasks are necessary when installing
*/ */
@ -104,7 +104,7 @@ class editor extends ModuleObject
// 2009. 06. 19 Remove unused trigger // 2009. 06. 19 Remove unused trigger
if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true; if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true;
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true; if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true;
return false; return false;
@ -117,7 +117,7 @@ class editor extends ModuleObject
{ {
$oDB = DB::getInstance(); $oDB = DB::getInstance();
$oModuleController = getController('module'); $oModuleController = getController('module');
// XEVE-17-030 // XEVE-17-030
if(!$oDB->isColumnExists('editor_autosave', 'certify_key')) if(!$oDB->isColumnExists('editor_autosave', 'certify_key'))
{ {
@ -127,23 +127,23 @@ class editor extends ModuleObject
{ {
$oDB->addIndex('editor_autosave', 'idx_certify_key', 'certify_key'); $oDB->addIndex('editor_autosave', 'idx_certify_key', 'certify_key');
} }
// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified // 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
if(!ModuleModel::getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) if(!ModuleModel::getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
$oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
if(!ModuleModel::getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) if(!ModuleModel::getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
$oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
// 2007. 10. Add an editor trigger on the module addition setup // 2007. 10. Add an editor trigger on the module addition setup
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'))
$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'); $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
// 2009. 04. 14 Add a trigger from compiled codes of the editor component // 2009. 04. 14 Add a trigger from compiled codes of the editor component
if(!ModuleModel::getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) if(!ModuleModel::getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'))
$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'); $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
// 2009. 06. 19 Remove unused trigger // 2009. 06. 19 Remove unused trigger
if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'))
$oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'); $oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before');
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'))
{ {
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'); $oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after');

View file

@ -87,7 +87,7 @@ class editorController extends editor
{ {
// Get request vars // Get request vars
$vars = Context::getRequestVars(); $vars = Context::getRequestVars();
// To configure many of modules at once // To configure many of modules at once
$target_module_srl = $vars->target_module_srl; $target_module_srl = $vars->target_module_srl;
$target_module_srl = array_map('trim', explode(',', $target_module_srl)); $target_module_srl = array_map('trim', explode(',', $target_module_srl));
@ -119,7 +119,7 @@ class editorController extends editor
{ {
$config->default_editor_settings = 'N'; $config->default_editor_settings = 'N';
} }
// Apply module-specific editor settings. // Apply module-specific editor settings.
$config->editor_skin = $vars->editor_skin; $config->editor_skin = $vars->editor_skin;
$config->editor_colorset = $vars->editor_colorset; $config->editor_colorset = $vars->editor_colorset;
@ -152,7 +152,7 @@ class editorController extends editor
$config->font_defined = $vars->font_defined = 'N'; $config->font_defined = $vars->font_defined = 'N';
$config->content_font = $vars->content_font; $config->content_font = $vars->content_font;
} }
$config->content_font_size = trim($vars->content_font_size); $config->content_font_size = trim($vars->content_font_size);
$config->enable_autosave = $vars->enable_autosave ?: 'Y'; $config->enable_autosave = $vars->enable_autosave ?: 'Y';
$config->auto_dark_mode = $vars->auto_dark_mode ?: 'Y'; $config->auto_dark_mode = $vars->auto_dark_mode ?: 'Y';
@ -217,7 +217,7 @@ class editorController extends editor
{ {
$editor_config = getModel('module')->getModuleConfig('editor'); $editor_config = getModel('module')->getModuleConfig('editor');
} }
if ($editor_config) if ($editor_config)
{ {
$default_font_config = self::$default_font_config; $default_font_config = self::$default_font_config;
@ -457,7 +457,7 @@ class editorController extends editor
{ {
$xml_info->mid_list = $extra_vars->mid_list; $xml_info->mid_list = $extra_vars->mid_list;
} }
// Check the configuration of the editor component // Check the configuration of the editor component
if(!empty($xml_info->extra_vars)) if(!empty($xml_info->extra_vars))
{ {
@ -469,7 +469,7 @@ class editorController extends editor
} }
$component_list->{$component_name} = $xml_info; $component_list->{$component_name} = $xml_info;
// Get buttons, icons, images // Get buttons, icons, images
$icon_file = RX_BASEDIR . 'modules/editor/components/'.$component_name.'/icon.gif'; $icon_file = RX_BASEDIR . 'modules/editor/components/'.$component_name.'/icon.gif';
$component_icon_file = RX_BASEDIR . 'modules/editor/components/'.$component_name.'/component_icon.gif'; $component_icon_file = RX_BASEDIR . 'modules/editor/components/'.$component_name.'/component_icon.gif';
@ -500,7 +500,7 @@ class editorController extends editor
{ {
Rhymix\Framework\Cache::set('editor:components:all', $component_list, 0, true); Rhymix\Framework\Cache::set('editor:components:all', $component_list, 0, true);
} }
return $component_list; return $component_list;
} }

View file

@ -12,7 +12,7 @@ class editorModel extends editor
*/ */
protected static $_module_config = array(); protected static $_module_config = array();
protected static $_loaded_component_list = array(); protected static $_loaded_component_list = array();
/** /**
* @brief Return the editor * @brief Return the editor
* *
@ -45,7 +45,7 @@ class editorModel extends editor
{ {
$editor_config = new stdClass; $editor_config = new stdClass;
} }
// Fill in some other values. // Fill in some other values.
$grant_vars = array( $grant_vars = array(
'enable_html_grant', 'enable_html_grant',
@ -64,10 +64,10 @@ class editorModel extends editor
$editor_config->{$var} = []; $editor_config->{$var} = [];
} }
} }
// Load the default config for editor module. // Load the default config for editor module.
$editor_default_config = ModuleModel::getModuleConfig('editor') ?: new stdClass; $editor_default_config = ModuleModel::getModuleConfig('editor') ?: new stdClass;
// Check whether we should use the default config. // Check whether we should use the default config.
if(!isset($editor_config->default_editor_settings) || $editor_config->default_editor_settings !== 'Y') if(!isset($editor_config->default_editor_settings) || $editor_config->default_editor_settings !== 'Y')
{ {
@ -80,7 +80,7 @@ class editorModel extends editor
{ {
$editor_config->default_editor_settings = 'Y'; $editor_config->default_editor_settings = 'Y';
} }
// Apply the default config for missing values. // Apply the default config for missing values.
foreach (self::$default_editor_config as $key => $val) foreach (self::$default_editor_config as $key => $val)
{ {
@ -89,7 +89,7 @@ class editorModel extends editor
$editor_config->$key = isset($editor_default_config->$key) ? $editor_default_config->$key : $val; $editor_config->$key = isset($editor_default_config->$key) ? $editor_default_config->$key : $val;
} }
} }
return $editor_config; return $editor_config;
} }
@ -99,7 +99,7 @@ class editorModel extends editor
public static function getSkinConfig($skin_name) public static function getSkinConfig($skin_name)
{ {
$skin_config = new stdClass; $skin_config = new stdClass;
if($skin_info = ModuleModel::loadSkinInfo('./modules/editor', $skin_name)) if($skin_info = ModuleModel::loadSkinInfo('./modules/editor', $skin_name))
{ {
foreach ($skin_info->extra_vars as $val) foreach ($skin_info->extra_vars as $val)
@ -107,7 +107,7 @@ class editorModel extends editor
$skin_config->{$val->name} = $val->value; $skin_config->{$val->name} = $val->value;
} }
} }
return $skin_config; return $skin_config;
} }
@ -120,12 +120,12 @@ class editorModel extends editor
{ {
// Load language files. // Load language files.
Context::loadLang('./modules/editor/lang'); Context::loadLang('./modules/editor/lang');
// Initialize options. // Initialize options.
if (!is_object($option)) if (!is_object($option))
{ {
$option = new stdClass; $option = new stdClass;
} }
// Set editor sequence and upload options. // Set editor sequence and upload options.
if ($upload_target_srl) if ($upload_target_srl)
@ -140,7 +140,7 @@ class editorModel extends editor
Context::set('allow_fileupload', $option->allow_fileupload = toBool($option->allow_fileupload)); Context::set('allow_fileupload', $option->allow_fileupload = toBool($option->allow_fileupload));
Context::set('upload_target_srl', $upload_target_srl); Context::set('upload_target_srl', $upload_target_srl);
Context::set('editor_sequence', $option->editor_sequence); Context::set('editor_sequence', $option->editor_sequence);
// Check that the skin exist. // Check that the skin exist.
if (!$option->editor_skin) if (!$option->editor_skin)
{ {
@ -173,7 +173,7 @@ class editorModel extends editor
Context::set('editor_toolbar', $option->editor_toolbar); Context::set('editor_toolbar', $option->editor_toolbar);
Context::set('editor_toolbar_hide', toBool($option->editor_toolbar_hide)); Context::set('editor_toolbar_hide', toBool($option->editor_toolbar_hide));
Context::set('module_type', $option->module_type); Context::set('module_type', $option->module_type);
// Default font setting // Default font setting
Context::set('content_font', $option->content_font); Context::set('content_font', $option->content_font);
Context::set('content_font_size', $option->content_font_size); Context::set('content_font_size', $option->content_font_size);
@ -185,13 +185,13 @@ class editorModel extends editor
Context::set('editor_additional_css', $option->additional_css); Context::set('editor_additional_css', $option->additional_css);
Context::set('editor_additional_plugins', $option->additional_plugins); Context::set('editor_additional_plugins', $option->additional_plugins);
Context::set('editor_remove_plugins', $option->remove_plugins); Context::set('editor_remove_plugins', $option->remove_plugins);
// Set the primary key valueof the document or comments // Set the primary key valueof the document or comments
Context::set('editor_primary_key_name', $option->primary_key_name); Context::set('editor_primary_key_name', $option->primary_key_name);
// Set content column name to sync contents // Set content column name to sync contents
Context::set('editor_content_key_name', $option->content_key_name); Context::set('editor_content_key_name', $option->content_key_name);
// Set autosave (do not use if the post is edited) // Set autosave (do not use if the post is edited)
$option->enable_autosave = toBool($option->enable_autosave) && !Context::get($option->primary_key_name); $option->enable_autosave = toBool($option->enable_autosave) && !Context::get($option->primary_key_name);
if ($option->enable_autosave) if ($option->enable_autosave)
@ -199,12 +199,12 @@ class editorModel extends editor
Context::set('saved_doc', self::getSavedDoc($upload_target_srl)); Context::set('saved_doc', self::getSavedDoc($upload_target_srl));
} }
Context::set('enable_autosave', $option->enable_autosave); Context::set('enable_autosave', $option->enable_autosave);
// Set allow html and focus // Set allow html and focus
Context::set('allow_html', ($option->allow_html === false || $option->allow_html === 'N') ? false : true); Context::set('allow_html', ($option->allow_html === false || $option->allow_html === 'N') ? false : true);
Context::set('editor_focus', toBool($option->editor_focus)); Context::set('editor_focus', toBool($option->editor_focus));
Context::set('editor_auto_dark_mode', $option->auto_dark_mode !== 'N'); Context::set('editor_auto_dark_mode', $option->auto_dark_mode !== 'N');
// Load editor components. // Load editor components.
if($option->enable_component) if($option->enable_component)
{ {
@ -241,7 +241,7 @@ class editorModel extends editor
{ {
$file_config->allowed_chunk_size = floor($file_config->allowed_chunk_size / 65536) * 65536; $file_config->allowed_chunk_size = floor($file_config->allowed_chunk_size / 65536) * 65536;
} }
// Do not allow chunked uploads in IE < 10, Android browser, and Opera // Do not allow chunked uploads in IE < 10, Android browser, and Opera
$browser = Rhymix\Framework\UA::getBrowserInfo(); $browser = Rhymix\Framework\UA::getBrowserInfo();
if (($browser->browser === 'IE' && version_compare($browser->version, '10', '<')) || $browser->browser === 'Android' || $browser->browser === 'Opera') if (($browser->browser === 'IE' && version_compare($browser->version, '10', '<')) || $browser->browser === 'Android' || $browser->browser === 'Opera')
@ -268,7 +268,7 @@ class editorModel extends editor
// Compile and return the editor skin template. // Compile and return the editor skin template.
$tpl_path = Context::get('editor_path'); $tpl_path = Context::get('editor_path');
Context::loadLang($tpl_path.'lang'); Context::loadLang($tpl_path.'lang');
$oTemplate = TemplateHandler::getInstance(); $oTemplate = TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, 'editor.html'); return $oTemplate->compile($tpl_path, 'editor.html');
} }
@ -287,7 +287,7 @@ class editorModel extends editor
// Check mobile status // Check mobile status
$is_mobile = Mobile::isFromMobilePhone() || \Rhymix\Framework\UA::isMobile(); $is_mobile = Mobile::isFromMobilePhone() || \Rhymix\Framework\UA::isMobile();
// Initialize options // Initialize options
$option = new stdClass(); $option = new stdClass();
$option->module_type = $type; $option->module_type = $type;
@ -335,7 +335,7 @@ class editorModel extends editor
$option->additional_css = $option->additional_mobile_css; $option->additional_css = $option->additional_mobile_css;
} }
} }
// Check a group_list of the currently logged-in user for permission check // Check a group_list of the currently logged-in user for permission check
if(Context::get('is_logged')) if(Context::get('is_logged'))
{ {
@ -346,7 +346,7 @@ class editorModel extends editor
{ {
$group_list = array(); $group_list = array();
} }
// Permission check for file upload // Permission check for file upload
if($module_srl) if($module_srl)
{ {
@ -367,7 +367,7 @@ class editorModel extends editor
} }
} }
} }
// Permission check for using default components // Permission check for using default components
if ($logged_info->is_admin === 'Y' || !count($option->enable_default_component_grant)) if ($logged_info->is_admin === 'Y' || !count($option->enable_default_component_grant))
{ {
@ -385,7 +385,7 @@ class editorModel extends editor
} }
} }
} }
// Permisshion check for using extended components // Permisshion check for using extended components
if($logged_info->is_admin === 'Y' || !count($option->enable_component_grant)) if($logged_info->is_admin === 'Y' || !count($option->enable_component_grant))
{ {
@ -403,7 +403,7 @@ class editorModel extends editor
} }
} }
} }
// HTML editing privileges // HTML editing privileges
if($logged_info->is_admin === 'Y' || !count($option->enable_html_grant)) if($logged_info->is_admin === 'Y' || !count($option->enable_html_grant))
{ {
@ -421,7 +421,7 @@ class editorModel extends editor
} }
} }
} }
// Other settings // Other settings
$option->primary_key_name = $primary_key_name; $option->primary_key_name = $primary_key_name;
$option->content_key_name = $content_key_name; $option->content_key_name = $content_key_name;
@ -468,7 +468,7 @@ class editorModel extends editor
{ {
$saved_doc = array_first($saved_doc); $saved_doc = array_first($saved_doc);
} }
// Return null if certify key does not match // Return null if certify key does not match
if($saved_doc->certify_key && !isset($auto_save_args->certify_key)) if($saved_doc->certify_key && !isset($auto_save_args->certify_key))
{ {
@ -683,7 +683,7 @@ class editorModel extends editor
$xml_file = sprintf('%sinfo.xml', $component_path); $xml_file = sprintf('%sinfo.xml', $component_path);
$xml_mtime = filemtime($xml_file); $xml_mtime = filemtime($xml_file);
$lang_type = Context::getLangType(); $lang_type = Context::getLangType();
// Get from cache // Get from cache
$cache_key = sprintf('editor:component:%s:%s:%d', $component, $lang_type, $xml_mtime); $cache_key = sprintf('editor:component:%s:%s:%d', $component, $lang_type, $xml_mtime);
$info = Rhymix\Framework\Cache::get($cache_key); $info = Rhymix\Framework\Cache::get($cache_key);
@ -691,15 +691,15 @@ class editorModel extends editor
{ {
return $info; return $info;
} }
// Parse XML file // Parse XML file
$info = Rhymix\Framework\Parsers\EditorComponentParser::loadXML($xml_file, $component, $lang_type); $info = Rhymix\Framework\Parsers\EditorComponentParser::loadXML($xml_file, $component, $lang_type);
// Set to cache and return // Set to cache and return
Rhymix\Framework\Cache::set($cache_key, $info, 0, true); Rhymix\Framework\Cache::set($cache_key, $info, 0, true);
return $info; return $info;
} }
/** /**
* Return converted content * Return converted content
* @param object $obj * @param object $obj
@ -709,7 +709,7 @@ class editorModel extends editor
{ {
$converter = null; $converter = null;
$config = self::getEditorConfig($obj->module_srl); $config = self::getEditorConfig($obj->module_srl);
// Get editor skin // Get editor skin
if (in_array($type, array('document', 'comment'))) if (in_array($type, array('document', 'comment')))
{ {
@ -720,13 +720,13 @@ class editorModel extends editor
$converter = $obj->converter; $converter = $obj->converter;
$skin = $obj->editor_skin ?: $config->editor_skin; $skin = $obj->editor_skin ?: $config->editor_skin;
} }
// if not inserted converter, Get converter from skin // if not inserted converter, Get converter from skin
if (!$converter) if (!$converter)
{ {
$converter = self::getSkinConfig($skin)->converter; $converter = self::getSkinConfig($skin)->converter;
} }
// if not inserted converter, Check // if not inserted converter, Check
if (!$converter) if (!$converter)
{ {
@ -743,7 +743,7 @@ class editorModel extends editor
$converter = 'nl2br'; $converter = 'nl2br';
} }
} }
// Convert // Convert
if ($converter) if ($converter)
{ {
@ -751,13 +751,13 @@ class editorModel extends editor
{ {
// Remove Tag // Remove Tag
$obj->content = strip_tags($obj->content); $obj->content = strip_tags($obj->content);
// Trim space // Trim space
$obj->content = utf8_trim($obj->content); $obj->content = utf8_trim($obj->content);
// Escape // Escape
$obj->content = escape($obj->content, false); $obj->content = escape($obj->content, false);
// Insert HTML line // Insert HTML line
$obj->content = nl2br($obj->content); $obj->content = nl2br($obj->content);
} }
@ -778,7 +778,7 @@ class editorModel extends editor
$obj->content = nl2br($obj->content); $obj->content = nl2br($obj->content);
} }
} }
return $obj->content; return $obj->content;
} }
} }

View file

@ -24,7 +24,7 @@ class editorView extends editor
$parent_input_id = Context::get('parent_input_id'); $parent_input_id = Context::get('parent_input_id');
Context::set('parent_input_id', preg_replace('/[^a-z0-9_]/i', '', $parent_input_id)); Context::set('parent_input_id', preg_replace('/[^a-z0-9_]/i', '', $parent_input_id));
Context::addBodyClass('disable_debug_panel'); Context::addBodyClass('disable_debug_panel');
// Load editor // Load editor
$oEditorModel = getModel('editor'); $oEditorModel = getModel('editor');
$option = $oEditorModel->getEditorConfig(); $option = $oEditorModel->getEditorConfig();
@ -40,7 +40,7 @@ class editorView extends editor
$option->editor_focus = 'Y'; $option->editor_focus = 'Y';
$editor = $oEditorModel->getEditor(0, $option); $editor = $oEditorModel->getEditor(0, $option);
Context::set('editor', $editor); Context::set('editor', $editor);
// Set template // Set template
$this->setLayoutPath('./common/tpl/'); $this->setLayoutPath('./common/tpl/');
$this->setLayoutFile("default_layout"); $this->setLayoutFile("default_layout");
@ -124,7 +124,7 @@ class editorView extends editor
$current_module_srl = $current_module_info->module_srl; $current_module_srl = $current_module_info->module_srl;
if(!$current_module_srl) return new BaseObject(); if(!$current_module_srl) return new BaseObject();
} }
// Get editors settings // Get editors settings
$oEditorModel = getModel('editor'); $oEditorModel = getModel('editor');
$editor_config = $oEditorModel->getEditorConfig($current_module_srl); $editor_config = $oEditorModel->getEditorConfig($current_module_srl);
@ -151,7 +151,7 @@ class editorView extends editor
{ {
continue; continue;
} }
$skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin); $skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin);
foreach ($skin_info->colorset ?: [] as $colorset) foreach ($skin_info->colorset ?: [] as $colorset)
{ {
@ -162,7 +162,7 @@ class editorView extends editor
Context::set('editor_config', $editor_config); Context::set('editor_config', $editor_config);
Context::set('editor_skin_list', $editor_skin_list); Context::set('editor_skin_list', $editor_skin_list);
// Get a group list // Get a group list
$group_list = MemberModel::getGroups(); $group_list = MemberModel::getGroups();
Context::set('group_list', $group_list); Context::set('group_list', $group_list);
@ -195,7 +195,7 @@ class editorView extends editor
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest(); throw new Rhymix\Framework\Exceptions\InvalidRequest();
} }
$skin_info = ModuleModel::loadSkinInfo($this->module_path,$skin); $skin_info = ModuleModel::loadSkinInfo($this->module_path,$skin);
$colorset = $skin_info->colorset ?? null; $colorset = $skin_info->colorset ?? null;
Context::set('colorset', $colorset); Context::set('colorset', $colorset);
@ -204,7 +204,7 @@ class editorView extends editor
function dispEditorConfigPreview() function dispEditorConfigPreview()
{ {
Context::set('editor', getModel('editor')->getModuleEditor(Context::get('type'), 0, 0, 'dummy_key', 'dummy_content')); Context::set('editor', getModel('editor')->getModuleEditor(Context::get('type'), 0, 0, 'dummy_key', 'dummy_content'));
$this->setLayoutFile('default_layout'); $this->setLayoutFile('default_layout');
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('config_preview'); $this->setTemplateFile('config_preview');

View file

@ -43,16 +43,16 @@ class installAdminController extends install
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
Rhymix\Framework\Session::close(); Rhymix\Framework\Session::close();
$output = $oModule->moduleUpdate(); $output = $oModule->moduleUpdate();
if($output instanceof BaseObject && !$output->toBool()) if($output instanceof BaseObject && !$output->toBool())
{ {
Rhymix\Framework\Session::start(); Rhymix\Framework\Session::start();
return $output; return $output;
} }
$oModuleController = getController('module'); $oModuleController = getController('module');
$output = $oModuleController->registerActionForwardRoutes($module_name); $output = $oModuleController->registerActionForwardRoutes($module_name);
if($output instanceof BaseObject && !$output->toBool()) if($output instanceof BaseObject && !$output->toBool())
@ -60,7 +60,7 @@ class installAdminController extends install
Rhymix\Framework\Session::start(); Rhymix\Framework\Session::start();
return $output; return $output;
} }
Rhymix\Framework\Session::start(); Rhymix\Framework\Session::start();
$this->setMessage('success_updated'); $this->setMessage('success_updated');
} }

View file

@ -12,7 +12,7 @@ class install extends ModuleObject
*/ */
function moduleInstall() function moduleInstall()
{ {
} }
/** /**
@ -28,7 +28,7 @@ class install extends ModuleObject
*/ */
function moduleUpdate() function moduleUpdate()
{ {
} }
/** /**

View file

@ -19,7 +19,7 @@ class installController extends install
{ {
throw new Rhymix\Framework\Exception('msg_already_installed'); throw new Rhymix\Framework\Exception('msg_already_installed');
} }
// Increase time limit. // Increase time limit.
@set_time_limit(0); @set_time_limit(0);
} }
@ -31,13 +31,13 @@ class installController extends install
{ {
// Get DB config variables. // Get DB config variables.
$config = Context::gets('db_type', 'db_host', 'db_port', 'db_user', 'db_pass', 'db_database', 'db_prefix'); $config = Context::gets('db_type', 'db_host', 'db_port', 'db_user', 'db_pass', 'db_database', 'db_prefix');
// Disallow installation using the root account. // Disallow installation using the root account.
if (trim($config->db_user) === 'root' && !preg_match('/Development Server$/', $_SERVER['SERVER_SOFTWARE'])) if (trim($config->db_user) === 'root' && !preg_match('/Development Server$/', $_SERVER['SERVER_SOFTWARE']))
{ {
return new BaseObject(-1, 'msg_dbroot_disallowed'); return new BaseObject(-1, 'msg_dbroot_disallowed');
} }
// Create a temporary setting object. // Create a temporary setting object.
Rhymix\Framework\Config::set('db.master', array( Rhymix\Framework\Config::set('db.master', array(
'type' => $config->db_type, 'type' => $config->db_type,
@ -48,7 +48,7 @@ class installController extends install
'database' => $config->db_database, 'database' => $config->db_database,
'prefix' => $config->db_prefix ? (rtrim($config->db_prefix, '_') . '_') : '', 'prefix' => $config->db_prefix ? (rtrim($config->db_prefix, '_') . '_') : '',
)); ));
// Check connection to the DB. // Check connection to the DB.
$oDB = DB::getInstance(); $oDB = DB::getInstance();
$output = $oDB->getError(); $output = $oDB->getError();
@ -56,7 +56,7 @@ class installController extends install
{ {
return $output; return $output;
} }
// Check MySQL server capabilities. // Check MySQL server capabilities.
if(stripos($config->db_type, 'mysql') !== false) if(stripos($config->db_type, 'mysql') !== false)
{ {
@ -70,12 +70,12 @@ class installController extends install
break; break;
} }
} }
// Check if utf8mb4 is supported. // Check if utf8mb4 is supported.
$oDB->charset = $oDB->getBestSupportedCharset(); $oDB->charset = $oDB->getBestSupportedCharset();
$config->db_charset = $oDB->charset; $config->db_charset = $oDB->charset;
} }
// Check if tables already exist. // Check if tables already exist.
$table_check = array('documents', 'comments', 'modules', 'sites'); $table_check = array('documents', 'comments', 'modules', 'sites');
foreach ($table_check as $table_name) foreach ($table_check as $table_name)
@ -85,10 +85,10 @@ class installController extends install
throw new Rhymix\Framework\Exception('msg_table_already_exists'); throw new Rhymix\Framework\Exception('msg_table_already_exists');
} }
} }
// Save DB config in session. // Save DB config in session.
$_SESSION['db_config'] = $config; $_SESSION['db_config'] = $config;
// Continue the installation. // Continue the installation.
if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON'))) if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON')))
{ {
@ -107,7 +107,7 @@ class installController extends install
{ {
throw new Rhymix\Framework\Exception('msg_already_installed'); throw new Rhymix\Framework\Exception('msg_already_installed');
} }
// Get install parameters. // Get install parameters.
$config = Rhymix\Framework\Config::getDefaults(); $config = Rhymix\Framework\Config::getDefaults();
if ($install_config) if ($install_config)
@ -147,23 +147,23 @@ class installController extends install
$time_zone = Context::get('time_zone'); $time_zone = Context::get('time_zone');
$user_info = Context::gets('email_address', 'password', 'nick_name', 'user_id'); $user_info = Context::gets('email_address', 'password', 'nick_name', 'user_id');
} }
// Fix the database table prefix. // Fix the database table prefix.
$config['db']['master']['prefix'] = rtrim($config['db']['master']['prefix'], '_'); $config['db']['master']['prefix'] = rtrim($config['db']['master']['prefix'], '_');
if ($config['db']['master']['prefix'] !== '') if ($config['db']['master']['prefix'] !== '')
{ {
$config['db']['master']['prefix'] .= '_'; $config['db']['master']['prefix'] .= '_';
} }
// Create new crypto keys. // Create new crypto keys.
$config['crypto']['encryption_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum'); $config['crypto']['encryption_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum');
$config['crypto']['authentication_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum'); $config['crypto']['authentication_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum');
$config['crypto']['session_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum'); $config['crypto']['session_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum');
// Set the default language. // Set the default language.
$config['locale']['default_lang'] = Context::getLangType(); $config['locale']['default_lang'] = Context::getLangType();
$config['locale']['enabled_lang'] = array($config['locale']['default_lang']); $config['locale']['enabled_lang'] = array($config['locale']['default_lang']);
// Set the default time zone. // Set the default time zone.
if (strpos($time_zone, '/') !== false) if (strpos($time_zone, '/') !== false)
{ {
@ -183,7 +183,7 @@ class installController extends install
$config['locale']['default_timezone'] = 'Etc/GMT' . ($user_timezone > 0 ? '-' : '+') . abs($user_timezone); $config['locale']['default_timezone'] = 'Etc/GMT' . ($user_timezone > 0 ? '-' : '+') . abs($user_timezone);
} }
} }
// Set the internal time zone. // Set the internal time zone.
if ($config['locale']['default_timezone'] === 'Asia/Seoul') if ($config['locale']['default_timezone'] === 'Asia/Seoul')
{ {
@ -197,24 +197,24 @@ class installController extends install
{ {
$config['locale']['internal_timezone'] = 0; $config['locale']['internal_timezone'] = 0;
} }
// Set the default URL. // Set the default URL.
$config['url']['default'] = Context::getRequestUri(); $config['url']['default'] = Context::getRequestUri();
// Set the default umask. // Set the default umask.
$config['file']['umask'] = Rhymix\Framework\Storage::recommendUmask(); $config['file']['umask'] = Rhymix\Framework\Storage::recommendUmask();
// Load the new configuration. // Load the new configuration.
Rhymix\Framework\Config::setAll($config); Rhymix\Framework\Config::setAll($config);
Context::loadDBInfo($config); Context::loadDBInfo($config);
// Check DB. // Check DB.
$oDB = DB::getInstance(); $oDB = DB::getInstance();
if (!$oDB->isConnected()) if (!$oDB->isConnected())
{ {
return $oDB->getError(); return $oDB->getError();
} }
// Assign a temporary administrator while installing. // Assign a temporary administrator while installing.
foreach ($user_info as $key => $val) foreach ($user_info as $key => $val)
{ {
@ -222,7 +222,7 @@ class installController extends install
} }
$user_info->is_admin = 'Y'; $user_info->is_admin = 'Y';
Context::set('logged_info', $user_info); Context::set('logged_info', $user_info);
// Install all the modules. // Install all the modules.
try try
{ {
@ -235,7 +235,7 @@ class installController extends install
$oDB->rollback(); $oDB->rollback();
throw new Rhymix\Framework\Exception($e->getMessage()); throw new Rhymix\Framework\Exception($e->getMessage());
} }
// Execute the install script. // Execute the install script.
$scripts = FileHandler::readDir(RX_BASEDIR . 'modules/install/script', '/(\.php)$/'); $scripts = FileHandler::readDir(RX_BASEDIR . 'modules/install/script', '/(\.php)$/');
if(count($scripts)) if(count($scripts))
@ -247,7 +247,7 @@ class installController extends install
$output = include($script_path . $script); $output = include($script_path . $script);
} }
} }
// Apply site lock. // Apply site lock.
if (Context::get('use_sitelock') === 'Y') if (Context::get('use_sitelock') === 'Y')
{ {
@ -256,23 +256,23 @@ class installController extends install
Rhymix\Framework\Config::set('lock.message', 'This site is locked.'); Rhymix\Framework\Config::set('lock.message', 'This site is locked.');
Rhymix\Framework\Config::set('lock.allow', array('127.0.0.1', $user_ip_range)); Rhymix\Framework\Config::set('lock.allow', array('127.0.0.1', $user_ip_range));
} }
// Use APC cache if available. // Use APC cache if available.
if (function_exists('apcu_exists')) if (function_exists('apcu_exists'))
{ {
Rhymix\Framework\Config::set('cache.type', 'apc'); Rhymix\Framework\Config::set('cache.type', 'apc');
} }
// Save the new configuration. // Save the new configuration.
Rhymix\Framework\Config::save(); Rhymix\Framework\Config::save();
// Unset temporary session variables. // Unset temporary session variables.
unset($_SESSION['use_rewrite']); unset($_SESSION['use_rewrite']);
unset($_SESSION['db_config']); unset($_SESSION['db_config']);
// Redirect to the home page. // Redirect to the home page.
$this->setMessage('msg_install_completed'); $this->setMessage('msg_install_completed');
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : RX_BASEURL; $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : RX_BASEURL;
$this->setRedirectUrl($returnUrl); $this->setRedirectUrl($returnUrl);
return new BaseObject(); return new BaseObject();
@ -315,13 +315,13 @@ class installController extends install
{ {
$checklist['permission'] = false; $checklist['permission'] = false;
} }
// Check session availability // Check session availability
$license_agreement_time = intval(trim(FileHandler::readFile($this->flagLicenseAgreement))); $license_agreement_time = intval(trim(FileHandler::readFile($this->flagLicenseAgreement)));
if(isset($_SESSION['license_agreement']) && (!$license_agreement_time || ($license_agreement_time == $_SESSION['license_agreement']))) if(isset($_SESSION['license_agreement']) && (!$license_agreement_time || ($license_agreement_time == $_SESSION['license_agreement'])))
{ {
$sess_autostart = intval(ini_get('session.auto_start')); $sess_autostart = intval(ini_get('session.auto_start'));
if($sess_autostart === 0) if($sess_autostart === 0)
{ {
$checklist['session'] = true; $checklist['session'] = true;
@ -425,7 +425,7 @@ class installController extends install
{ {
throw new Rhymix\Framework\Exception('msg_must_accept_license_agreement'); throw new Rhymix\Framework\Exception('msg_must_accept_license_agreement');
} }
$license_agreement_time = time(); $license_agreement_time = time();
$_SESSION['license_agreement'] = $license_agreement_time; $_SESSION['license_agreement'] = $license_agreement_time;
FileHandler::writeFile($this->flagLicenseAgreement, $license_agreement_time . PHP_EOL); FileHandler::writeFile($this->flagLicenseAgreement, $license_agreement_time . PHP_EOL);
@ -465,13 +465,13 @@ class installController extends install
{ {
// Get module name // Get module name
$module = basename($module_path); $module = basename($module_path);
// Only install default modules at this time // Only install default modules at this time
if (!Context::isDefaultPlugin($module, 'module')) if (!Context::isDefaultPlugin($module, 'module'))
{ {
continue; continue;
} }
// Try to group modules by category // Try to group modules by category
$xml_info = ModuleModel::getModuleInfoXml($module); $xml_info = ModuleModel::getModuleInfoXml($module);
if (!$xml_info) if (!$xml_info)
@ -480,14 +480,14 @@ class installController extends install
} }
$modules[$xml_info->category ?: 'other'][] = $module; $modules[$xml_info->category ?: 'other'][] = $module;
} }
// Install "module" module in advance // Install "module" module in advance
$this->installModule('module','./modules/module'); $this->installModule('module','./modules/module');
$this->updateModule('module'); $this->updateModule('module');
// Determine the order of module installation depending on category // Determine the order of module installation depending on category
$install_step = array('system','content','member'); $install_step = array('system','content','member');
// Install all the remaining modules // Install all the remaining modules
foreach($install_step as $category) foreach($install_step as $category)
{ {
@ -502,7 +502,7 @@ class installController extends install
unset($modules[$category]); unset($modules[$category]);
} }
} }
// Install all the remaining modules // Install all the remaining modules
if(count($modules)) if(count($modules))
{ {
@ -544,16 +544,16 @@ class installController extends install
{ {
continue; continue;
} }
$table_name = $matches[1]; $table_name = $matches[1];
if(isset($schema_sorted[$table_name]) || $oDB->isTableExists($table_name)) if(isset($schema_sorted[$table_name]) || $oDB->isTableExists($table_name))
{ {
continue; continue;
} }
$schema_sorted[$table_name] = $filename; $schema_sorted[$table_name] = $filename;
} }
$schema_sorted = Rhymix\Framework\Parsers\DBTableParser::resolveDependency($schema_sorted); $schema_sorted = Rhymix\Framework\Parsers\DBTableParser::resolveDependency($schema_sorted);
foreach ($schema_sorted as $table_name => $filename) foreach ($schema_sorted as $table_name => $filename)
{ {
@ -563,7 +563,7 @@ class installController extends install
throw new Exception(lang('msg_create_table_failed') . ': ' . $table_name . ': ' . $oDB->getError()->getMessage()); throw new Exception(lang('msg_create_table_failed') . ': ' . $table_name . ': ' . $oDB->getError()->getMessage());
} }
} }
// Create a table and module instance and then execute install() method // Create a table and module instance and then execute install() method
$oModule = ModuleModel::getModuleInstallClass($module); $oModule = ModuleModel::getModuleInstallClass($module);
if($oModule && method_exists($oModule, 'moduleInstall')) if($oModule && method_exists($oModule, 'moduleInstall'))
@ -572,10 +572,10 @@ class installController extends install
} }
return new BaseObject(); return new BaseObject();
} }
/** /**
* Update a module if necessary. * Update a module if necessary.
* *
* @param string $module * @param string $module
* @return mixed * @return mixed
*/ */
@ -590,10 +590,10 @@ class installController extends install
} }
} }
} }
/** /**
* Placeholder for third-party apps that try to manipulate system configuration. * Placeholder for third-party apps that try to manipulate system configuration.
* *
* @return void * @return void
*/ */
public function makeConfigFile() public function makeConfigFile()

View file

@ -35,7 +35,7 @@ class installModel extends install
function getInstallFTPList() function getInstallFTPList()
{ {
if(!($ftp_info = Context::getRequestVars()) || !$ftp_info->ftp_user || !$ftp_info->ftp_password) if(!($ftp_info = Context::getRequestVars()) || !$ftp_info->ftp_user || !$ftp_info->ftp_password)
{ {
return $this->setError('msg_ftp_invalid_auth_info'); return $this->setError('msg_ftp_invalid_auth_info');
} }
@ -57,17 +57,17 @@ class installModel extends install
if(!$connection) return $this->setError(sprintf(lang('msg_ftp_not_connected'), 'host')); if(!$connection) return $this->setError(sprintf(lang('msg_ftp_not_connected'), 'host'));
if(! @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password)) if(! @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
{ {
ftp_close($connection); ftp_close($connection);
return $this->setError('msg_ftp_invalid_auth_info'); return $this->setError('msg_ftp_invalid_auth_info');
} }
if($ftp_info->ftp_pasv != "N") if($ftp_info->ftp_pasv != "N")
{ {
ftp_pasv($connection, true); ftp_pasv($connection, true);
} }
$_list = ftp_rawlist($connection, $this->pwd); $_list = ftp_rawlist($connection, $this->pwd);
ftp_close($connection); ftp_close($connection);
} }
else else
{ {
@ -92,7 +92,7 @@ class installModel extends install
{ {
foreach($_list as $k => $v) foreach($_list as $k => $v)
{ {
$src = new stdClass(); $src = new stdClass();
$src->data = $v; $src->data = $v;
$res = Context::convertEncoding($src); $res = Context::convertEncoding($src);
$v = $res->data; $v = $res->data;

View file

@ -21,13 +21,13 @@ class installView extends install
{ {
throw new Rhymix\Framework\Exception('msg_already_installed'); throw new Rhymix\Framework\Exception('msg_already_installed');
} }
// Set the browser title. // Set the browser title.
Context::setBrowserTitle(lang('introduce_title')); Context::setBrowserTitle(lang('introduce_title'));
// Specify the template path. // Specify the template path.
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
// Check the environment. // Check the environment.
$oInstallController = getController('install'); $oInstallController = getController('install');
self::$checkEnv = $oInstallController->checkInstallEnv(); self::$checkEnv = $oInstallController->checkInstallEnv();
@ -46,7 +46,7 @@ class installView extends install
if (file_exists(RX_BASEDIR . 'config/install.config.php')) if (file_exists(RX_BASEDIR . 'config/install.config.php'))
{ {
include RX_BASEDIR . 'config/install.config.php'; include RX_BASEDIR . 'config/install.config.php';
if (isset($install_config) && is_array($install_config)) if (isset($install_config) && is_array($install_config))
{ {
$oInstallController = getController('install'); $oInstallController = getController('install');
@ -61,7 +61,7 @@ class installView extends install
} }
} }
} }
// Otherwise, display the license agreement screen. // Otherwise, display the license agreement screen.
Context::set('lang_type', Context::getLangType()); Context::set('lang_type', Context::getLangType());
$this->setTemplateFile('license_agreement'); $this->setTemplateFile('license_agreement');
@ -75,7 +75,7 @@ class installView extends install
// Create a temporary file for mod_rewrite check. // Create a temporary file for mod_rewrite check.
self::$rewriteCheckString = Rhymix\Framework\Security::getRandom(32); self::$rewriteCheckString = Rhymix\Framework\Security::getRandom(32);
FileHandler::writeFile(RX_BASEDIR . self::$rewriteCheckFilePath, self::$rewriteCheckString); FileHandler::writeFile(RX_BASEDIR . self::$rewriteCheckFilePath, self::$rewriteCheckString);
// Check if the web server is nginx. // Check if the web server is nginx.
Context::set('use_nginx', stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false); Context::set('use_nginx', stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false);
$this->setTemplateFile('check_env'); $this->setTemplateFile('check_env');
@ -91,16 +91,16 @@ class installView extends install
{ {
return $this->dispInstallCheckEnv(); return $this->dispInstallCheckEnv();
} }
// Delete mod_rewrite check file // Delete mod_rewrite check file
FileHandler::removeFile(RX_BASEDIR . self::$rewriteCheckFilePath); FileHandler::removeFile(RX_BASEDIR . self::$rewriteCheckFilePath);
// Save mod_rewrite check status. // Save mod_rewrite check status.
if(Context::get('rewrite') === 'Y') if(Context::get('rewrite') === 'Y')
{ {
Context::set('use_rewrite', $_SESSION['use_rewrite'] = 'Y'); Context::set('use_rewrite', $_SESSION['use_rewrite'] = 'Y');
} }
Context::set('error_return_url', getNotEncodedUrl('', 'act', Context::get('act'))); Context::set('error_return_url', getNotEncodedUrl('', 'act', Context::get('act')));
$this->setTemplateFile('db_config'); $this->setTemplateFile('db_config');
} }
@ -115,19 +115,19 @@ class installView extends install
{ {
return $this->dispInstallCheckEnv(); return $this->dispInstallCheckEnv();
} }
// Get list of time zones. // Get list of time zones.
Context::set('timezones', Rhymix\Framework\DateTime::getTimezoneList()); Context::set('timezones', Rhymix\Framework\DateTime::getTimezoneList());
// Automatically select a time zone for the user. // Automatically select a time zone for the user.
Context::set('selected_timezone', $this->detectUserTimeZone()); Context::set('selected_timezone', $this->detectUserTimeZone());
// Always use SSL if installing via SSL. // Always use SSL if installing via SSL.
Context::set('use_ssl', RX_SSL ? 'always' : 'none'); Context::set('use_ssl', RX_SSL ? 'always' : 'none');
Context::set('sitelock_ip_range', $this->detectUserIPRange()); Context::set('sitelock_ip_range', $this->detectUserIPRange());
$this->setTemplateFile('other_config'); $this->setTemplateFile('other_config');
} }
/** /**
* Detect the IP range of the user. * Detect the IP range of the user.
*/ */
@ -148,7 +148,7 @@ class installView extends install
return RX_CLIENT_IP; return RX_CLIENT_IP;
} }
} }
/** /**
* Detect best time zone for the user. * Detect best time zone for the user.
*/ */

View file

@ -18,7 +18,7 @@ class layoutAdminController extends layout
/** /**
* Create a new layout * Create a new layout
* Insert a title into "layouts" table in order to create a layout * Insert a title into "layouts" table in order to create a layout
* @deprecated * @deprecated
* @return void|Object (void : success, Object : fail) * @return void|Object (void : success, Object : fail)
*/ */
function procLayoutAdminInsert() function procLayoutAdminInsert()
@ -65,7 +65,7 @@ class layoutAdminController extends layout
* Initiate if it is faceoff layout * Initiate if it is faceoff layout
* @param int $layout_srl * @param int $layout_srl
* @param string $layout_name * @param string $layout_name
* @return void * @return void
*/ */
function initLayout($layout_srl, $layout_name) function initLayout($layout_srl, $layout_name)
{ {
@ -278,12 +278,12 @@ class layoutAdminController extends layout
$layout_file = $oLayoutModel->getUserLayoutHtml($layout_srl); $layout_file = $oLayoutModel->getUserLayoutHtml($layout_srl);
FileHandler::removeFile($layout_file); FileHandler::removeFile($layout_file);
// Delete Layout // Delete Layout
$args = new stdClass(); $args = new stdClass();
$args->layout_srl = $layout_srl; $args->layout_srl = $layout_srl;
$output = executeQuery("layout.deleteLayout", $args); $output = executeQuery("layout.deleteLayout", $args);
Rhymix\Framework\Cache::delete('layout:' . $args->layout_srl); Rhymix\Framework\Cache::delete('layout:' . $args->layout_srl);
if(!$output->toBool()) return $output; if(!$output->toBool()) return $output;
@ -390,7 +390,7 @@ class layoutAdminController extends layout
$ext = substr(strrchr($filename,'.'),1); $ext = substr(strrchr($filename,'.'),1);
$filename = sprintf('%s.%s', md5($filename), $ext); $filename = sprintf('%s.%s', md5($filename), $ext);
} }
if(file_exists($path .'/'. $filename)) @unlink($path . $filename); if(file_exists($path .'/'. $filename)) @unlink($path . $filename);
if(!move_uploaded_file($source['tmp_name'], $path . $filename )) return false; if(!move_uploaded_file($source['tmp_name'], $path . $filename )) return false;
return true; return true;
@ -693,7 +693,7 @@ class layoutAdminController extends layout
$args->extra_vars = $output->extra_vars; $args->extra_vars = $output->extra_vars;
$extra_vars = unserialize($args->extra_vars); $extra_vars = unserialize($args->extra_vars);
$image_list = array(); $image_list = array();
if($layout->extra_var_count && $extra_vars) if($layout->extra_var_count && $extra_vars)
{ {
$reg = "/^.\/files\/attach\/images\/([0-9]+)\/(.*)/"; $reg = "/^.\/files\/attach\/images\/([0-9]+)\/(.*)/";

View file

@ -97,7 +97,7 @@ class layoutAdminView extends layout
$layout_info = $oLayoutModel->getLayoutInfo($item->layout, null, $type); $layout_info = $oLayoutModel->getLayoutInfo($item->layout, null, $type);
if ($layout_info) if ($layout_info)
{ {
$layout_list[$item->layout]['title'] = $layout_info->title; $layout_list[$item->layout]['title'] = $layout_info->title;
} }
} }

View file

@ -3,7 +3,7 @@
/** /**
* @class layout * @class layout
* @author NAVER (developers@xpressengine.com) * @author NAVER (developers@xpressengine.com)
* high class of the layout module * high class of the layout module
*/ */
class layout extends ModuleObject class layout extends ModuleObject
{ {
@ -13,7 +13,7 @@ class layout extends ModuleObject
*/ */
function moduleInstall() function moduleInstall()
{ {
} }
/** /**
@ -31,7 +31,7 @@ class layout extends ModuleObject
*/ */
function moduleUpdate() function moduleUpdate()
{ {
} }
/** /**
@ -40,7 +40,7 @@ class layout extends ModuleObject
*/ */
function recompileCache() function recompileCache()
{ {
} }
} }
/* End of file layout.class.php */ /* End of file layout.class.php */

View file

@ -44,7 +44,7 @@ class layoutModel extends layout
unset($output->data[$no]); unset($output->data[$no]);
} }
} }
$oLayoutAdminModel = getAdminModel('layout'); $oLayoutAdminModel = getAdminModel('layout');
$siteDefaultLayoutSrl = $oLayoutAdminModel->getSiteDefaultLayout($layout_type); $siteDefaultLayoutSrl = $oLayoutAdminModel->getSiteDefaultLayout($layout_type);
if($siteDefaultLayoutSrl) if($siteDefaultLayoutSrl)
@ -64,7 +64,7 @@ class layoutModel extends layout
$responsiveLayoutInfo->title = lang('use_responsive_pc_layout'); $responsiveLayoutInfo->title = lang('use_responsive_pc_layout');
array_unshift($output->data, $responsiveLayoutInfo); array_unshift($output->data, $responsiveLayoutInfo);
} }
return $output->data; return $output->data;
} }
@ -162,7 +162,7 @@ class layoutModel extends layout
$titleList[$dLayoutInfo->layout] = $dLayoutInfo->title; $titleList[$dLayoutInfo->layout] = $dLayoutInfo->title;
} }
} }
if($layout) if($layout)
{ {
if(count($instanceList) < 1 && $downloadedList[$layout]) if(count($instanceList) < 1 && $downloadedList[$layout])
@ -265,7 +265,7 @@ class layoutModel extends layout
{ {
return $layout_info; return $layout_info;
} }
// Get information from the DB // Get information from the DB
$args = new stdClass(); $args = new stdClass();
$args->layout_srl = $layout_srl; $args->layout_srl = $layout_srl;
@ -589,7 +589,7 @@ class layoutModel extends layout
$count = count($extra_vars); $count = count($extra_vars);
$extra_var_count += $count; $extra_var_count += $count;
for($i=0;$i<$count;$i++) for($i=0;$i<$count;$i++)
{ {
unset($var, $options); unset($var, $options);
@ -680,7 +680,7 @@ class layoutModel extends layout
$extra_var_groups = $xml_obj->extra_vars->group; $extra_var_groups = $xml_obj->extra_vars->group;
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
$extra_var_count = 0; $extra_var_count = 0;
$buff[] = '$layout_info->extra_var = new stdClass;'; $buff[] = '$layout_info->extra_var = new stdClass;';
foreach($extra_var_groups as $group) foreach($extra_var_groups as $group)

View file

@ -35,7 +35,7 @@ class layoutView extends layout
/** /**
* Preview a layout with module. * Preview a layout with module.
* *
* @return Object * @return Object
*/ */
public function dispLayoutPreviewWithModule() public function dispLayoutPreviewWithModule()
@ -260,7 +260,7 @@ class layoutView extends layout
{ {
throw new Rhymix\Framework\Exception(lang('msg_unabled_preview')); throw new Rhymix\Framework\Exception(lang('msg_unabled_preview'));
} }
$mid = current($output->data)->mid; $mid = current($output->data)->mid;
} }
@ -397,7 +397,7 @@ class layoutView extends layout
} }
else else
{ {
return ''; return '';
} }
} }
@ -413,7 +413,7 @@ class layoutView extends layout
} }
else else
{ {
return ''; return '';
} }
} }

View file

@ -239,7 +239,7 @@ class menuAdminController extends menu
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMenuAdminManagement', 'menu_srl', $args->menu_srl); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMenuAdminManagement', 'menu_srl', $args->menu_srl);
$this->setRedirectUrl($returnUrl); $this->setRedirectUrl($returnUrl);
} }
/** /**
* Change the menu design (layout) * Change the menu design (layout)
*/ */
@ -253,7 +253,7 @@ class menuAdminController extends menu
{ {
return; return;
} }
$args = new stdClass; $args = new stdClass;
$args->menu_srl = $menu_srl; $args->menu_srl = $menu_srl;
$output = executeQueryArray('layout.getLayoutModules', $args); $output = executeQueryArray('layout.getLayoutModules', $args);
@ -285,7 +285,7 @@ class menuAdminController extends menu
return $output; return $output;
} }
} }
Rhymix\Framework\Cache::clearGroup('site_and_module'); Rhymix\Framework\Cache::clearGroup('site_and_module');
} }
} }
@ -1653,10 +1653,10 @@ class menuAdminController extends menu
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');
//$info = $oModuleModel->getModuleInfoXml($moduleName); //$info = $oModuleModel->getModuleInfoXml($moduleName);
$info = $oModuleModel->getModuleActionXml($moduleName); $info = $oModuleModel->getModuleActionXml($moduleName);
$args = new stdClass(); $args = new stdClass();
$args->url = 'index.php?module=admin'; $args->url = 'index.php?module=admin';
if($info->menu->{$menuName}->index) if($info->menu->{$menuName}->index)
{ {
$args->url .= '&act=' . $info->menu->{$menuName}->index; $args->url .= '&act=' . $info->menu->{$menuName}->index;
@ -1665,7 +1665,7 @@ class menuAdminController extends menu
{ {
$args->url .= '&act=' . $info->admin_index_act; $args->url .= '&act=' . $info->admin_index_act;
} }
$args->menu_item_srl = (!$requestArgs->menu_item_srl) ? getNextSequence() : $requestArgs->menu_item_srl; $args->menu_item_srl = (!$requestArgs->menu_item_srl) ? getNextSequence() : $requestArgs->menu_item_srl;
$args->parent_srl = $requestArgs->parent_srl; $args->parent_srl = $requestArgs->parent_srl;
$args->menu_srl = $requestArgs->menu_srl; $args->menu_srl = $requestArgs->menu_srl;
@ -1730,7 +1730,7 @@ class menuAdminController extends menu
{ {
$exposure = implode(',', $exposure); $exposure = implode(',', $exposure);
} }
if(in_array($exposure, array('-1','-3'))) if(in_array($exposure, array('-1','-3')))
{ {
$args->group_srls = $exposure; $args->group_srls = $exposure;
@ -1835,7 +1835,7 @@ class menuAdminController extends menu
FileHandler::writeFile($xml_file, '<root />'); FileHandler::writeFile($xml_file, '<root />');
FileHandler::writeFile($php_file, '<?php if(!defined("__XE__")) exit(); ?>'); FileHandler::writeFile($php_file, '<?php if(!defined("__XE__")) exit(); ?>');
return $xml_file; return $xml_file;
} }
$site_srl = 0; $site_srl = 0;
$domain = null; $domain = null;
@ -1947,7 +1947,7 @@ class menuAdminController extends menu
{ {
$child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain); $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
} }
// List variables // List variables
$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl); $names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
$name_arr_str = ''; $name_arr_str = '';
@ -1976,11 +1976,11 @@ class menuAdminController extends menu
$normal_btn = strval($node->normal_btn); $normal_btn = strval($node->normal_btn);
if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = escape($normal_btn); if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = escape($normal_btn);
else $normal_btn = ''; else $normal_btn = '';
$hover_btn = strval($node->hover_btn); $hover_btn = strval($node->hover_btn);
if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = escape($hover_btn); if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = escape($hover_btn);
else $hover_btn = ''; else $hover_btn = '';
$active_btn = strval($node->active_btn); $active_btn = strval($node->active_btn);
if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = escape($active_btn); if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = escape($active_btn);
else $active_btn = ''; else $active_btn = '';

View file

@ -74,10 +74,10 @@ class menuAdminModel extends menu
$menu_info->php_file = sprintf('./files/cache/menu/%d.php',$menu_srl); $menu_info->php_file = sprintf('./files/cache/menu/%d.php',$menu_srl);
return $menu_info; return $menu_info;
} }
/** /**
* Get actual menu info data * Get actual menu info data
* *
* @param int $menu_srl * @param int $menu_srl
* @return object * @return object
*/ */
@ -85,7 +85,7 @@ class menuAdminModel extends menu
{ {
$menu = new stdClass; $menu = new stdClass;
$menu->list = []; $menu->list = [];
$filename = sprintf('./files/cache/menu/%d.php', $menu_srl); $filename = sprintf('./files/cache/menu/%d.php', $menu_srl);
if (!FileHandler::exists($filename)) if (!FileHandler::exists($filename))
{ {
@ -95,7 +95,7 @@ class menuAdminModel extends menu
{ {
include $filename; include $filename;
} }
return $menu; return $menu;
} }
@ -350,7 +350,7 @@ class menuAdminModel extends menu
$oAutoinstallAdminModel = getAdminModel('autoinstall'); $oAutoinstallAdminModel = getAdminModel('autoinstall');
$config = $oAutoinstallAdminModel->getAutoInstallAdminModuleConfig(); $config = $oAutoinstallAdminModel->getAutoInstallAdminModuleConfig();
foreach($_allModules as $module_name) foreach($_allModules as $module_name)
{ {
$module = $oModuleModel->getModuleInfoXml($module_name); $module = $oModuleModel->getModuleInfoXml($module_name);
@ -489,7 +489,7 @@ class menuAdminModel extends menu
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');
$oMenuAdminController = getAdminController('menu'); $oMenuAdminController = getAdminController('menu');
$columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl'); $columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl');
$start_module_list = executeQuery('module.getDomainInfo', new stdClass); $start_module_list = executeQuery('module.getDomainInfo', new stdClass);
$start_module = $start_module_list->data; $start_module = $start_module_list->data;
@ -503,7 +503,7 @@ class menuAdminModel extends menu
{ {
include($php_file); include($php_file);
} }
else else
{ {
$oMenuAdminController->makeXmlFile($menuSrl); $oMenuAdminController->makeXmlFile($menuSrl);
} }
@ -663,7 +663,7 @@ class menuAdminModel extends menu
{ {
$start_module = $start_module ? array($start_module) : array(); $start_module = $start_module ? array($start_module) : array();
} }
// if url is empty and is_shortcut is 'N', change to is_shortcut 'Y' // if url is empty and is_shortcut is 'N', change to is_shortcut 'Y'
if(!$menu['url'] && $menu['is_shortcut'] == 'N') if(!$menu['url'] && $menu['is_shortcut'] == 'N')
{ {

View file

@ -21,7 +21,7 @@ class menuAdminView extends menu
$this->setTemplatePath($this->module_path.'tpl'); $this->setTemplatePath($this->module_path.'tpl');
} }
/** /**
* Site map admin menu index page * Site map admin menu index page
* @return void * @return void
@ -40,7 +40,7 @@ class menuAdminView extends menu
$oMenuController = getAdminController('menu'); $oMenuController = getAdminController('menu');
$oMenuController->linkAllModuleInstancesToSitemap(); $oMenuController->linkAllModuleInstancesToSitemap();
} }
// get installed module list // get installed module list
$oPageController = getController('page'); //for lang $oPageController = getController('page'); //for lang
$oMenuAdminModel = getAdminModel('menu'); $oMenuAdminModel = getAdminModel('menu');
@ -79,7 +79,7 @@ class menuAdminView extends menu
} }
} }
Context::set('group_list', $groupList); Context::set('group_list', $groupList);
// Get layout instance list // Get layout instance list
$oLayoutModel = getModel('layout'); $oLayoutModel = getModel('layout');
$layouts_P = $oLayoutModel->getLayoutList(0, 'P') ?: []; $layouts_P = $oLayoutModel->getLayoutList(0, 'P') ?: [];

View file

@ -27,19 +27,19 @@ class menu extends ModuleObject
function checkUpdate() function checkUpdate()
{ {
$oDB = DB::getInstance(); $oDB = DB::getInstance();
// 2015. 06. 15 add column desc // 2015. 06. 15 add column desc
if(!$oDB->isColumnExists('menu_item', 'desc')) if(!$oDB->isColumnExists('menu_item', 'desc'))
{ {
return true; return true;
} }
// 2021. 01. 20 add column icon // 2021. 01. 20 add column icon
if(!$oDB->isColumnExists('menu_item', 'icon')) if(!$oDB->isColumnExists('menu_item', 'icon'))
{ {
return true; return true;
} }
return false; return false;
} }
@ -50,13 +50,13 @@ class menu extends ModuleObject
function moduleUpdate() function moduleUpdate()
{ {
$oDB = DB::getInstance(); $oDB = DB::getInstance();
// 2015. 06. 15 add column desc // 2015. 06. 15 add column desc
if(!$oDB->isColumnExists('menu_item', 'desc')) if(!$oDB->isColumnExists('menu_item', 'desc'))
{ {
$oDB->addColumn('menu_item', 'desc', 'varchar', 250, null, false, 'name'); $oDB->addColumn('menu_item', 'desc', 'varchar', 250, null, false, 'name');
} }
// 2021. 01. 20 add column icon // 2021. 01. 20 add column icon
if(!$oDB->isColumnExists('menu_item', 'icon')) if(!$oDB->isColumnExists('menu_item', 'icon'))
{ {
@ -116,4 +116,4 @@ class menu extends ModuleObject
} }
} }
/* End of file menu.class.php */ /* End of file menu.class.php */
/* Location: ./modules/menu/menu.class.php */ /* Location: ./modules/menu/menu.class.php */

View file

@ -67,7 +67,7 @@ class menuMobile extends moduleObject
} }
} }
Context::set('menu', $this->result); Context::set('menu', $this->result);
$this->setTemplatePath(sprintf("%stpl/",$this->module_path)); $this->setTemplatePath(sprintf("%stpl/",$this->module_path));
$this->setTemplateFile('menu.html'); $this->setTemplateFile('menu.html');

View file

@ -12,7 +12,7 @@ class Message extends ModuleObject
*/ */
function moduleInstall() function moduleInstall()
{ {
} }
/** /**

View file

@ -3,7 +3,7 @@
class MessageMobile extends MessageView class MessageMobile extends MessageView
{ {
} }
/* End of file message.mobile.php */ /* End of file message.mobile.php */
/* Location: ./modules/message/message.mobile.php */ /* Location: ./modules/message/message.mobile.php */

View file

@ -29,7 +29,7 @@ class MessageView extends Message
{ {
$config->mskin = 'default'; $config->mskin = 'default';
} }
// Set the template path // Set the template path
if (contains('mobile', get_class($this), false)) if (contains('mobile', get_class($this), false))
{ {
@ -63,13 +63,13 @@ class MessageView extends Message
// Get the member configuration // Get the member configuration
$member_config = ModuleModel::getModuleConfig('member'); $member_config = ModuleModel::getModuleConfig('member');
Context::set('member_config', $member_config); Context::set('member_config', $member_config);
// Disable location if debug not available // Disable location if debug not available
if (!Rhymix\Framework\Debug::isEnabledForCurrentUser()) if (!Rhymix\Framework\Debug::isEnabledForCurrentUser())
{ {
$location = null; $location = null;
} }
// Remove basedir from location (if any) // Remove basedir from location (if any)
if ($location && starts_with(\RX_BASEDIR, $location)) if ($location && starts_with(\RX_BASEDIR, $location))
{ {
@ -80,7 +80,7 @@ class MessageView extends Message
Context::set('system_message', nl2br($this->getMessage())); Context::set('system_message', nl2br($this->getMessage()));
Context::set('system_message_detail', nl2br($detail)); Context::set('system_message_detail', nl2br($detail));
Context::set('system_message_location', escape($location)); Context::set('system_message_location', escape($location));
if ($this->getError()) if ($this->getError())
{ {
if ($detail) if ($detail)
@ -94,7 +94,7 @@ class MessageView extends Message
} }
$this->setTemplateFile('system_message'); $this->setTemplateFile('system_message');
// Default 403 Error // Default 403 Error
if($this->getHttpStatusCode() === 200) if($this->getHttpStatusCode() === 200)
{ {

View file

@ -96,7 +96,7 @@ class ncenterliteAdminController extends ncenterlite
$config->admin_notify_module_srls = array(); $config->admin_notify_module_srls = array();
} }
} }
if($obj->disp_act == 'dispNcenterliteAdminOtherComment') if($obj->disp_act == 'dispNcenterliteAdminOtherComment')
{ {
if(!$obj->comment_all) if(!$obj->comment_all)
@ -116,7 +116,7 @@ class ncenterliteAdminController extends ncenterlite
$config->notify_count = 0; $config->notify_count = 0;
} }
} }
$output = $oModuleController->insertModuleConfig('ncenterlite', $config); $output = $oModuleController->insertModuleConfig('ncenterlite', $config);
if(!$output->toBool()) if(!$output->toBool())
{ {
@ -203,7 +203,7 @@ class ncenterliteAdminController extends ncenterlite
} }
$this->setMessage('msg_test_notifycation_success'); $this->setMessage('msg_test_notifycation_success');
if (Context::get('success_return_url')) if (Context::get('success_return_url'))
{ {
$this->setRedirectUrl(Context::get('success_return_url')); $this->setRedirectUrl(Context::get('success_return_url'));

View file

@ -29,7 +29,7 @@ class ncenterliteAdminView extends ncenterlite
Context::set('mid_list', $mid_list); Context::set('mid_list', $mid_list);
Context::set('config', $config); Context::set('config', $config);
} }
function dispNcenterliteAdminOtherComment() function dispNcenterliteAdminOtherComment()
{ {
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');

View file

@ -42,7 +42,7 @@ class ncenterlite extends ModuleObject
function moduleInstall() function moduleInstall()
{ {
} }
function checkUpdate() function checkUpdate()
@ -93,7 +93,7 @@ class ncenterlite extends ModuleObject
} }
} }
} }
// #1903 #1906 // #1903 #1906
foreach(['target_browser', 'target_summary'] as $column_name) foreach(['target_browser', 'target_summary'] as $column_name)
{ {
@ -103,7 +103,7 @@ class ncenterlite extends ModuleObject
return true; return true;
} }
} }
// PK duplicate // PK duplicate
if($oDB->isIndexExists('ncenterlite_notify', 'idx_notify')) if($oDB->isIndexExists('ncenterlite_notify', 'idx_notify'))
{ {
@ -114,7 +114,7 @@ class ncenterlite extends ModuleObject
{ {
return true; return true;
} }
if($oDB->isColumnExists('ncenterlite_user_set','custom_notify')) if($oDB->isColumnExists('ncenterlite_user_set','custom_notify'))
{ {
return true; return true;
@ -182,7 +182,7 @@ class ncenterlite extends ModuleObject
{ {
$oDB->addColumn('ncenterlite_notify', 'target_p_srl', 'number', 10, true); $oDB->addColumn('ncenterlite_notify', 'target_p_srl', 'number', 10, true);
} }
foreach(['idx_srl', 'idx_member_srl', 'idx_regdate', 'idx_readed', 'idx_target_srl', 'idx_target_p_srl', 'idx_target_member_srl'] as $index_name) foreach(['idx_srl', 'idx_member_srl', 'idx_regdate', 'idx_readed', 'idx_target_srl', 'idx_target_p_srl', 'idx_target_member_srl'] as $index_name)
{ {
if(!$oDB->isIndexExists('ncenterlite_notify', $index_name)) if(!$oDB->isIndexExists('ncenterlite_notify', $index_name))
@ -219,13 +219,13 @@ class ncenterlite extends ModuleObject
{ {
$oDB->dropColumn('ncenterlite_user_set', 'custom_notify'); $oDB->dropColumn('ncenterlite_user_set', 'custom_notify');
} }
// Composite index to speed up getNotifyList // Composite index to speed up getNotifyList
if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_member_srl_and_readed')) if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_member_srl_and_readed'))
{ {
$oDB->addIndex('ncenterlite_notify', 'idx_member_srl_and_readed', array('member_srl', 'readed')); $oDB->addIndex('ncenterlite_notify', 'idx_member_srl_and_readed', array('member_srl', 'readed'));
} }
// #1903 #1906 // #1903 #1906
foreach(['target_browser', 'target_summary'] as $column_name) foreach(['target_browser', 'target_summary'] as $column_name)
{ {
@ -235,7 +235,7 @@ class ncenterlite extends ModuleObject
$oDB->modifyColumn('ncenterlite_notify', $column_name, 'varchar', 80, null, false); $oDB->modifyColumn('ncenterlite_notify', $column_name, 'varchar', 80, null, false);
} }
} }
// PK duplicate // PK duplicate
if($oDB->isIndexExists('ncenterlite_notify', 'idx_notify')) if($oDB->isIndexExists('ncenterlite_notify', 'idx_notify'))
{ {
@ -309,7 +309,7 @@ class ncenterlite extends ModuleObject
{ {
return $oSmsHandler; return $oSmsHandler;
} }
$variable_name = array(); $variable_name = array();
$member_config = getModel('member')->getMemberConfig(); $member_config = getModel('member')->getMemberConfig();
foreach($member_config->signupForm as $value) foreach($member_config->signupForm as $value)

View file

@ -9,10 +9,10 @@ class ncenterliteController extends ncenterlite
'dispNcenterliteNotifyList' => true, 'dispNcenterliteNotifyList' => true,
'dispEditorFrame' => true, 'dispEditorFrame' => true,
); );
/** /**
* Send any message to a member. * Send any message to a member.
* *
* @param int $from_member_srl Sender * @param int $from_member_srl Sender
* @param int $to_member_srl Recipient * @param int $to_member_srl Recipient
* @param string|object $message Message content * @param string|object $message Message content
@ -36,7 +36,7 @@ class ncenterliteController extends ncenterlite
$args->target_browser = ''; $args->target_browser = '';
$args->target_summary = ''; $args->target_summary = '';
$args->target_content = null; $args->target_content = null;
if (is_object($message)) if (is_object($message))
{ {
$args->target_body = $message->subject; $args->target_body = $message->subject;
@ -48,7 +48,7 @@ class ncenterliteController extends ncenterlite
{ {
$args->target_body = $message; $args->target_body = $message;
} }
$output = $this->_insertNotify($args); $output = $this->_insertNotify($args);
if(!$output->toBool()) if(!$output->toBool())
{ {
@ -152,7 +152,7 @@ class ncenterliteController extends ncenterlite
$this->setRedirectUrl(getNotEncodedUrl('act', 'dispNcenterliteUserConfig', 'member_srl', $member_srl)); $this->setRedirectUrl(getNotEncodedUrl('act', 'dispNcenterliteUserConfig', 'member_srl', $member_srl));
} }
} }
function procNcenterliteInsertUnsubscribe() function procNcenterliteInsertUnsubscribe()
{ {
$config = NcenterliteModel::getConfig(); $config = NcenterliteModel::getConfig();
@ -164,19 +164,19 @@ class ncenterliteController extends ncenterlite
{ {
throw new Rhymix\Framework\Exception('msg_unsubscribe_block_not_support'); throw new Rhymix\Framework\Exception('msg_unsubscribe_block_not_support');
} }
$obj = Context::getRequestVars(); $obj = Context::getRequestVars();
if(!$this->user->member_srl || (!intval($obj->unsubscribe_srl) && !intval($obj->target_srl))) if(!$this->user->member_srl || (!intval($obj->unsubscribe_srl) && !intval($obj->target_srl)))
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
if($obj->target_srl) if($obj->target_srl)
{ {
$oNcenterliteModel = getModel('ncenterlite'); $oNcenterliteModel = getModel('ncenterlite');
$userBlockData = $oNcenterliteModel->getUserUnsubscribeConfigByTargetSrl($obj->target_srl, $this->user->member_srl); $userBlockData = $oNcenterliteModel->getUserUnsubscribeConfigByTargetSrl($obj->target_srl, $this->user->member_srl);
// If there was a record directed by unsubscribe_srl, the record should be used to validate the input data. // If there was a record directed by unsubscribe_srl, the record should be used to validate the input data.
if($userBlockData) if($userBlockData)
{ {
@ -184,24 +184,24 @@ class ncenterliteController extends ncenterlite
{ {
$obj->unsubscribe_srl = $userBlockData->unsubscribe_srl; $obj->unsubscribe_srl = $userBlockData->unsubscribe_srl;
} }
if (intval($obj->unsubscribe_srl) != intval($userBlockData->unsubscribe_srl)) if (intval($obj->unsubscribe_srl) != intval($userBlockData->unsubscribe_srl))
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
} }
} }
if(!$userBlockData && $obj->unsubscribe_srl) if(!$userBlockData && $obj->unsubscribe_srl)
{ {
$userBlockData = $oNcenterliteModel->getUserUnsubscribeConfigByUnsubscribeSrl($obj->unsubscribe_srl); $userBlockData = $oNcenterliteModel->getUserUnsubscribeConfigByUnsubscribeSrl($obj->unsubscribe_srl);
// The input member_srl from the POST or GET might not equal to the member_srl from the record of unsubscribe_srl. // The input member_srl from the POST or GET might not equal to the member_srl from the record of unsubscribe_srl.
if(intval($this->user->member_srl) != intval($userBlockData->member_srl)) if(intval($this->user->member_srl) != intval($userBlockData->member_srl))
{ {
throw new Rhymix\Framework\Exception('ncenterlite_stop_no_permission_other_user_block_settings'); throw new Rhymix\Framework\Exception('ncenterlite_stop_no_permission_other_user_block_settings');
} }
// If there was a record directed by unsubscribe_srl, the record should be used to validate the input data. // If there was a record directed by unsubscribe_srl, the record should be used to validate the input data.
if($userBlockData) if($userBlockData)
{ {
@ -209,19 +209,19 @@ class ncenterliteController extends ncenterlite
{ {
$obj->target_srl = $userBlockData->target_srl; $obj->target_srl = $userBlockData->target_srl;
} }
if (intval($obj->target_srl) != intval($userBlockData->target_srl)) if (intval($obj->target_srl) != intval($userBlockData->target_srl))
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
} }
} }
if($userBlockData) if($userBlockData)
{ {
$obj->unsubscribe_srl = $userBlockData->unsubscribe_srl; $obj->unsubscribe_srl = $userBlockData->unsubscribe_srl;
} }
// Content type can be document and comment, now. However, the default type cannot be specified, as the type can be another in the future. // Content type can be document and comment, now. However, the default type cannot be specified, as the type can be another in the future.
if($obj->unsubscribe_type == 'document') if($obj->unsubscribe_type == 'document')
{ {
@ -237,7 +237,7 @@ class ncenterliteController extends ncenterlite
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
$args = new stdClass(); $args = new stdClass();
$args->member_srl = $this->user->member_srl; $args->member_srl = $this->user->member_srl;
$args->target_srl = $obj->target_srl; $args->target_srl = $obj->target_srl;
@ -251,7 +251,7 @@ class ncenterliteController extends ncenterlite
} }
$args->unsubscribe_type = $obj->unsubscribe_type; $args->unsubscribe_type = $obj->unsubscribe_type;
$args->text = $text; $args->text = $text;
if($obj->value == 'Y') if($obj->value == 'Y')
{ {
// 데이터가 있으면 차단, 데이터가 없으면 차단하지 않기 때문에 따로 업데이트를 하지 않는다. // 데이터가 있으면 차단, 데이터가 없으면 차단하지 않기 때문에 따로 업데이트를 하지 않는다.
@ -275,7 +275,7 @@ class ncenterliteController extends ncenterlite
{ {
throw new Rhymix\Framework\Exception('msg_unsubscribe_not_in_list'); throw new Rhymix\Framework\Exception('msg_unsubscribe_not_in_list');
} }
$args->unsubscribe_srl = $obj->unsubscribe_srl; $args->unsubscribe_srl = $obj->unsubscribe_srl;
$output = executeQuery('ncenterlite.deleteUnsubscribe', $args); $output = executeQuery('ncenterlite.deleteUnsubscribe', $args);
if(!$output->toBool()) if(!$output->toBool())
@ -329,7 +329,7 @@ class ncenterliteController extends ncenterlite
{ {
$this->removeFlagFile($args->member_srl); $this->removeFlagFile($args->member_srl);
} }
// Delete to user setting. // Delete to user setting.
$userSetOutput = executeQuery('ncenterlite.deleteNcenterliteUserSettingData', $args); $userSetOutput = executeQuery('ncenterlite.deleteNcenterliteUserSettingData', $args);
if(!$userSetOutput->toBool()) if(!$userSetOutput->toBool())
@ -436,7 +436,7 @@ class ncenterliteController extends ncenterlite
{ {
continue; continue;
} }
$args = new stdClass(); $args = new stdClass();
$args->config_type = 'comment_all'; $args->config_type = 'comment_all';
$args->member_srl = abs($value->member_srl); $args->member_srl = abs($value->member_srl);
@ -461,7 +461,7 @@ class ncenterliteController extends ncenterlite
} }
} }
} }
$obj->admin_comment_notify = false; $obj->admin_comment_notify = false;
$admin_list = $oNcenterliteModel->getMemberAdmins(); $admin_list = $oNcenterliteModel->getMemberAdmins();
@ -547,12 +547,12 @@ class ncenterliteController extends ncenterlite
{ {
return; return;
} }
if($oNcenterliteModel->getUserUnsubscribeConfigByTargetSrl($parent_srl, $abs_member_srl)) if($oNcenterliteModel->getUserUnsubscribeConfigByTargetSrl($parent_srl, $abs_member_srl))
{ {
return; return;
} }
$args = new stdClass(); $args = new stdClass();
$args->config_type = 'comment_comment'; $args->config_type = 'comment_comment';
$args->member_srl = $abs_member_srl; $args->member_srl = $abs_member_srl;
@ -592,7 +592,7 @@ class ncenterliteController extends ncenterlite
{ {
return; return;
} }
if($config->user_notify_setting == 'Y') if($config->user_notify_setting == 'Y')
{ {
$document_comment_member_config = NcenterliteModel::getUserConfig($abs_member_srl); $document_comment_member_config = NcenterliteModel::getUserConfig($abs_member_srl);
@ -673,7 +673,7 @@ class ncenterliteController extends ncenterlite
return $output; return $output;
} }
} }
function triggerAfterScrap($obj) function triggerAfterScrap($obj)
{ {
$config = NcenterliteModel::getConfig(); $config = NcenterliteModel::getConfig();
@ -681,7 +681,7 @@ class ncenterliteController extends ncenterlite
{ {
return; return;
} }
if($config->user_notify_setting === 'Y') if($config->user_notify_setting === 'Y')
{ {
$target_member_config = NcenterliteModel::getUserConfig(abs($obj->target_member_srl)); $target_member_config = NcenterliteModel::getUserConfig(abs($obj->target_member_srl));
@ -690,10 +690,10 @@ class ncenterliteController extends ncenterlite
return; return;
} }
} }
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');
$module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl); $module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl);
$args = new stdClass(); $args = new stdClass();
$args->config_type = 'scrap'; $args->config_type = 'scrap';
$args->target_member_srl = abs($obj->member_srl); $args->target_member_srl = abs($obj->member_srl);
@ -755,7 +755,7 @@ class ncenterliteController extends ncenterlite
$args->module_srl = $obj->module_srl; $args->module_srl = $obj->module_srl;
$this->_insertNotify($args, $config->anonymous_voter !== 'N'); $this->_insertNotify($args, $config->anonymous_voter !== 'N');
} }
function triggerAfterDocumentVotedCancel($obj) function triggerAfterDocumentVotedCancel($obj)
{ {
$config = NcenterliteModel::getConfig(); $config = NcenterliteModel::getConfig();
@ -771,7 +771,7 @@ class ncenterliteController extends ncenterlite
{ {
return; return;
} }
if($config->anonymous_voter === 'Y') if($config->anonymous_voter === 'Y')
{ {
$member_srl = -1 * $this->user->member_srl; $member_srl = -1 * $this->user->member_srl;
@ -780,7 +780,7 @@ class ncenterliteController extends ncenterlite
{ {
$member_srl = $this->user->member_srl; $member_srl = $this->user->member_srl;
} }
$args = new stdClass(); $args = new stdClass();
$args->type = $this->_TYPE_DOCUMENT; $args->type = $this->_TYPE_DOCUMENT;
$args->target_type = $this->_TYPE_VOTED; $args->target_type = $this->_TYPE_VOTED;
@ -792,7 +792,7 @@ class ncenterliteController extends ncenterlite
$this->removeFlagFile(abs($obj->member_srl)); $this->removeFlagFile(abs($obj->member_srl));
} }
} }
function triggerAfterCommentVotedCount($obj) function triggerAfterCommentVotedCount($obj)
{ {
$config = NcenterliteModel::getConfig(); $config = NcenterliteModel::getConfig();
@ -812,14 +812,14 @@ class ncenterliteController extends ncenterlite
return; return;
} }
} }
$oCommentModel = getModel('comment'); $oCommentModel = getModel('comment');
$oComment = $oCommentModel->getComment($obj->comment_srl); $oComment = $oCommentModel->getComment($obj->comment_srl);
$content = $oComment->get('content'); $content = $oComment->get('content');
$document_srl = $oComment->get('document_srl'); $document_srl = $oComment->get('document_srl');
$module_info = getModel('module')->getModuleInfoByDocumentSrl($document_srl); $module_info = getModel('module')->getModuleInfoByDocumentSrl($document_srl);
$args = new stdClass(); $args = new stdClass();
$args->config_type = 'vote'; $args->config_type = 'vote';
$args->member_srl = abs($obj->member_srl); $args->member_srl = abs($obj->member_srl);
@ -852,7 +852,7 @@ class ncenterliteController extends ncenterlite
{ {
return; return;
} }
$args = new stdClass(); $args = new stdClass();
$args->type = $this->_TYPE_COMMENT; $args->type = $this->_TYPE_COMMENT;
$args->target_type = $this->_TYPE_VOTED; $args->target_type = $this->_TYPE_VOTED;
@ -872,7 +872,7 @@ class ncenterliteController extends ncenterlite
{ {
return; return;
} }
$member_srls = ncenterliteModel::getInstance()->getNotifyMemberSrlBySrl($obj->comment_srl); $member_srls = ncenterliteModel::getInstance()->getNotifyMemberSrlBySrl($obj->comment_srl);
$args = new stdClass(); $args = new stdClass();
@ -894,7 +894,7 @@ class ncenterliteController extends ncenterlite
{ {
return; return;
} }
$member_srls = ncenterliteModel::getInstance()->getNotifyMemberSrlBySrl($obj->document_srl); $member_srls = ncenterliteModel::getInstance()->getNotifyMemberSrlBySrl($obj->document_srl);
$args = new stdClass(); $args = new stdClass();
@ -1058,23 +1058,23 @@ class ncenterliteController extends ncenterlite
{ {
return; return;
} }
// 레이아웃에서 알림센터 사용중이라면 중지 // 레이아웃에서 알림센터 사용중이라면 중지
if(Context::get('layout_info')->use_ncenter_widget == 'Y') if(Context::get('layout_info')->use_ncenter_widget == 'Y')
{ {
return; return;
} }
Context::set('ncenterlite_config', $config); Context::set('ncenterlite_config', $config);
if($config->highlight_effect === 'Y') if($config->highlight_effect === 'Y')
{ {
Context::loadFile(array('./modules/ncenterlite/tpl/js/ncenterlite.js', 'body', '', 100000)); Context::loadFile(array('./modules/ncenterlite/tpl/js/ncenterlite.js', 'body', '', 100000));
} }
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
$_output = $oNcenterliteModel->getMyNotifyList($logged_info->member_srl); $_output = $oNcenterliteModel->getMyNotifyList($logged_info->member_srl);
if($config->always_display !== 'Y') if($config->always_display !== 'Y')
{ {
if(!$_output->data) if(!$_output->data)
@ -1082,7 +1082,7 @@ class ncenterliteController extends ncenterlite
return; return;
} }
} }
$_latest_notify_id = array_slice($_output->data, 0, 1); $_latest_notify_id = array_slice($_output->data, 0, 1);
$_latest_notify_id = count($_latest_notify_id) > 0 ? $_latest_notify_id[0]->notify : ""; $_latest_notify_id = count($_latest_notify_id) > 0 ? $_latest_notify_id[0]->notify : "";
Context::set('ncenterlite_latest_notify_id', $_latest_notify_id); Context::set('ncenterlite_latest_notify_id', $_latest_notify_id);
@ -1139,7 +1139,7 @@ class ncenterliteController extends ncenterlite
{ {
Context::set('ncenterlite_zindex', ' style="z-index:' . $config->zindex . ';" '); Context::set('ncenterlite_zindex', ' style="z-index:' . $config->zindex . ';" ');
} }
$result = TemplateHandler::getInstance()->compile($this->template_path, 'ncenterlite.html'); $result = TemplateHandler::getInstance()->compile($this->template_path, 'ncenterlite.html');
$this->_addFile(); $this->_addFile();
$output_display = $result . $output_display; $output_display = $result . $output_display;
@ -1331,7 +1331,7 @@ class ncenterliteController extends ncenterlite
function _insertNotify($args, $anonymous = FALSE) function _insertNotify($args, $anonymous = FALSE)
{ {
$config = NcenterliteModel::getConfig(); $config = NcenterliteModel::getConfig();
if(is_array($config->hide_module_srls) && in_array($args->module_srl, $config->hide_module_srls)) if(is_array($config->hide_module_srls) && in_array($args->module_srl, $config->hide_module_srls))
{ {
return new BaseObject(); return new BaseObject();
@ -1348,7 +1348,7 @@ class ncenterliteController extends ncenterlite
{ {
$args->notify = $this->_getNotifyId($args); $args->notify = $this->_getNotifyId($args);
} }
// 날짜가 없는 경우 자동 생성 // 날짜가 없는 경우 자동 생성
if (!$args->regdate) if (!$args->regdate)
{ {
@ -1389,7 +1389,7 @@ class ncenterliteController extends ncenterlite
$args->target_user_id = ''; $args->target_user_id = '';
$args->target_email_address = ''; $args->target_email_address = '';
} }
// 수신자가 웹 알림을 거부한 경우 이미 읽은 것으로 처리 // 수신자가 웹 알림을 거부한 경우 이미 읽은 것으로 처리
if($config->user_notify_setting == 'Y') if($config->user_notify_setting == 'Y')
{ {
@ -1405,7 +1405,7 @@ class ncenterliteController extends ncenterlite
{ {
return $trigger_output; return $trigger_output;
} }
$output = executeQuery('ncenterlite.insertNotify', $args); $output = executeQuery('ncenterlite.insertNotify', $args);
if($output->toBool()) if($output->toBool())
{ {
@ -1431,7 +1431,7 @@ class ncenterliteController extends ncenterlite
$cache_key = sprintf('ncenterlite:notify_list:%d', $member_srl); $cache_key = sprintf('ncenterlite:notify_list:%d', $member_srl);
Rhymix\Framework\Cache::set($cache_key, $output); Rhymix\Framework\Cache::set($cache_key, $output);
$flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($member_srl) . $member_srl . '.php'; $flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($member_srl) . $member_srl . '.php';
if (Rhymix\Framework\Cache::getDriverName() !== 'dummy') if (Rhymix\Framework\Cache::getDriverName() !== 'dummy')
{ {
@ -1454,7 +1454,7 @@ class ncenterliteController extends ncenterlite
$cache_key = sprintf('ncenterlite:notify_list:%d', $member_srl); $cache_key = sprintf('ncenterlite:notify_list:%d', $member_srl);
Rhymix\Framework\Cache::delete($cache_key); Rhymix\Framework\Cache::delete($cache_key);
$flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($member_srl) . $member_srl . '.php'; $flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($member_srl) . $member_srl . '.php';
if(file_exists($flag_path)) if(file_exists($flag_path))
{ {
@ -1479,13 +1479,13 @@ class ncenterliteController extends ncenterlite
$oMemberModel = getModel('member'); $oMemberModel = getModel('member');
$config = NcenterliteModel::getConfig(); $config = NcenterliteModel::getConfig();
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
// Extract mentions. // Extract mentions.
$content = html_entity_decode(strip_tags($content)); $content = html_entity_decode(strip_tags($content));
preg_match_all('/(?:^|\s)@([^\pC\pM\pP\pS\pZ]+)/u', $content, $matches); preg_match_all('/(?:^|\s)@([^\pC\pM\pP\pS\pZ]+)/u', $content, $matches);
$mentions = array_unique($matches[1]); $mentions = array_unique($matches[1]);
$members = array(); $members = array();
// Find members. // Find members.
foreach ($mentions as $mention) foreach ($mentions as $mention)
{ {
@ -1493,12 +1493,12 @@ class ncenterliteController extends ncenterlite
{ {
continue; continue;
} }
if (count($members) >= $config->mention_limit) if (count($members) >= $config->mention_limit)
{ {
break; break;
} }
if ($config->mention_suffix_always_cut != 'Y') if ($config->mention_suffix_always_cut != 'Y')
{ {
if ($config->mention_names === 'id') if ($config->mention_names === 'id')
@ -1514,7 +1514,7 @@ class ncenterliteController extends ncenterlite
{ {
$member_srl = null; $member_srl = null;
} }
if (!$member_srl) if (!$member_srl)
{ {
foreach ($config->mention_suffixes as $suffix) foreach ($config->mention_suffixes as $suffix)
@ -1524,7 +1524,7 @@ class ncenterliteController extends ncenterlite
$mention = substr($mention, 0, $pos); $mention = substr($mention, 0, $pos);
} }
} }
if (isset($members[$mention])) if (isset($members[$mention]))
{ {
continue; continue;
@ -1542,10 +1542,10 @@ class ncenterliteController extends ncenterlite
{ {
continue; continue;
} }
$members[$mention] = $member_srl; $members[$mention] = $member_srl;
} }
return array_values($members); return array_values($members);
} }
@ -1568,11 +1568,11 @@ class ncenterliteController extends ncenterlite
{ {
return false; return false;
} }
$oNcenterliteModel = getModel('ncenterlite'); $oNcenterliteModel = getModel('ncenterlite');
$content = $oNcenterliteModel->getNotificationText($args); $content = $oNcenterliteModel->getNotificationText($args);
$content = htmlspecialchars_decode(preg_replace('/<\/?(strong|)[^>]*>/', '', $content)); $content = htmlspecialchars_decode(preg_replace('/<\/?(strong|)[^>]*>/', '', $content));
$target_url = $args->target_url; $target_url = $args->target_url;
if (!preg_match('!^https?://!', $target_url)) if (!preg_match('!^https?://!', $target_url))
{ {
@ -1604,10 +1604,10 @@ class ncenterliteController extends ncenterlite
$oPush->setURL(strval($target_url)); $oPush->setURL(strval($target_url));
$oPush->addTo(intval($args->member_srl)); $oPush->addTo(intval($args->member_srl));
$output = $oPush->send(); $output = $oPush->send();
return $output; return $output;
} }
function sendSmsMessage($args) function sendSmsMessage($args)
{ {
$config = NcenterliteModel::getConfig(); $config = NcenterliteModel::getConfig();
@ -1645,7 +1645,7 @@ class ncenterliteController extends ncenterlite
{ {
$phone_country = $member_info->phone_country; $phone_country = $member_info->phone_country;
$phone_number = $member_info->phone_number; $phone_number = $member_info->phone_number;
// Sending SMS outside of Korea is currently not supported. // Sending SMS outside of Korea is currently not supported.
if($phone_country !== 'KOR') if($phone_country !== 'KOR')
{ {
@ -1695,7 +1695,7 @@ class ncenterliteController extends ncenterlite
{ {
return false; return false;
} }
$oNcenterliteModel = getModel('ncenterlite'); $oNcenterliteModel = getModel('ncenterlite');
$content = $oNcenterliteModel->getNotificationText($args); $content = $oNcenterliteModel->getNotificationText($args);
@ -1711,7 +1711,7 @@ class ncenterliteController extends ncenterlite
{ {
$target_url = Rhymix\Framework\URL::getCurrentDomainUrl($target_url); $target_url = Rhymix\Framework\URL::getCurrentDomainUrl($target_url);
} }
$mail_content = sprintf("<p>%s</p>\n<p>%s</p>\n", $content, $target_url); $mail_content = sprintf("<p>%s</p>\n<p>%s</p>\n", $content, $target_url);
$member_info = MemberModel::getMemberInfoByMemberSrl($args->member_srl); $member_info = MemberModel::getMemberInfoByMemberSrl($args->member_srl);
@ -1816,9 +1816,9 @@ class ncenterliteController extends ncenterlite
$document_srl = Context::get('target_srl'); $document_srl = Context::get('target_srl');
$config = NcenterliteModel::getConfig(); $config = NcenterliteModel::getConfig();
if($config->unsubscribe !== 'Y') return; if($config->unsubscribe !== 'Y') return;
$oDocumentController = getController('document'); $oDocumentController = getController('document');
$url = getUrl('','module','ncenterlite','act','dispNcenterliteInsertUnsubscribe', 'target_srl', $document_srl, 'unsubscribe_type', 'document'); $url = getUrl('','module','ncenterlite','act','dispNcenterliteInsertUnsubscribe', 'target_srl', $document_srl, 'unsubscribe_type', 'document');
$oDocumentController->addDocumentPopupMenu($url,'ncenterlite_cmd_unsubscribe_settings','','popup'); $oDocumentController->addDocumentPopupMenu($url,'ncenterlite_cmd_unsubscribe_settings','','popup');
@ -1838,17 +1838,17 @@ class ncenterliteController extends ncenterlite
$comment_srl = Context::get('target_srl'); $comment_srl = Context::get('target_srl');
$config = NcenterliteModel::getConfig(); $config = NcenterliteModel::getConfig();
if($config->unsubscribe !== 'Y') return; if($config->unsubscribe !== 'Y') return;
$oCommentController = getController('comment'); $oCommentController = getController('comment');
$url = getUrl('','module','ncenterlite','act','dispNcenterliteInsertUnsubscribe', 'target_srl', $comment_srl, 'unsubscribe_type', 'comment'); $url = getUrl('','module','ncenterlite','act','dispNcenterliteInsertUnsubscribe', 'target_srl', $comment_srl, 'unsubscribe_type', 'comment');
$oCommentController->addCommentPopupMenu($url,'ncenterlite_cmd_unsubscribe_settings','','popup'); $oCommentController->addCommentPopupMenu($url,'ncenterlite_cmd_unsubscribe_settings','','popup');
} }
/** /**
* Cut a string to fit the notification summary column. * Cut a string to fit the notification summary column.
* *
* @param string $str * @param string $str
* @return string * @return string
*/ */
@ -1864,10 +1864,10 @@ class ncenterliteController extends ncenterlite
return cut_str($str, 45); return cut_str($str, 45);
} }
} }
/** /**
* Cut a string to fit the notification content column. * Cut a string to fit the notification content column.
* *
* @param string $str * @param string $str
* @return string * @return string
*/ */

View file

@ -12,12 +12,12 @@ class ncenterliteModel extends ncenterlite
{ {
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');
$config = $oModuleModel->getModuleConfig('ncenterlite'); $config = $oModuleModel->getModuleConfig('ncenterlite');
if(!$config) if(!$config)
{ {
$config = new stdClass(); $config = new stdClass();
} }
$config->use = $config->use ?? array('message' => array('web' => 1)); $config->use = $config->use ?? array('message' => array('web' => 1));
$config->display_use = $config->display_use ?? 'all'; $config->display_use = $config->display_use ?? 'all';
$config->always_display = $config->always_display ?? 'N'; $config->always_display = $config->always_display ?? 'N';
@ -45,7 +45,7 @@ class ncenterliteModel extends ncenterlite
$config->mcolorset = $config->mcolorset ?? 'black'; $config->mcolorset = $config->mcolorset ?? 'black';
$config->zindex = $config->zindex ?? '9999'; $config->zindex = $config->zindex ?? '9999';
$config->notify_count = $config->notify_count ?? 5; $config->notify_count = $config->notify_count ?? 5;
if(!isset($config->hide_module_srls)) if(!isset($config->hide_module_srls))
{ {
$config->hide_module_srls = array(); $config->hide_module_srls = array();
@ -54,7 +54,7 @@ class ncenterliteModel extends ncenterlite
{ {
$config->hide_module_srls = explode('|@|', $config->hide_module_srls); $config->hide_module_srls = explode('|@|', $config->hide_module_srls);
} }
// Convert old config format // Convert old config format
if($config->use === 'Y') if($config->use === 'Y')
{ {
@ -74,13 +74,13 @@ class ncenterliteModel extends ncenterlite
getController('module')->insertModuleConfig('ncenterlite', $config); getController('module')->insertModuleConfig('ncenterlite', $config);
} }
unset($config->mention_format); unset($config->mention_format);
self::$_config = $config; self::$_config = $config;
} }
return self::$_config; return self::$_config;
} }
public static function getNotifyTypes() public static function getNotifyTypes()
{ {
$default = array( $default = array(
@ -95,7 +95,7 @@ class ncenterliteModel extends ncenterlite
{ {
$default['admin_content'] = 0; $default['admin_content'] = 0;
} }
$custom_types = Rhymix\Framework\Cache::get('ncenterlite:notify_types'); $custom_types = Rhymix\Framework\Cache::get('ncenterlite:notify_types');
if (!$custom_types) if (!$custom_types)
{ {
@ -109,11 +109,11 @@ class ncenterliteModel extends ncenterlite
$default[$type->notify_type_id] = $type->notify_type_srl; $default[$type->notify_type_id] = $type->notify_type_srl;
} }
} }
$default['custom'] = 0; $default['custom'] = 0;
return $default; return $default;
} }
public static function getUserSetNotifyTypes() public static function getUserSetNotifyTypes()
{ {
return array( return array(
@ -196,20 +196,20 @@ class ncenterliteModel extends ncenterlite
return false; return false;
} }
} }
$member_srl = intval($member_srl); $member_srl = intval($member_srl);
$config = self::$_user_config[$member_srl] ?? null; $config = self::$_user_config[$member_srl] ?? null;
if ($config !== null) if ($config !== null)
{ {
return $config; return $config;
} }
$config = Rhymix\Framework\Cache::get('ncenterlite:user_config:' . $member_srl); $config = Rhymix\Framework\Cache::get('ncenterlite:user_config:' . $member_srl);
if ($config !== null) if ($config !== null)
{ {
return $config; return $config;
} }
$args = new stdClass(); $args = new stdClass();
$args->member_srl = $member_srl; $args->member_srl = $member_srl;
$output = executeQuery('ncenterlite.getUserConfig', $args); $output = executeQuery('ncenterlite.getUserConfig', $args);
@ -238,7 +238,7 @@ class ncenterliteModel extends ncenterlite
} }
} }
} }
self::$_user_config[$member_srl] = $config; self::$_user_config[$member_srl] = $config;
Rhymix\Framework\Cache::set('ncenterlite:user_config:' . $member_srl, $config); Rhymix\Framework\Cache::set('ncenterlite:user_config:' . $member_srl, $config);
return $config; return $config;
@ -271,31 +271,31 @@ class ncenterliteModel extends ncenterlite
{ {
$output = $this->_getMyNotifyList($member_srl, $page, $readed); $output = $this->_getMyNotifyList($member_srl, $page, $readed);
} }
$config = $this->getConfig(); $config = $this->getConfig();
$oMemberModel = getModel('member'); $oMemberModel = getModel('member');
$list = $output->data; $list = $output->data;
foreach($list as $k => $v) foreach($list as $k => $v)
{ {
$v->text = $this->getNotificationText($v); $v->text = $this->getNotificationText($v);
$v->ago = $this->getAgo($v->regdate); $v->ago = $this->getAgo($v->regdate);
$v->url = getUrl('','act','procNcenterliteRedirect', 'notify', $v->notify); $v->url = getUrl('','act','procNcenterliteRedirect', 'notify', $v->notify);
if($v->target_member_srl < 0) if($v->target_member_srl < 0)
{ {
$v->target_member_srl = 0; $v->target_member_srl = 0;
$v->target_nick_name = lang('anonymous'); $v->target_nick_name = lang('anonymous');
$v->target_user_id = $v->target_email_address = 'anonymous'; $v->target_user_id = $v->target_email_address = 'anonymous';
} }
if(($v->target_type === $this->_TYPE_VOTED && $config->anonymous_voter === 'Y') || ($v->target_type === $this->_TYPE_SCRAPPED && $config->anonymous_scrap === 'Y')) if(($v->target_type === $this->_TYPE_VOTED && $config->anonymous_voter === 'Y') || ($v->target_type === $this->_TYPE_SCRAPPED && $config->anonymous_scrap === 'Y'))
{ {
$v->target_member_srl = 0; $v->target_member_srl = 0;
$v->target_nick_name = lang('anonymous'); $v->target_nick_name = lang('anonymous');
$v->target_user_id = $v->target_email_address = 'anonymous'; $v->target_user_id = $v->target_email_address = 'anonymous';
} }
if($v->target_member_srl) if($v->target_member_srl)
{ {
$profileImage = $oMemberModel->getProfileImage($v->target_member_srl); $profileImage = $oMemberModel->getProfileImage($v->target_member_srl);
@ -389,19 +389,19 @@ class ncenterliteModel extends ncenterlite
$args = new stdClass(); $args = new stdClass();
$args->member_srl = $member_srl; $args->member_srl = $member_srl;
$args->page = $page ? $page : 1; $args->page = $page ? $page : 1;
if ($readed) if ($readed)
{ {
$args->readed = $readed; $args->readed = $readed;
} }
$notify_count = intval(self::getConfig()->notify_count); $notify_count = intval(self::getConfig()->notify_count);
if($notify_count) if($notify_count)
{ {
$args->list_count = $notify_count; $args->list_count = $notify_count;
} }
$output = executeQueryArray('ncenterlite.getNotifyList', $args); $output = executeQueryArray('ncenterlite.getNotifyList', $args);
if (!$output->data) if (!$output->data)
{ {
@ -467,7 +467,7 @@ class ncenterliteModel extends ncenterlite
{ {
$member_srl[] = $member->member_srl; $member_srl[] = $member->member_srl;
} }
return $member_srl; return $member_srl;
} }
@ -495,7 +495,7 @@ class ncenterliteModel extends ncenterlite
$output = $this->_getMyNotifyList($member_srl); $output = $this->_getMyNotifyList($member_srl);
return $output->total_count; return $output->total_count;
} }
$args = new stdClass(); $args = new stdClass();
$args->member_srl = $member_srl; $args->member_srl = $member_srl;
$output = executeQuery('ncenterlite.getNotifyNewCount', $args); $output = executeQuery('ncenterlite.getNotifyNewCount', $args);
@ -520,10 +520,10 @@ class ncenterliteModel extends ncenterlite
if(count($colorset_list)) $colorsets = implode("\n", $colorset_list); if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
$this->add('colorset_list', $colorsets); $this->add('colorset_list', $colorsets);
} }
/** /**
* Get information about a single notification. * Get information about a single notification.
* *
* @param string $notify * @param string $notify
* @param int $member_srl * @param int $member_srl
* @return object|false * @return object|false
@ -543,10 +543,10 @@ class ncenterliteModel extends ncenterlite
return false; return false;
} }
} }
/** /**
* Return the notification text. * Return the notification text.
* *
* @param object $notification * @param object $notification
* @return string * @return string
*/ */
@ -599,15 +599,15 @@ class ncenterliteModel extends ncenterlite
$notification->target_summary, // %6$s $notification->target_summary, // %6$s
$notification->target_url, // %7$s $notification->target_url, // %7$s
)); ));
// Other. // Other.
case 'U': case 'U':
default: default:
return $this->getNotifyTypeString($notification->notify_type, unserialize($notification->target_body)) ?: lang('ncenterlite'); return $this->getNotifyTypeString($notification->notify_type, unserialize($notification->target_body)) ?: lang('ncenterlite');
} }
$config = $this->getConfig(); $config = $this->getConfig();
// Get the notification text. // Get the notification text.
switch ($notification->target_type) switch ($notification->target_type)
{ {
@ -685,7 +685,7 @@ class ncenterliteModel extends ncenterlite
case 'I': case 'I':
$str = sprintf(lang('ncenterlite_insert_member_message'), $notification->target_nick_name); $str = sprintf(lang('ncenterlite_insert_member_message'), $notification->target_nick_name);
break; break;
case 'G': case 'G':
$str = sprintf(lang('ncenterlite_commented'), $notification->target_nick_name, $type, $notification->target_summary); $str = sprintf(lang('ncenterlite_commented'), $notification->target_nick_name, $type, $notification->target_summary);
break; break;
@ -754,7 +754,7 @@ class ncenterliteModel extends ncenterlite
return $output->data; return $output->data;
} }
/** /**
* 알림에서 member_srl 정리해서 보내준다. * 알림에서 member_srl 정리해서 보내준다.
* @param int $srl * @param int $srl
@ -773,7 +773,7 @@ class ncenterliteModel extends ncenterlite
{ {
return []; return [];
} }
$member_srls = array(); $member_srls = array();
foreach($output->data ?? [] as $value) foreach($output->data ?? [] as $value)
{ {
@ -798,7 +798,7 @@ class ncenterliteModel extends ncenterlite
{ {
$member_srl = $this->user->member_srl; $member_srl = $this->user->member_srl;
} }
$args = new stdClass(); $args = new stdClass();
$args->target_srl = $target_srl; $args->target_srl = $target_srl;
$args->member_srl = $member_srl; $args->member_srl = $member_srl;

View file

@ -67,7 +67,7 @@ class ncenterliteView extends ncenterlite
throw new Rhymix\Framework\Exceptions\NotPermitted('ncenterlite_stop_no_permission_other_user'); throw new Rhymix\Framework\Exceptions\NotPermitted('ncenterlite_stop_no_permission_other_user');
} }
} }
$user_selected = []; $user_selected = [];
$user_config = NcenterliteModel::getUserConfig($member_srl) ?: new stdClass; $user_config = NcenterliteModel::getUserConfig($member_srl) ?: new stdClass;
$notify_types = NcenterliteModel::getUserSetNotifyTypes(); $notify_types = NcenterliteModel::getUserSetNotifyTypes();
@ -84,7 +84,7 @@ class ncenterliteView extends ncenterlite
$user_selected[$notify_type][$item]->selected = $selected; $user_selected[$notify_type][$item]->selected = $selected;
} }
} }
Context::set('member_info', $member_info ?? null); Context::set('member_info', $member_info ?? null);
Context::set('notify_types', $notify_types); Context::set('notify_types', $notify_types);
Context::set('user_config', $user_config); Context::set('user_config', $user_config);
@ -105,12 +105,12 @@ class ncenterliteView extends ncenterlite
/** @var ncenterliteModel $oNcenterliteModel */ /** @var ncenterliteModel $oNcenterliteModel */
$oNcenterliteModel = getModel('ncenterlite'); $oNcenterliteModel = getModel('ncenterlite');
$config = $oNcenterliteModel->getConfig(); $config = $oNcenterliteModel->getConfig();
if($config->unsubscribe !== 'Y') if($config->unsubscribe !== 'Y')
{ {
throw new Rhymix\Framework\Exception('msg_unsubscribe_block_not_support'); throw new Rhymix\Framework\Exception('msg_unsubscribe_block_not_support');
} }
if(!Rhymix\Framework\Session::getMemberSrl()) if(!Rhymix\Framework\Session::getMemberSrl())
{ {
throw new Rhymix\Framework\Exceptions\MustLogin; throw new Rhymix\Framework\Exceptions\MustLogin;
@ -125,7 +125,7 @@ class ncenterliteView extends ncenterlite
{ {
throw new Rhymix\Framework\Exceptions\NotPermitted('msg_unsubscribe_not_permission'); throw new Rhymix\Framework\Exceptions\NotPermitted('msg_unsubscribe_not_permission');
} }
$args = new stdClass(); $args = new stdClass();
$args->page = Context::get('page'); $args->page = Context::get('page');
$args->list_count = '20'; $args->list_count = '20';
@ -138,32 +138,32 @@ class ncenterliteView extends ncenterlite
Context::set('page', $output->page); Context::set('page', $output->page);
Context::set('unsubscribe_list', $output->data); Context::set('unsubscribe_list', $output->data);
Context::set('page_navigation', $output->page_navigation); Context::set('page_navigation', $output->page_navigation);
$this->setTemplateFileOrDefault('unsubscribeList'); $this->setTemplateFileOrDefault('unsubscribeList');
} }
function dispNcenterliteInsertUnsubscribe() function dispNcenterliteInsertUnsubscribe()
{ {
$this->setLayoutFile('popup_layout'); $this->setLayoutFile('popup_layout');
/** @var ncenterliteModel $oNcenterliteModel */ /** @var ncenterliteModel $oNcenterliteModel */
$oNcenterliteModel = getModel('ncenterlite'); $oNcenterliteModel = getModel('ncenterlite');
$target_srl = Context::get('target_srl'); $target_srl = Context::get('target_srl');
$unsubscribe_srl = Context::get('unsubscribe_srl'); $unsubscribe_srl = Context::get('unsubscribe_srl');
$unsubscribe_type = Context::get('unsubscribe_type'); $unsubscribe_type = Context::get('unsubscribe_type');
$member_srl = Context::get('member_srl'); $member_srl = Context::get('member_srl');
if(!$member_srl) if(!$member_srl)
{ {
$member_srl = $this->user->member_srl; $member_srl = $this->user->member_srl;
} }
if($this->user->is_admin !== 'Y' && intval($member_srl) !== intval($this->user->member_srl)) if($this->user->is_admin !== 'Y' && intval($member_srl) !== intval($this->user->member_srl))
{ {
throw new \Rhymix\Framework\Exception('msg_invalid_request'); throw new \Rhymix\Framework\Exception('msg_invalid_request');
} }
if($unsubscribe_srl) if($unsubscribe_srl)
{ {
$output = $oNcenterliteModel->getUserUnsubscribeConfigByUnsubscribeSrl($unsubscribe_srl); $output = $oNcenterliteModel->getUserUnsubscribeConfigByUnsubscribeSrl($unsubscribe_srl);
@ -172,12 +172,12 @@ class ncenterliteView extends ncenterlite
{ {
$output = $oNcenterliteModel->getUserUnsubscribeConfigByTargetSrl($target_srl, $member_srl); $output = $oNcenterliteModel->getUserUnsubscribeConfigByTargetSrl($target_srl, $member_srl);
} }
if((!$target_srl || !$unsubscribe_type) && empty($output)) if((!$target_srl || !$unsubscribe_type) && empty($output))
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
if($unsubscribe_type == 'document') if($unsubscribe_type == 'document')
{ {
$text = getModel('document')->getDocument($target_srl)->getTitleText(); $text = getModel('document')->getDocument($target_srl)->getTitleText();
@ -215,11 +215,11 @@ class ncenterliteView extends ncenterlite
} }
} }
} }
Context::set('unsubscribeData', $output); Context::set('unsubscribeData', $output);
Context::set('text', $text); Context::set('text', $text);
Context::set('type', $type); Context::set('type', $type);
$this->setTemplateFileOrDefault('unsubscribe'); $this->setTemplateFileOrDefault('unsubscribe');
} }

View file

@ -40,7 +40,7 @@ class pageAdminController extends page
$args->browser_title = trim(utf8_normalize_spaces($args->browser_title)); $args->browser_title = trim(utf8_normalize_spaces($args->browser_title));
$args->meta_keywords = $args->meta_keywords ? implode(', ', array_map('trim', explode(',', $args->meta_keywords))) : ''; $args->meta_keywords = $args->meta_keywords ? implode(', ', array_map('trim', explode(',', $args->meta_keywords))) : '';
$args->meta_description = trim(utf8_normalize_spaces($args->meta_description)); $args->meta_description = trim(utf8_normalize_spaces($args->meta_description));
// Check if an original module exists by using module_srl // Check if an original module exists by using module_srl
if($args->module_srl) if($args->module_srl)
{ {
@ -328,7 +328,7 @@ class pageAdminController extends page
$target = ($obj->isMobile == 'Y') ? 'mdocument_srl' : 'document_srl'; $target = ($obj->isMobile == 'Y') ? 'mdocument_srl' : 'document_srl';
// 이미 존재하는 경우 수정 // 이미 존재하는 경우 수정
if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl)
{ {
$output = $oDocumentController->updateDocument($oDocument, $obj); $output = $oDocumentController->updateDocument($oDocument, $obj);
$msg_code = 'success_updated'; $msg_code = 'success_updated';

View file

@ -188,10 +188,10 @@ class pageAdminView extends page
{ {
throw new Rhymix\Framework\Exception(sprintf('%s method is not exists', $method)); throw new Rhymix\Framework\Exception(sprintf('%s method is not exists', $method));
} }
Context::set('module_info', $this->module_info); Context::set('module_info', $this->module_info);
Context::set('page_content', $page_content); Context::set('page_content', $page_content);
$this->setLayoutFile(''); $this->setLayoutFile('');
$this->setTemplateFile('mcontent'); $this->setTemplateFile('mcontent');
} }
@ -258,11 +258,11 @@ class pageAdminView extends page
//Security //Security
$security = new Security(); $security = new Security();
$security->encodeHTML('widget_list..title','module_info.mid'); $security->encodeHTML('widget_list..title','module_info.mid');
// Load admin resources // Load admin resources
$oTemplate = TemplateHandler::getInstance(); $oTemplate = TemplateHandler::getInstance();
$oTemplate->compile('modules/admin/tpl', '_admin_common.html'); $oTemplate->compile('modules/admin/tpl', '_admin_common.html');
// Set a template file // Set a template file
$this->setLayoutFile(''); $this->setLayoutFile('');
$this->setTemplateFile($templateFile); $this->setTemplateFile($templateFile);
@ -289,7 +289,7 @@ class pageAdminView extends page
$document_srl = $this->module_info->{$target}; $document_srl = $this->module_info->{$target};
$oDocument->setDocument($document_srl); $oDocument->setDocument($document_srl);
Context::set('document_srl', $document_srl); Context::set('document_srl', $document_srl);
} }
else if(Context::get('document_srl')) else if(Context::get('document_srl'))
{ {
$document_srl = Context::get('document_srl'); $document_srl = Context::get('document_srl');
@ -300,11 +300,11 @@ class pageAdminView extends page
{ {
$oDocument->add('module_srl', $this->module_info->module_srl); $oDocument->add('module_srl', $this->module_info->module_srl);
} }
Context::addJsFilter($this->module_path.'tpl/filter', 'insert_article.xml'); Context::addJsFilter($this->module_path.'tpl/filter', 'insert_article.xml');
Context::set('oDocument', $oDocument); Context::set('oDocument', $oDocument);
Context::set('mid', $this->module_info->mid); Context::set('mid', $this->module_info->mid);
$this->setLayoutFile(''); $this->setLayoutFile('');
$this->setTemplateFile('article_content_modify'); $this->setTemplateFile('article_content_modify');
} }

View file

@ -67,7 +67,7 @@ class pageController extends page
} }
/** /**
* @brief Change the value of src, href in the content * @brief Change the value of src, href in the content
*/ */
function replaceSrc($content, $path) function replaceSrc($content, $path)
{ {

View file

@ -32,7 +32,7 @@ class pageView extends page
$this instanceof pageMobile ? 'm' : 'pc', $this instanceof pageMobile ? 'm' : 'pc',
]); ]);
} }
if ($this->module_info->page_type === 'OUTSIDE') if ($this->module_info->page_type === 'OUTSIDE')
{ {
$this->interval = (int)($this->module_info->page_caching_interval ?? 0); $this->interval = (int)($this->module_info->page_caching_interval ?? 0);
@ -79,7 +79,7 @@ class pageView extends page
Context::set('module_info', $this->module_info); Context::set('module_info', $this->module_info);
Context::set('page_content', $page_content); Context::set('page_content', $page_content);
// if the page type is the widget or outside, there might be usable GET entities. // if the page type is the widget or outside, there might be usable GET entities.
$request_vars = Context::getRequestVars(); $request_vars = Context::getRequestVars();
if (isset($request_vars->document_srl) && intval($request_vars->document_srl) > 0 && $page_type_name == 'article') if (isset($request_vars->document_srl) && intval($request_vars->document_srl) > 0 && $page_type_name == 'article')
@ -104,7 +104,7 @@ class pageView extends page
{ {
$page_content = $this->module_info->content; $page_content = $this->module_info->content;
} }
if ($this->interval > 0) if ($this->interval > 0)
{ {
if (!file_exists($this->cache_file) || !filesize($this->cache_file)) if (!file_exists($this->cache_file) || !filesize($this->cache_file))
@ -118,7 +118,7 @@ class pageView extends page
if($mtime && $mtime + ($this->interval * 60) > \RX_TIME) if($mtime && $mtime + ($this->interval * 60) > \RX_TIME)
{ {
$page_content = FileHandler::readFile($this->cache_file); $page_content = FileHandler::readFile($this->cache_file);
$page_content = str_replace('<!--#Meta:', '<!--Meta:', $page_content); $page_content = str_replace('<!--#Meta:', '<!--Meta:', $page_content);
} }
else else
@ -135,7 +135,7 @@ class pageView extends page
FileHandler::removeFile($this->cache_file); FileHandler::removeFile($this->cache_file);
} }
} }
return $page_content; return $page_content;
} }
@ -167,7 +167,7 @@ class pageView extends page
{ {
return; return;
} }
// Kick out anyone who tries to exploit RVE-2022-2. // Kick out anyone who tries to exploit RVE-2022-2.
foreach (Context::getRequestVars() as $key => $val) foreach (Context::getRequestVars() as $key => $val)
{ {
@ -176,13 +176,13 @@ class pageView extends page
throw new Rhymix\Framework\Exceptions\SecurityViolation(); throw new Rhymix\Framework\Exceptions\SecurityViolation();
} }
} }
// External URL // External URL
if (preg_match('!^[a-z]+://!i', $this->path)) if (preg_match('!^[a-z]+://!i', $this->path))
{ {
return $this->getHtmlPage($this->path, $this->interval, $this->cache_file); return $this->getHtmlPage($this->path, $this->interval, $this->cache_file);
} }
// Internal PHP document // Internal PHP document
else else
{ {
@ -205,10 +205,10 @@ class pageView extends page
FileHandler::getRemoteFile($path, $cache_file); FileHandler::getRemoteFile($path, $cache_file);
$content = FileHandler::readFile($cache_file); $content = FileHandler::readFile($cache_file);
} }
// Create opage controller // Create opage controller
$oPageController = getController('page'); $oPageController = getController('page');
// change url of image, css, javascript and so on if the page is from external server // change url of image, css, javascript and so on if the page is from external server
$content = $oPageController->replaceSrc($content, $path); $content = $oPageController->replaceSrc($content, $path);
@ -217,15 +217,15 @@ class pageView extends page
$buff->content = $content; $buff->content = $content;
$buff = Context::convertEncoding($buff); $buff = Context::convertEncoding($buff);
$content = $buff->content; $content = $buff->content;
// Extract a title // Extract a title
$title = $oPageController->getTitle($content); $title = $oPageController->getTitle($content);
if($title) Context::setBrowserTitle($title); if($title) Context::setBrowserTitle($title);
// Extract header script // Extract header script
$head_script = $oPageController->getHeadScript($content); $head_script = $oPageController->getHeadScript($content);
if($head_script) Context::addHtmlHeader($head_script); if($head_script) Context::addHtmlHeader($head_script);
// Extract content from the body // Extract content from the body
$body_script = $oPageController->getBodyScript($content); $body_script = $oPageController->getBodyScript($content);
if(!$body_script) $body_script = $content; if(!$body_script) $body_script = $content;
@ -250,7 +250,7 @@ class pageView extends page
{ {
return file_get_contents($cache_file); return file_get_contents($cache_file);
} }
// Parse as template if enabled. // Parse as template if enabled.
if ($this->proc_tpl) if ($this->proc_tpl)
{ {
@ -264,7 +264,7 @@ class pageView extends page
{ {
return ''; return '';
} }
// Include template file in an isolated scope. // Include template file in an isolated scope.
$content = ''; $content = '';
$include_path = get_include_path(); $include_path = get_include_path();
@ -282,7 +282,7 @@ class pageView extends page
{ {
$content .= ob_get_clean(); $content .= ob_get_clean();
} }
// Insert comments for debugging. // Insert comments for debugging.
if(Rhymix\Framework\Debug::isEnabledForCurrentUser() && Context::getResponseMethod() === 'HTML' && !starts_with('<!DOCTYPE', $content) && !starts_with('<?xml', $content)) if(Rhymix\Framework\Debug::isEnabledForCurrentUser() && Context::getResponseMethod() === 'HTML' && !starts_with('<!DOCTYPE', $content) && !starts_with('<?xml', $content))
{ {
@ -290,7 +290,7 @@ class pageView extends page
$content = sprintf($sign, 'start') . $content . sprintf($sign, 'end'); $content = sprintf($sign, 'start') . $content . sprintf($sign, 'end');
} }
} }
// Parse as PHP if enabled. // Parse as PHP if enabled.
elseif ($this->proc_php) elseif ($this->proc_php)
{ {
@ -300,13 +300,13 @@ class pageView extends page
}); });
$content = ob_get_clean(); $content = ob_get_clean();
} }
// Otherwise, get the raw content of the file. // Otherwise, get the raw content of the file.
else else
{ {
$content = file_get_contents($real_target_file); $content = file_get_contents($real_target_file);
} }
// Convert relative paths to absolute paths. // Convert relative paths to absolute paths.
$this->path = str_replace('\\', '/', dirname($real_target_file)) . '/'; $this->path = str_replace('\\', '/', dirname($real_target_file)) . '/';
$content = preg_replace_callback('/\b(target=|src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is', array($this, '_replacePath'), $content); $content = preg_replace_callback('/\b(target=|src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is', array($this, '_replacePath'), $content);
@ -320,7 +320,7 @@ class pageView extends page
function _replacePath($matches) function _replacePath($matches)
{ {
$val = trim($matches[3]); $val = trim($matches[3]);
// Pass if the path is external or starts with /, #, { characters // Pass if the path is external or starts with /, #, { characters
// /=absolute path, #=hash in a page, {=Template syntax // /=absolute path, #=hash in a page, {=Template syntax
if(strpos($val, '.') === FALSE || preg_match('@^((?:http|https|ftp|telnet|mms)://|(?:mailto|javascript):|[/#{])@i',$val)) if(strpos($val, '.') === FALSE || preg_match('@^((?:http|https|ftp|telnet|mms)://|(?:mailto|javascript):|[/#{])@i',$val))

View file

@ -173,7 +173,7 @@ class pointAdminController extends point
// A function to calculate per-level points // A function to calculate per-level points
$config->expression = $args->expression; $config->expression = $args->expression;
// Save // Save
$oModuleController->insertModuleConfig('point', $config); $oModuleController->insertModuleConfig('point', $config);
@ -195,7 +195,7 @@ class pointAdminController extends point
'voter', 'blamer', 'voter_comment', 'blamer_comment', 'voter', 'blamer', 'voter_comment', 'blamer_comment',
'download_file_author', 'read_document_author', 'voted', 'blamed', 'voted_comment', 'blamed_comment', 'download_file_author', 'read_document_author', 'voted', 'blamed', 'voted_comment', 'blamed_comment',
); );
foreach($configTypeList AS $config) foreach($configTypeList AS $config)
{ {
if(is_array($args->{$config})) if(is_array($args->{$config}))
@ -385,7 +385,7 @@ class pointAdminController extends point
$output = executeQuery("point.initMemberPoint"); $output = executeQuery("point.initMemberPoint");
if(!$output->toBool()) return $output; if(!$output->toBool()) return $output;
// Save the file temporarily // Save the file temporarily
$str = ''; $str = '';
foreach($member as $key => $val) foreach($member as $key => $val)
{ {
@ -432,7 +432,7 @@ class pointAdminController extends point
{ {
FileHandler::removeFile('./files/cache/pointRecal.txt'); FileHandler::removeFile('./files/cache/pointRecal.txt');
$idx = $total; $idx = $total;
Rhymix\Framework\Cache::clearGroup('member'); Rhymix\Framework\Cache::clearGroup('member');
FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old'); FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old');
FileHandler::removeDir('./files/member_extra_info/point.old'); FileHandler::removeDir('./files/member_extra_info/point.old');

View file

@ -47,11 +47,11 @@ class pointAdminView extends point
} }
} }
Context::set('group_list', $selected_group_list); Context::set('group_list', $selected_group_list);
// Get max level allowed by system // Get max level allowed by system
$system_max_level = min(1000, ini_get('max_input_vars') - 100); $system_max_level = min(1000, ini_get('max_input_vars') - 100);
Context::set('system_max_level', $system_max_level); Context::set('system_max_level', $system_max_level);
//Security //Security
$security = new Security(); $security = new Security();
$security->encodeHTML('group_list..title','group_list..description'); $security->encodeHTML('group_list..title','group_list..description');
@ -116,7 +116,7 @@ class pointAdminView extends point
$columnList = array('member.member_srl', 'member.user_id', 'member.email_address', 'member.nick_name', 'point.point'); $columnList = array('member.member_srl', 'member.user_id', 'member.email_address', 'member.nick_name', 'point.point');
$output = $oPointModel->getMemberList($args, $columnList); $output = $oPointModel->getMemberList($args, $columnList);
// context::set for writing into a template // context::set for writing into a template
Context::set('total_count', $output->total_count); Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page); Context::set('total_page', $output->total_page);
Context::set('page', $output->page); Context::set('page', $output->page);

View file

@ -11,17 +11,17 @@ class point extends ModuleObject
* Cache for the point module's own configuration. * Cache for the point module's own configuration.
*/ */
protected static $_config = null; protected static $_config = null;
/** /**
* Cache for other modules' point configuration. * Cache for other modules' point configuration.
*/ */
protected static $_module_config_cache = array(); protected static $_module_config_cache = array();
/** /**
* Cache for member points. * Cache for member points.
*/ */
protected static $_member_point_cache = array(); protected static $_member_point_cache = array();
/** /**
* Triggers to insert. * Triggers to insert.
*/ */
@ -49,7 +49,7 @@ class point extends ModuleObject
array('module.procModuleAdminCopyModule', 'after', 'controller', 'triggerCopyModule'), array('module.procModuleAdminCopyModule', 'after', 'controller', 'triggerCopyModule'),
array('module.dispAdditionSetup', 'after', 'view', 'triggerDispPointAdditionSetup'), array('module.dispAdditionSetup', 'after', 'view', 'triggerDispPointAdditionSetup'),
); );
/** /**
* Triggers to delete. * Triggers to delete.
*/ */
@ -58,7 +58,7 @@ class point extends ModuleObject
array('document.deleteDocument', 'before', 'controller', 'triggerBeforeDeleteDocument'), array('document.deleteDocument', 'before', 'controller', 'triggerBeforeDeleteDocument'),
array('file.insertFile', 'after', 'controller', 'triggerInsertFile'), array('file.insertFile', 'after', 'controller', 'triggerInsertFile'),
); );
/** /**
* @brief Shortcut to getting module configuration * @brief Shortcut to getting module configuration
*/ */
@ -70,10 +70,10 @@ class point extends ModuleObject
} }
return self::$_config; return self::$_config;
} }
/** /**
* Check triggers. * Check triggers.
* *
* @return bool * @return bool
*/ */
public function checkTriggers() public function checkTriggers()
@ -95,10 +95,10 @@ class point extends ModuleObject
} }
return false; return false;
} }
/** /**
* Register triggers. * Register triggers.
* *
* @return object * @return object
*/ */
public function registerTriggers() public function registerTriggers()
@ -120,7 +120,7 @@ class point extends ModuleObject
} }
} }
} }
/** /**
* @brief Additional tasks required to accomplish during the installation * @brief Additional tasks required to accomplish during the installation
*/ */
@ -140,7 +140,7 @@ class point extends ModuleObject
{ {
$config->level_step[$i] = pow($i, 2) * 90; $config->level_step[$i] = pow($i, 2) * 90;
} }
// Define default points. // Define default points.
$config->signup_point = 10; $config->signup_point = 10;
$config->login_point = 5; $config->login_point = 5;
@ -153,10 +153,10 @@ class point extends ModuleObject
$config->blamed = 0; $config->blamed = 0;
$config->voted_comment = 0; $config->voted_comment = 0;
$config->blamed_comment = 0; $config->blamed_comment = 0;
// Save module config. // Save module config.
getController('module')->insertModuleConfig('point', $config); getController('module')->insertModuleConfig('point', $config);
// Create a directory to store points information. // Create a directory to store points information.
FileHandler::makeDir('./files/member_extra_info/point'); FileHandler::makeDir('./files/member_extra_info/point');
} }
@ -186,7 +186,7 @@ class point extends ModuleObject
*/ */
function recompileCache() function recompileCache()
{ {
} }
} }
/* End of file point.class.php */ /* End of file point.class.php */

View file

@ -11,7 +11,7 @@ class pointController extends point
* Variables for internal reference. * Variables for internal reference.
*/ */
protected $_original; protected $_original;
/** /**
* @brief Initialization * @brief Initialization
*/ */
@ -29,7 +29,7 @@ class pointController extends point
{ {
return; return;
} }
$config = $this->getConfig(); $config = $this->getConfig();
$diff = intval($config->signup_point); $diff = intval($config->signup_point);
if ($diff != 0) if ($diff != 0)
@ -49,13 +49,13 @@ class pointController extends point
{ {
return; return;
} }
// Points are given only once a day. // Points are given only once a day.
if (substr($obj->last_login, 0, 8) === date('Ymd')) if (substr($obj->last_login, 0, 8) === date('Ymd'))
{ {
return; return;
} }
$config = $this->getConfig(); $config = $this->getConfig();
$diff = intval($config->login_point); $diff = intval($config->login_point);
if ($diff != 0) if ($diff != 0)
@ -72,7 +72,7 @@ class pointController extends point
{ {
$group_srl = $obj->group_srl; $group_srl = $obj->group_srl;
$config = $this->getConfig(); $config = $this->getConfig();
// Exclude deleted group from point/level/group integration // Exclude deleted group from point/level/group integration
if($config->point_group && isset($config->point_group[$group_srl])) if($config->point_group && isset($config->point_group[$group_srl]))
{ {
@ -80,7 +80,7 @@ class pointController extends point
getController('module')->insertModuleConfig('point', $config); getController('module')->insertModuleConfig('point', $config);
} }
} }
/** /**
* @brief A trigger to add points to the member for creating a post * @brief A trigger to add points to the member for creating a post
*/ */
@ -92,7 +92,7 @@ class pointController extends point
{ {
return; return;
} }
// The fix to disable giving points for saving the document temporarily // The fix to disable giving points for saving the document temporarily
if ($module_srl == $member_srl) if ($module_srl == $member_srl)
{ {
@ -102,19 +102,19 @@ class pointController extends point
{ {
return; return;
} }
$diff = 0; $diff = 0;
// Add points for the document. // Add points for the document.
$diff += $this->_getModulePointConfig($module_srl, 'insert_document'); $diff += $this->_getModulePointConfig($module_srl, 'insert_document');
// Add points for attached files. // Add points for attached files.
if ($obj->updated_file_count > 0) if ($obj->updated_file_count > 0)
{ {
$upload_point = $this->_getModulePointConfig($module_srl, 'upload_file'); $upload_point = $this->_getModulePointConfig($module_srl, 'upload_file');
$diff += $upload_point * $obj->updated_file_count; $diff += $upload_point * $obj->updated_file_count;
} }
// Increase the point. // Increase the point.
if ($diff != 0) if ($diff != 0)
{ {
@ -137,7 +137,7 @@ class pointController extends point
} }
} }
} }
/** /**
* @brief The trigger to give points for normal saving the temporarily saved document * @brief The trigger to give points for normal saving the temporarily saved document
* Temporary storage at the point in 1.2.3 changed to avoid payment * Temporary storage at the point in 1.2.3 changed to avoid payment
@ -154,15 +154,15 @@ class pointController extends point
$module_srl = $obj->module_srl; $module_srl = $obj->module_srl;
$member_srl = $obj->member_srl; $member_srl = $obj->member_srl;
} }
if (!$module_srl || !$member_srl) if (!$module_srl || !$member_srl)
{ {
$this->_original = null; $this->_original = null;
return; return;
} }
$diff = 0; $diff = 0;
// Add points for the document, only if the document is being updated from TEMP to another status such as PUBLIC. // Add points for the document, only if the document is being updated from TEMP to another status such as PUBLIC.
if ($obj->status !== DocumentModel::getConfigStatus('temp') && $this->_original->get('status') === DocumentModel::getConfigStatus('temp')) if ($obj->status !== DocumentModel::getConfigStatus('temp') && $this->_original->get('status') === DocumentModel::getConfigStatus('temp'))
{ {
@ -175,14 +175,14 @@ class pointController extends point
$upload_point = $this->_getModulePointConfig($module_srl, 'upload_file'); $upload_point = $this->_getModulePointConfig($module_srl, 'upload_file');
$diff += $upload_point * $obj->updated_file_count; $diff += $upload_point * $obj->updated_file_count;
} }
// Increase the point. // Increase the point.
if ($diff != 0) if ($diff != 0)
{ {
$cur_point = PointModel::getPoint($member_srl); $cur_point = PointModel::getPoint($member_srl);
$this->setPoint($member_srl, $cur_point + $diff); $this->setPoint($member_srl, $cur_point + $diff);
} }
// Remove the reference to the original document. // Remove the reference to the original document.
$this->_original = null; $this->_original = null;
} }
@ -192,7 +192,7 @@ class pointController extends point
*/ */
public function triggerBeforeDeleteDocument($obj) public function triggerBeforeDeleteDocument($obj)
{ {
} }
/** /**
@ -210,14 +210,14 @@ class pointController extends point
{ {
return; return;
} }
// Return if disabled // Return if disabled
$config = $this->getConfig(); $config = $this->getConfig();
if ($config->insert_document_revert_on_delete === false) if ($config->insert_document_revert_on_delete === false)
{ {
return; return;
} }
// The fix to disable giving points for saving the document temporarily // The fix to disable giving points for saving the document temporarily
if ($module_srl == $member_srl) if ($module_srl == $member_srl)
{ {
@ -227,10 +227,10 @@ class pointController extends point
{ {
return; return;
} }
// Subtract points for the document. // Subtract points for the document.
$diff = $this->_getModulePointConfig($module_srl, 'insert_document'); $diff = $this->_getModulePointConfig($module_srl, 'insert_document');
// Increase the point. // Increase the point.
if ($diff != 0) if ($diff != 0)
{ {
@ -258,14 +258,14 @@ class pointController extends point
{ {
return; return;
} }
// Abort if the comment and the document have the same author. // Abort if the comment and the document have the same author.
$oDocument = DocumentModel::getDocument($obj->document_srl); $oDocument = DocumentModel::getDocument($obj->document_srl);
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl) if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
{ {
return; return;
} }
// Abort if the document is older than a configured limit. // Abort if the document is older than a configured limit.
$config = $this->getConfig(); $config = $this->getConfig();
$time_limit = $config->insert_comment_limit ?: $config->no_point_date; $time_limit = $config->insert_comment_limit ?: $config->no_point_date;
@ -273,22 +273,22 @@ class pointController extends point
{ {
return; return;
} }
$diff = 0; $diff = 0;
// Add points for the comment. // Add points for the comment.
if ($mode === 'insert') if ($mode === 'insert')
{ {
$diff += $this->_getModulePointConfig($module_srl, 'insert_comment'); $diff += $this->_getModulePointConfig($module_srl, 'insert_comment');
} }
// Add points for attached files. // Add points for attached files.
if ($obj->updated_file_count > 0) if ($obj->updated_file_count > 0)
{ {
$upload_point = $this->_getModulePointConfig($module_srl, 'upload_file'); $upload_point = $this->_getModulePointConfig($module_srl, 'upload_file');
$diff += $upload_point * $obj->updated_file_count; $diff += $upload_point * $obj->updated_file_count;
} }
// Increase the point. // Increase the point.
if ($diff != 0) if ($diff != 0)
{ {
@ -304,7 +304,7 @@ class pointController extends point
{ {
$this->triggerInsertComment($obj, 'update'); $this->triggerInsertComment($obj, 'update');
} }
/** /**
* @brief A trigger which gives points for deleting a comment * @brief A trigger which gives points for deleting a comment
*/ */
@ -320,32 +320,32 @@ class pointController extends point
{ {
return; return;
} }
// Return if disabled // Return if disabled
$config = $this->getConfig(); $config = $this->getConfig();
if ($config->insert_comment_revert_on_delete === false) if ($config->insert_comment_revert_on_delete === false)
{ {
return; return;
} }
// Abort if the comment and the document have the same author. // Abort if the comment and the document have the same author.
$oDocument = DocumentModel::getDocument($obj->document_srl); $oDocument = DocumentModel::getDocument($obj->document_srl);
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl) if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
{ {
return; return;
} }
// Abort if the document is older than a configured limit. // Abort if the document is older than a configured limit.
$time_limit = $config->insert_comment_limit ?: $config->no_point_date; $time_limit = $config->insert_comment_limit ?: $config->no_point_date;
if ($time_limit > 0 && ztime($oDocument->get('regdate')) < RX_TIME - ($time_limit * 86400)) if ($time_limit > 0 && ztime($oDocument->get('regdate')) < RX_TIME - ($time_limit * 86400))
{ {
return; return;
} }
// Calculate points based on the module_srl of the document to which this comment belongs // Calculate points based on the module_srl of the document to which this comment belongs
$module_srl = $oDocument->get('module_srl'); $module_srl = $oDocument->get('module_srl');
$diff = $this->_getModulePointConfig($module_srl, 'insert_comment'); $diff = $this->_getModulePointConfig($module_srl, 'insert_comment');
// Decrease the point. // Decrease the point.
if ($diff != 0) if ($diff != 0)
{ {
@ -368,7 +368,7 @@ class pointController extends point
*/ */
public function triggerInsertFile($obj) public function triggerInsertFile($obj)
{ {
} }
/** /**
@ -383,19 +383,19 @@ class pointController extends point
{ {
return; return;
} }
// Return if disabled // Return if disabled
$config = $this->getConfig(); $config = $this->getConfig();
if ($config->upload_file_revert_on_delete === false) if ($config->upload_file_revert_on_delete === false)
{ {
return; return;
} }
// Get the points of the member // Get the points of the member
// Subtract points for the file. // Subtract points for the file.
$diff = $this->_getModulePointConfig($module_srl, 'upload_file'); $diff = $this->_getModulePointConfig($module_srl, 'upload_file');
// Update the point. // Update the point.
if ($diff != 0) if ($diff != 0)
{ {
@ -417,23 +417,23 @@ class pointController extends point
{ {
return; return;
} }
$point = $this->_getModulePointConfig($module_srl, 'download_file'); $point = $this->_getModulePointConfig($module_srl, 'download_file');
if (!$point) if (!$point)
{ {
return; return;
} }
// Get current points. // Get current points.
$cur_point = $logged_member_srl ? PointModel::getPoint($logged_member_srl) : 0; $cur_point = $logged_member_srl ? PointModel::getPoint($logged_member_srl) : 0;
// If the user (member or guest) does not have enough points, deny access. // If the user (member or guest) does not have enough points, deny access.
$config = $this->getConfig(); $config = $this->getConfig();
if ($config->disable_download == 'Y' && $cur_point + $point < 0) if ($config->disable_download == 'Y' && $cur_point + $point < 0)
{ {
return new BaseObject(-1, 'msg_cannot_download'); return new BaseObject(-1, 'msg_cannot_download');
} }
// Points will be adjusted after downloading (triggerDownloadFile). // Points will be adjusted after downloading (triggerDownloadFile).
} }
@ -450,7 +450,7 @@ class pointController extends point
{ {
return; return;
} }
// Adjust points of the downloader. // Adjust points of the downloader.
if ($logged_member_srl) if ($logged_member_srl)
{ {
@ -461,7 +461,7 @@ class pointController extends point
$this->setPoint($logged_member_srl, $cur_point + $point); $this->setPoint($logged_member_srl, $cur_point + $point);
} }
} }
// Adjust points of the uploader. // Adjust points of the uploader.
if ($author_member_srl) if ($author_member_srl)
{ {
@ -488,7 +488,7 @@ class pointController extends point
{ {
return; return;
} }
// Load configuration for reader and author points. // Load configuration for reader and author points.
$reader_point = $this->_getModulePointConfig($module_srl, 'read_document'); $reader_point = $this->_getModulePointConfig($module_srl, 'read_document');
$author_point = $this->_getModulePointConfig($module_srl, 'read_document_author'); $author_point = $this->_getModulePointConfig($module_srl, 'read_document_author');
@ -496,7 +496,7 @@ class pointController extends point
{ {
return; return;
} }
// If the reader has already read this document, do not adjust points again. // If the reader has already read this document, do not adjust points again.
if ($logged_member_srl) if ($logged_member_srl)
{ {
@ -509,7 +509,7 @@ class pointController extends point
return; return;
} }
} }
// Give no points if the document is older than a configured limit. // Give no points if the document is older than a configured limit.
$regdate = ztime($obj->get('regdate')); $regdate = ztime($obj->get('regdate'));
$config = $this->getConfig(); $config = $this->getConfig();
@ -521,7 +521,7 @@ class pointController extends point
{ {
$author_point = 0; $author_point = 0;
} }
// Give no points if the document is a notice and an exception has been configured. // Give no points if the document is a notice and an exception has been configured.
if ($obj->get('is_notice') === 'Y') if ($obj->get('is_notice') === 'Y')
{ {
@ -534,13 +534,13 @@ class pointController extends point
$author_point = 0; $author_point = 0;
} }
} }
// Adjust points of the reader. // Adjust points of the reader.
if ($reader_point) if ($reader_point)
{ {
// Get current points. // Get current points.
$cur_point = $logged_member_srl ? PointModel::getPoint($logged_member_srl) : 0; $cur_point = $logged_member_srl ? PointModel::getPoint($logged_member_srl) : 0;
// If the reader does not have enough points, deny access. // If the reader does not have enough points, deny access.
if ($cur_point + $reader_point < 0 && $config->disable_read_document == 'Y') if ($cur_point + $reader_point < 0 && $config->disable_read_document == 'Y')
{ {
@ -556,7 +556,7 @@ class pointController extends point
return new BaseObject(-1, $message); return new BaseObject(-1, $message);
} }
} }
// Record the fact that this member has already read this document. // Record the fact that this member has already read this document.
if ($logged_member_srl) if ($logged_member_srl)
{ {
@ -567,7 +567,7 @@ class pointController extends point
$this->setPoint($logged_member_srl, $cur_point + $reader_point); $this->setPoint($logged_member_srl, $cur_point + $reader_point);
} }
} }
// Adjust points of the person who wrote the document. // Adjust points of the person who wrote the document.
if ($author_point && $author_member_srl) if ($author_point && $author_member_srl)
{ {
@ -588,10 +588,10 @@ class pointController extends point
{ {
return; return;
} }
// Document or comment? // Document or comment?
$is_comment = isset($obj->comment_srl) && $obj->comment_srl; $is_comment = isset($obj->comment_srl) && $obj->comment_srl;
// Give no points if the document or comment is older than a configured limit. // Give no points if the document or comment is older than a configured limit.
$config = $this->getConfig(); $config = $this->getConfig();
if ($is_comment) if ($is_comment)
@ -608,7 +608,7 @@ class pointController extends point
} }
$logged_enabled = !($config->$logged_config_key > 0 && $regdate < RX_TIME - ($config->$logged_config_key * 86400)); $logged_enabled = !($config->$logged_config_key > 0 && $regdate < RX_TIME - ($config->$logged_config_key * 86400));
$target_enabled = !($config->$target_config_key > 0 && $regdate < RX_TIME - ($config->$target_config_key * 86400)); $target_enabled = !($config->$target_config_key > 0 && $regdate < RX_TIME - ($config->$target_config_key * 86400));
// Adjust points of the voter. // Adjust points of the voter.
if ($logged_member_srl && $logged_enabled) if ($logged_member_srl && $logged_enabled)
{ {
@ -624,7 +624,7 @@ class pointController extends point
$this->setPoint($logged_member_srl, $cur_point + $point); $this->setPoint($logged_member_srl, $cur_point + $point);
} }
} }
// Adjust points of the person who wrote the document or comment. // Adjust points of the person who wrote the document or comment.
if ($target_member_srl && $target_enabled) if ($target_member_srl && $target_enabled)
{ {
@ -752,7 +752,7 @@ class pointController extends point
{ {
$change_group = ($level != $current_level); $change_group = ($level != $current_level);
} }
if ($change_group) if ($change_group)
{ {
// Check if the level, for which the current points are prepared, is calculate and set the correct group // Check if the level, for which the current points are prepared, is calculate and set the correct group
@ -763,7 +763,7 @@ class pointController extends point
// Get the default group // Get the default group
$default_group = MemberModel::getDefaultGroup(); $default_group = MemberModel::getDefaultGroup();
asort($point_group); asort($point_group);
// Reset group after initialization // Reset group after initialization
if($config->group_reset != 'N') if($config->group_reset != 'N')
{ {
@ -862,10 +862,10 @@ class pointController extends point
return $output; return $output;
} }
/** /**
* Get point configuration for module, falling back to defaults if not set. * Get point configuration for module, falling back to defaults if not set.
* *
* @param int $module_srl * @param int $module_srl
* @param string $config_key * @param string $config_key
* @return int * @return int
@ -878,7 +878,7 @@ class pointController extends point
{ {
return 0; return 0;
} }
if ($module_srl) if ($module_srl)
{ {
if (!isset(self::$_module_config_cache[$module_srl])) if (!isset(self::$_module_config_cache[$module_srl]))
@ -895,7 +895,7 @@ class pointController extends point
{ {
$module_config = array(); $module_config = array();
} }
if (isset($module_config[$config_key]) && $module_config[$config_key] !== '') if (isset($module_config[$config_key]) && $module_config[$config_key] !== '')
{ {
$point = $module_config[$config_key]; $point = $module_config[$config_key];
@ -905,7 +905,7 @@ class pointController extends point
$default_config = $this->getConfig(); $default_config = $this->getConfig();
$point = $default_config->{$config_key}; $point = $default_config->{$config_key};
} }
return intval($point); return intval($point);
} }
} }

View file

@ -22,7 +22,7 @@ class pointModel extends point
$args = new stdClass; $args = new stdClass;
$args->member_srl = abs($member_srl); $args->member_srl = abs($member_srl);
$output = executeQuery('point.getPoint', $args, array('member_srl')); $output = executeQuery('point.getPoint', $args, array('member_srl'));
return isset($output->data->member_srl); return isset($output->data->member_srl);
} }
@ -51,7 +51,7 @@ class pointModel extends point
return parent::$_member_point_cache[$member_srl] = $point; return parent::$_member_point_cache[$member_srl] = $point;
} }
} }
// Get from file cache // Get from file cache
$cache_path = sprintf(RX_BASEDIR . 'files/member_extra_info/point/%s', getNumberingPath($member_srl)); $cache_path = sprintf(RX_BASEDIR . 'files/member_extra_info/point/%s', getNumberingPath($member_srl));
$cache_filename = sprintf('%s/%d.cache.txt', $cache_path, $member_srl); $cache_filename = sprintf('%s/%d.cache.txt', $cache_path, $member_srl);
@ -79,7 +79,7 @@ class pointModel extends point
$exists = false; $exists = false;
return 0; return 0;
} }
// Save to cache // Save to cache
parent::$_member_point_cache[$member_srl] = $point; parent::$_member_point_cache[$member_srl] = $point;
if (Rhymix\Framework\Cache::getDriverName() !== 'dummy') if (Rhymix\Framework\Cache::getDriverName() !== 'dummy')
@ -121,7 +121,7 @@ class pointModel extends point
{ {
return; return;
} }
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
if (!$logged_info->member_srl) if (!$logged_info->member_srl)
{ {

View file

@ -18,7 +18,7 @@ class spamfilterAdminController extends spamfilter
{ {
// Get current config // Get current config
$config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass; $config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass;
// Get the default information // Get the default information
$args = Context::gets('limits', 'limits_interval', 'limits_count', 'ipv4_block_range', 'ipv6_block_range', 'custom_message'); $args = Context::gets('limits', 'limits_interval', 'limits_count', 'ipv4_block_range', 'ipv6_block_range', 'custom_message');
@ -60,7 +60,7 @@ class spamfilterAdminController extends spamfilter
{ {
// Get current config // Get current config
$config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass; $config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass;
// Get updated values // Get updated values
$vars = Context::getRequestVars(); $vars = Context::getRequestVars();
if (!isset($vars->target_devices) || !is_array($vars->target_devices)) if (!isset($vars->target_devices) || !is_array($vars->target_devices))
@ -71,7 +71,7 @@ class spamfilterAdminController extends spamfilter
{ {
$vars->target_actions = []; $vars->target_actions = [];
} }
// Check values // Check values
if (!isset($config->captcha)) if (!isset($config->captcha))
{ {
@ -84,7 +84,7 @@ class spamfilterAdminController extends spamfilter
{ {
return new BaseObject(-1, 'msg_recaptcha_keys_not_set'); return new BaseObject(-1, 'msg_recaptcha_keys_not_set');
} }
$config->captcha->theme = escape(utf8_trim($vars->captcha_theme)); $config->captcha->theme = escape(utf8_trim($vars->captcha_theme));
$config->captcha->size = escape(utf8_trim($vars->captcha_size)); $config->captcha->size = escape(utf8_trim($vars->captcha_size));
$config->captcha->target_devices = [ $config->captcha->target_devices = [
@ -100,7 +100,7 @@ class spamfilterAdminController extends spamfilter
]; ];
$config->captcha->target_users = escape(utf8_trim($vars->target_users)) ?: 'non_members'; $config->captcha->target_users = escape(utf8_trim($vars->target_users)) ?: 'non_members';
$config->captcha->target_frequency = escape(utf8_trim($vars->target_frequency)) ?: 'first_time_only'; $config->captcha->target_frequency = escape(utf8_trim($vars->target_frequency)) ?: 'first_time_only';
// Insert new config // Insert new config
$output = getController('module')->insertModuleConfig('spamfilter', $config); $output = getController('module')->insertModuleConfig('spamfilter', $config);
if(!$output->toBool()) if(!$output->toBool())
@ -112,7 +112,7 @@ class spamfilterAdminController extends spamfilter
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminConfigCaptcha'); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminConfigCaptcha');
$this->setRedirectUrl($returnUrl); $this->setRedirectUrl($returnUrl);
} }
public function procSpamfilterAdminInsertDeniedIP() public function procSpamfilterAdminInsertDeniedIP()
{ {
//스팸IP 추가 //스팸IP 추가
@ -130,7 +130,7 @@ class spamfilterAdminController extends spamfilter
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedIPList'); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedIPList');
$this->setRedirectUrl($returnUrl); $this->setRedirectUrl($returnUrl);
} }
public function procSpamfilterAdminUpdateDeniedIP() public function procSpamfilterAdminUpdateDeniedIP()
{ {
$ipaddress = Context::get('ipaddress'); $ipaddress = Context::get('ipaddress');
@ -138,10 +138,10 @@ class spamfilterAdminController extends spamfilter
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
$args = new \stdClass; $args = new \stdClass;
$args->ipaddress = $ipaddress; $args->ipaddress = $ipaddress;
$except_member = Context::get('except_member'); $except_member = Context::get('except_member');
if (!empty($except_member)) if (!empty($except_member))
{ {
@ -151,13 +151,13 @@ class spamfilterAdminController extends spamfilter
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
$output = executeQuery('spamfilter.updateDeniedIPAttributes', $args); $output = executeQuery('spamfilter.updateDeniedIPAttributes', $args);
if (!$output->toBool()) if (!$output->toBool())
{ {
return $output; return $output;
} }
Rhymix\Framework\Cache::delete('spamfilter:denied_ip_list'); Rhymix\Framework\Cache::delete('spamfilter:denied_ip_list');
} }
@ -196,36 +196,36 @@ class spamfilterAdminController extends spamfilter
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
$args = new \stdClass; $args = new \stdClass;
$args->word = $word; $args->word = $word;
$except_member = Context::get('except_member'); $except_member = Context::get('except_member');
if (!empty($except_member)) if (!empty($except_member))
{ {
$args->except_member = $except_member === 'Y' ? 'Y' : 'N'; $args->except_member = $except_member === 'Y' ? 'Y' : 'N';
} }
$filter_html = Context::get('filter_html'); $filter_html = Context::get('filter_html');
if (!empty($filter_html)) if (!empty($filter_html))
{ {
$args->filter_html = $filter_html === 'Y' ? 'Y' : 'N'; $args->filter_html = $filter_html === 'Y' ? 'Y' : 'N';
} }
if (!isset($args->except_member) && !isset($args->filter_html)) if (!isset($args->except_member) && !isset($args->filter_html))
{ {
throw new Rhymix\Framework\Exceptions\InvalidRequest; throw new Rhymix\Framework\Exceptions\InvalidRequest;
} }
$output = executeQuery('spamfilter.updateDeniedWordAttributes', $args); $output = executeQuery('spamfilter.updateDeniedWordAttributes', $args);
if (!$output->toBool()) if (!$output->toBool())
{ {
return $output; return $output;
} }
Rhymix\Framework\Cache::delete('spamfilter:denied_word_list'); Rhymix\Framework\Cache::delete('spamfilter:denied_word_list');
} }
public function procSpamfilterAdminDeleteDeniedWord() public function procSpamfilterAdminDeleteDeniedWord()
{ {
$wordList = Context::get('word'); $wordList = Context::get('word');
@ -248,7 +248,7 @@ class spamfilterAdminController extends spamfilter
$args = new stdClass; $args = new stdClass;
$args->ipaddress = $ipaddress; $args->ipaddress = $ipaddress;
$output = executeQuery('spamfilter.deleteDeniedIP', $args); $output = executeQuery('spamfilter.deleteDeniedIP', $args);
Rhymix\Framework\Cache::delete('spamfilter:denied_ip_list'); Rhymix\Framework\Cache::delete('spamfilter:denied_ip_list');
return $output; return $output;
} }
@ -281,12 +281,12 @@ class spamfilterAdminController extends spamfilter
{ {
$description = null; $description = null;
} }
if (mb_strlen($word, 'UTF-8') < 2 || mb_strlen($word, 'UTF-8') > 180) if (mb_strlen($word, 'UTF-8') < 2 || mb_strlen($word, 'UTF-8') > 180)
{ {
throw new Rhymix\Framework\Exception('msg_invalid_word'); throw new Rhymix\Framework\Exception('msg_invalid_word');
} }
$args = new stdClass; $args = new stdClass;
$args->word = $word; $args->word = $word;
$args->description = $description; $args->description = $description;
@ -297,12 +297,12 @@ class spamfilterAdminController extends spamfilter
$fail_list .= $args->word . '<br />'; $fail_list .= $args->word . '<br />';
} }
} }
if ($output) if ($output)
{ {
$output->add('fail_list', $fail_list); $output->add('fail_list', $fail_list);
} }
Rhymix\Framework\Cache::delete('spamfilter:denied_word_list'); Rhymix\Framework\Cache::delete('spamfilter:denied_word_list');
return $output; return $output;
} }
@ -317,7 +317,7 @@ class spamfilterAdminController extends spamfilter
$args = new stdClass; $args = new stdClass;
$args->word = $word; $args->word = $word;
$output = executeQuery('spamfilter.deleteDeniedWord', $args); $output = executeQuery('spamfilter.deleteDeniedWord', $args);
Rhymix\Framework\Cache::delete('spamfilter:denied_word_list'); Rhymix\Framework\Cache::delete('spamfilter:denied_word_list');
return $output; return $output;
} }

View file

@ -5,7 +5,7 @@
* @author NAVER (developers@xpressengine.com) * @author NAVER (developers@xpressengine.com)
* @brief The admin view class of the spamfilter module * @brief The admin view class of the spamfilter module
*/ */
class spamfilterAdminView extends spamfilter class spamfilterAdminView extends spamfilter
{ {
/** /**
* @brief Initialization * @brief Initialization
@ -27,7 +27,7 @@ class spamfilterAdminView extends spamfilter
{ {
$sort_index = 'regdate'; $sort_index = 'regdate';
} }
// Get the list of denied IP addresses and words // Get the list of denied IP addresses and words
$oSpamFilterModel = getModel('spamfilter'); $oSpamFilterModel = getModel('spamfilter');
$ip_list = $oSpamFilterModel->getDeniedIPList($sort_index); $ip_list = $oSpamFilterModel->getDeniedIPList($sort_index);
@ -52,7 +52,7 @@ class spamfilterAdminView extends spamfilter
{ {
$sort_index = 'hit'; $sort_index = 'hit';
} }
// Get the list of denied IP addresses and words // Get the list of denied IP addresses and words
$oSpamFilterModel = getModel('spamfilter'); $oSpamFilterModel = getModel('spamfilter');
$word_list = $oSpamFilterModel->getDeniedWordList($sort_index); $word_list = $oSpamFilterModel->getDeniedWordList($sort_index);

View file

@ -16,14 +16,14 @@ class spamfilter extends ModuleObject
array('communication.sendMessage', 'before', 'controller', 'triggerSendMessage'), array('communication.sendMessage', 'before', 'controller', 'triggerSendMessage'),
array('moduleObject.proc', 'before', 'controller', 'triggerCheckCaptcha'), array('moduleObject.proc', 'before', 'controller', 'triggerCheckCaptcha'),
); );
protected static $_delete_triggers = array( protected static $_delete_triggers = array(
array('trackback.insertTrackback', 'before', 'controller', 'triggerInsertTrackback'), array('trackback.insertTrackback', 'before', 'controller', 'triggerInsertTrackback'),
); );
/** /**
* Register all triggers. * Register all triggers.
* *
* @return object * @return object
*/ */
public function registerTriggers() public function registerTriggers()
@ -45,7 +45,7 @@ class spamfilter extends ModuleObject
} }
return new BaseObject(0, 'success_updated'); return new BaseObject(0, 'success_updated');
} }
/** /**
* @brief Additional tasks required to accomplish during the installation * @brief Additional tasks required to accomplish during the installation
*/ */
@ -73,7 +73,7 @@ class spamfilter extends ModuleObject
return true; return true;
} }
} }
$oDB = DB::getInstance(); $oDB = DB::getInstance();
if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) return true; if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) return true;
if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) return true; if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) return true;
@ -85,13 +85,13 @@ class spamfilter extends ModuleObject
if(!$oDB->isColumnExists('spamfilter_denied_ip', 'latest_hit')) return true; if(!$oDB->isColumnExists('spamfilter_denied_ip', 'latest_hit')) return true;
if(!$oDB->isColumnExists('spamfilter_denied_ip', 'except_member')) return true; if(!$oDB->isColumnExists('spamfilter_denied_ip', 'except_member')) return true;
if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) return true; if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) return true;
$config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass; $config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass;
if (!isset($config->captcha)) if (!isset($config->captcha))
{ {
return true; return true;
} }
return false; return false;
} }
@ -105,7 +105,7 @@ class spamfilter extends ModuleObject
{ {
return $output; return $output;
} }
$oDB = DB::getInstance(); $oDB = DB::getInstance();
if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit'))
{ {
@ -152,7 +152,7 @@ class spamfilter extends ModuleObject
{ {
$oDB->addColumn('spamfilter_denied_ip', 'description', 'varchar', 191, null, false, 'except_member'); $oDB->addColumn('spamfilter_denied_ip', 'description', 'varchar', 191, null, false, 'except_member');
} }
$config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass; $config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass;
if (!isset($config->captcha)) if (!isset($config->captcha))
{ {
@ -167,7 +167,7 @@ class spamfilter extends ModuleObject
$config->captcha = new stdClass; $config->captcha = new stdClass;
$config->captcha->type = 'none'; $config->captcha->type = 'none';
} }
$output = getController('module')->insertModuleConfig($this->module, $config); $output = getController('module')->insertModuleConfig($this->module, $config);
if (!$output->toBool()) if (!$output->toBool())
{ {
@ -181,9 +181,9 @@ class spamfilter extends ModuleObject
*/ */
public function recompileCache() public function recompileCache()
{ {
} }
/** /**
* Import configuration from reCAPTCHA addon. * Import configuration from reCAPTCHA addon.
*/ */
@ -195,7 +195,7 @@ class spamfilter extends ModuleObject
{ {
return $output; return $output;
} }
if ($config->use_pc === 'Y' || $config->use_mobile === 'Y') if ($config->use_pc === 'Y' || $config->use_mobile === 'Y')
{ {
$output->type = 'recaptcha'; $output->type = 'recaptcha';
@ -222,7 +222,7 @@ class spamfilter extends ModuleObject
$output->target_modules[$module_srl] = true; $output->target_modules[$module_srl] = true;
} }
$output->target_modules_type = ($config->xe_run_method === 'run_selected') ? '+' : '-'; $output->target_modules_type = ($config->xe_run_method === 'run_selected') ? '+' : '-';
$oAddonAdminController = getAdminController('addon'); $oAddonAdminController = getAdminController('addon');
if ($output->target_devices['pc']) if ($output->target_devices['pc'])
{ {
@ -234,7 +234,7 @@ class spamfilter extends ModuleObject
$oAddonAdminController->doDeactivate('recaptcha', 0, 'mobile'); $oAddonAdminController->doDeactivate('recaptcha', 0, 'mobile');
$oAddonAdminController->makeCacheFile(0, 'mobile'); $oAddonAdminController->makeCacheFile(0, 'mobile');
} }
return $output; return $output;
} }
} }

View file

@ -114,7 +114,7 @@ class spamfilterController extends spamfilter
} }
else else
{ {
$text = $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage; $text = $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage;
} }
$output = $oFilterModel->isDeniedWord($text); $output = $oFilterModel->isDeniedWord($text);
if(!$output->toBool()) return $output; if(!$output->toBool()) return $output;
@ -141,14 +141,14 @@ class spamfilterController extends spamfilter
} }
$fail_list = ''; $fail_list = '';
$output = null; $output = null;
foreach ($ipaddress_list as $ipaddress) foreach ($ipaddress_list as $ipaddress)
{ {
if ($ipaddress === '') if ($ipaddress === '')
{ {
continue; continue;
} }
$args = new stdClass; $args = new stdClass;
if (preg_match('@^(.+?)(?://|#)(.*)$@', $ipaddress, $matches)) if (preg_match('@^(.+?)(?://|#)(.*)$@', $ipaddress, $matches))
{ {
@ -160,24 +160,24 @@ class spamfilterController extends spamfilter
$args->ipaddress = $ipaddress; $args->ipaddress = $ipaddress;
$args->description = $description; $args->description = $description;
} }
if (!Rhymix\Framework\Filters\IpFilter::validateRange($args->ipaddress)) if (!Rhymix\Framework\Filters\IpFilter::validateRange($args->ipaddress))
{ {
return new BaseObject(-1, 'msg_invalid_ip'); return new BaseObject(-1, 'msg_invalid_ip');
} }
$output = executeQuery('spamfilter.insertDeniedIP', $args); $output = executeQuery('spamfilter.insertDeniedIP', $args);
if (!$output->toBool()) if (!$output->toBool())
{ {
$fail_list .= $args->ipaddress . '<br />'; $fail_list .= $args->ipaddress . '<br />';
} }
} }
if ($output) if ($output)
{ {
$output->add('fail_list', $fail_list); $output->add('fail_list', $fail_list);
} }
Rhymix\Framework\Cache::delete('spamfilter:denied_ip_list'); Rhymix\Framework\Cache::delete('spamfilter:denied_ip_list');
return $output; return $output;
} }
@ -210,7 +210,7 @@ class spamfilterController extends spamfilter
// Save a log // Save a log
$this->insertLog(); $this->insertLog();
} }
/** /**
* @brief while document manager is running, stop filter * @brief while document manager is running, stop filter
*/ */
@ -245,7 +245,7 @@ class spamfilterController extends spamfilter
{ {
return; return;
} }
$target_actions = []; $target_actions = [];
foreach (['signup', 'login', 'recovery', 'document', 'comment'] as $action) foreach (['signup', 'login', 'recovery', 'document', 'comment'] as $action)
{ {
@ -257,12 +257,12 @@ class spamfilterController extends spamfilter
} }
} }
} }
if (count($target_actions)) if (count($target_actions))
{ {
include_once __DIR__ . '/spamfilter.lib.php'; include_once __DIR__ . '/spamfilter.lib.php';
spamfilter_reCAPTCHA::init($config->captcha); spamfilter_reCAPTCHA::init($config->captcha);
if (strncasecmp('proc', $obj->act, 4) === 0) if (strncasecmp('proc', $obj->act, 4) === 0)
{ {
spamfilter_reCAPTCHA::check(); spamfilter_reCAPTCHA::check();

View file

@ -8,12 +8,12 @@ class spamfilter_reCAPTCHA
protected static $instances_inserted = 0; protected static $instances_inserted = 0;
protected static $sequence = 1; protected static $sequence = 1;
protected $_target_actions = []; protected $_target_actions = [];
public static function init($config) public static function init($config)
{ {
self::$config = $config; self::$config = $config;
} }
public static function check() public static function check()
{ {
$response = Context::get('g-recaptcha-response'); $response = Context::get('g-recaptcha-response');
@ -21,7 +21,7 @@ class spamfilter_reCAPTCHA
{ {
throw new Rhymix\Framework\Exception('msg_recaptcha_invalid_response'); throw new Rhymix\Framework\Exception('msg_recaptcha_invalid_response');
} }
try try
{ {
$verify_request = \Requests::post(self::$verify_url, array(), array( $verify_request = \Requests::post(self::$verify_url, array(), array(
@ -34,7 +34,7 @@ class spamfilter_reCAPTCHA
{ {
throw new Rhymix\Framework\Exception('msg_recaptcha_connection_error'); throw new Rhymix\Framework\Exception('msg_recaptcha_connection_error');
} }
$verify = @json_decode($verify_request->body, true); $verify = @json_decode($verify_request->body, true);
if (!$verify || !$verify['success']) if (!$verify || !$verify['success'])
{ {
@ -44,10 +44,10 @@ class spamfilter_reCAPTCHA
{ {
throw new Rhymix\Framework\Exception('msg_recaptcha_invalid_response'); throw new Rhymix\Framework\Exception('msg_recaptcha_invalid_response');
} }
$_SESSION['recaptcha_authenticated'] = true; $_SESSION['recaptcha_authenticated'] = true;
} }
public function addScripts() public function addScripts()
{ {
if (!self::$scripts_added) if (!self::$scripts_added)
@ -60,17 +60,17 @@ class spamfilter_reCAPTCHA
Context::addHtmlFooter($html); Context::addHtmlFooter($html);
} }
} }
public function setTargetActions(array $target_actions) public function setTargetActions(array $target_actions)
{ {
$this->_target_actions = $target_actions; $this->_target_actions = $target_actions;
} }
public function isTargetAction(string $action): bool public function isTargetAction(string $action): bool
{ {
return isset($this->_target_actions[$action]); return isset($this->_target_actions[$action]);
} }
public function __toString() public function __toString()
{ {
return sprintf('<div id="recaptcha-instance-%d" class="g-recaptcha"></div>', self::$instances_inserted++); return sprintf('<div id="recaptcha-instance-%d" class="g-recaptcha"></div>', self::$instances_inserted++);

View file

@ -64,11 +64,11 @@ class spamfilterModel extends spamfilter
$args = new stdClass(); $args = new stdClass();
$args->ipaddress = $ip_range->ipaddress; $args->ipaddress = $ip_range->ipaddress;
executeQuery('spamfilter.updateDeniedIPHit', $args); executeQuery('spamfilter.updateDeniedIPHit', $args);
return new BaseObject(-1, 'msg_alert_registered_denied_ip'); return new BaseObject(-1, 'msg_alert_registered_denied_ip');
} }
} }
return new BaseObject(); return new BaseObject();
} }
@ -102,7 +102,7 @@ class spamfilterModel extends spamfilter
$is_logged = Context::get('is_logged'); $is_logged = Context::get('is_logged');
$fulltext = strtolower(utf8_trim(utf8_normalize_spaces($text))); $fulltext = strtolower(utf8_trim(utf8_normalize_spaces($text)));
$plaintext = htmlspecialchars_decode(strip_tags($fulltext, '<a><img>')); $plaintext = htmlspecialchars_decode(strip_tags($fulltext, '<a><img>'));
foreach ($word_list as $word_item) foreach ($word_list as $word_item)
{ {
if (!empty($word_item->except_member) && $word_item->except_member === 'Y' && $is_logged) if (!empty($word_item->except_member) && $word_item->except_member === 'Y' && $is_logged)
@ -150,7 +150,7 @@ class spamfilterModel extends spamfilter
{ {
$custom_message = sprintf($custom_message, escape($hit, false)); $custom_message = sprintf($custom_message, escape($hit, false));
} }
return new BaseObject(-1, $custom_message); return new BaseObject(-1, $custom_message);
} }
} }
@ -182,7 +182,7 @@ class spamfilterModel extends spamfilter
{ {
$suffix = $config->ipv6_block_range ?: ''; $suffix = $config->ipv6_block_range ?: '';
} }
$oSpamFilterController = getController('spamfilter'); $oSpamFilterController = getController('spamfilter');
$oSpamFilterController->insertIP(\RX_CLIENT_IP . $suffix, 'AUTO-DENIED : Over limit'); $oSpamFilterController->insertIP(\RX_CLIENT_IP . $suffix, 'AUTO-DENIED : Over limit');
return new BaseObject(-1, 'msg_alert_registered_denied_ip'); return new BaseObject(-1, 'msg_alert_registered_denied_ip');

View file

@ -14,7 +14,7 @@ class tagAdminController extends tag
{ {
$config = new stdClass; $config = new stdClass;
$vars = Context::getRequestVars(); $vars = Context::getRequestVars();
$config->separators = []; $config->separators = [];
foreach ($vars->separators ?? [] as $val) foreach ($vars->separators ?? [] as $val)
{ {
@ -23,18 +23,18 @@ class tagAdminController extends tag
$config->separators[] = $val; $config->separators[] = $val;
} }
} }
$oModuleController = ModuleController::getInstance(); $oModuleController = ModuleController::getInstance();
$output = $oModuleController->insertModuleConfig($this->module, $config); $output = $oModuleController->insertModuleConfig($this->module, $config);
if (!$output->toBool()) if (!$output->toBool())
{ {
return $output; return $output;
} }
$this->setMessage('success_registed'); $this->setMessage('success_registed');
$this->setRedirectUrl(Context::get('success_return_url')); $this->setRedirectUrl(Context::get('success_return_url'));
} }
/** /**
* @brief Delete all tags for a particular module * @brief Delete all tags for a particular module
*/ */

View file

@ -6,7 +6,7 @@ class tagAdminView extends tag
{ {
$config = ModuleModel::getModuleConfig($this->module) ?: new stdClass; $config = ModuleModel::getModuleConfig($this->module) ?: new stdClass;
Context::set('tag_config', $config); Context::set('tag_config', $config);
$this->setTemplatePath($this->module_path . 'tpl'); $this->setTemplatePath($this->module_path . 'tpl');
$this->setTemplateFile('config'); $this->setTemplateFile('config');
} }

View file

@ -57,27 +57,27 @@ class tag extends ModuleObject
$oModuleController = getController('module'); $oModuleController = getController('module');
$oDB = &DB::getInstance(); $oDB = &DB::getInstance();
// 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument trigger property for // 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument trigger property for
if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'))
$oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after'))
$oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'))
$oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after'))
$oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after'))
$oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after'); $oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after');
// 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag // 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag
if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'))
$oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'); $oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after');
// tag in the index column of the table tag // tag in the index column of the table tag
if(!$oDB->isIndexExists("tags","idx_tag")) if(!$oDB->isIndexExists("tags","idx_tag"))
$oDB->addIndex("tags","idx_tag", array("document_srl","tag")); $oDB->addIndex("tags","idx_tag", array("document_srl","tag"));
if(!$oModuleModel->getTrigger('document.moveDocumentModule', 'tag', 'controller', 'triggerMoveDocument', 'after')) if(!$oModuleModel->getTrigger('document.moveDocumentModule', 'tag', 'controller', 'triggerMoveDocument', 'after'))
{ {
$oModuleController->insertTrigger('document.moveDocumentModule', 'tag', 'controller', 'triggerMoveDocument', 'after'); $oModuleController->insertTrigger('document.moveDocumentModule', 'tag', 'controller', 'triggerMoveDocument', 'after');

View file

@ -16,7 +16,7 @@ class tagController extends tag
{ {
return; return;
} }
$tag_list = tagModel::splitString($obj->tags ?? ''); $tag_list = tagModel::splitString($obj->tags ?? '');
if (count($tag_list)) if (count($tag_list))
{ {
@ -30,7 +30,7 @@ class tagController extends tag
/** /**
* Replace all tags belonging to a document with a new list of tags. * Replace all tags belonging to a document with a new list of tags.
* *
* @param object $obj * @param object $obj
* @return BaseObject * @return BaseObject
*/ */
@ -67,7 +67,7 @@ class tagController extends tag
/** /**
* Delete all tags belonging to a document. * Delete all tags belonging to a document.
* *
* @param object $obj * @param object $obj
* @return BaseObject * @return BaseObject
*/ */
@ -96,7 +96,7 @@ class tagController extends tag
$oTagController = getAdminController('tag'); $oTagController = getAdminController('tag');
return $oTagController->deleteModuleTags($obj->module_srl); return $oTagController->deleteModuleTags($obj->module_srl);
} }
function triggerMoveDocument($obj) function triggerMoveDocument($obj)
{ {
executeQuery('tag.updateTagModule', $obj); executeQuery('tag.updateTagModule', $obj);

View file

@ -12,7 +12,7 @@ class tagModel extends tag
*/ */
protected static $_separator_list = null; protected static $_separator_list = null;
protected static $_separator_regexp = null; protected static $_separator_regexp = null;
/** /**
* Generate and cache separator list and regexp. * Generate and cache separator list and regexp.
*/ */
@ -27,7 +27,7 @@ class tagModel extends tag
{ {
self::$_separator_list = ['comma', 'hash']; self::$_separator_list = ['comma', 'hash'];
} }
$regexp = '/['; $regexp = '/[';
$regexp_map = [ $regexp_map = [
'comma' => ',', 'comma' => ',',
@ -39,13 +39,13 @@ class tagModel extends tag
$regexp .= $regexp_map[$separator]; $regexp .= $regexp_map[$separator];
} }
$regexp .= ']+/'; $regexp .= ']+/';
self::$_separator_regexp = $regexp; self::$_separator_regexp = $regexp;
} }
/** /**
* Split a string of tags into an array. * Split a string of tags into an array.
* *
* @param string $str * @param string $str
* @return array * @return array
*/ */
@ -55,14 +55,14 @@ class tagModel extends tag
{ {
self::_generateSeparatorConfig(); self::_generateSeparatorConfig();
} }
// Clean up the input string. // Clean up the input string.
$str = trim(utf8_normalize_spaces(utf8_clean($str))); $str = trim(utf8_normalize_spaces(utf8_clean($str)));
if ($str === '') if ($str === '')
{ {
return []; return [];
} }
// Split the input string and collect non-empty fragments. // Split the input string and collect non-empty fragments.
$fragments = preg_split(self::$_separator_regexp, $str, -1, PREG_SPLIT_NO_EMPTY); $fragments = preg_split(self::$_separator_regexp, $str, -1, PREG_SPLIT_NO_EMPTY);
$tags = []; $tags = [];
@ -74,11 +74,11 @@ class tagModel extends tag
$tags[strtolower($fragment)] = $fragment; $tags[strtolower($fragment)] = $fragment;
} }
} }
// Return a list of valid fragments with no duplicates. // Return a list of valid fragments with no duplicates.
return array_values(array_unique($tags)); return array_values(array_unique($tags));
} }
/** /**
* @brief Imported Tag List * @brief Imported Tag List
* Many of the specified module in order to extract the number of tags * Many of the specified module in order to extract the number of tags

View file

@ -127,7 +127,7 @@ class trashAdminController extends trash
if(!$output2->toBool()) return $output; if(!$output2->toBool()) return $output;
} }
} }
return new BaseObject(0, 'success_deleted'); return new BaseObject(0, 'success_deleted');
} }

View file

@ -19,7 +19,7 @@ class trashAdminView extends trash
// 문서 및 댓글 모듈 lang 파일 로딩 // 문서 및 댓글 모듈 lang 파일 로딩
Context::loadLang('./modules/document/lang'); Context::loadLang('./modules/document/lang');
Context::loadLang('./modules/comment/lang'); Context::loadLang('./modules/comment/lang');
// 템플릿 경로 지정 (board의 경우 tpl에 관리자용 템플릿 모아놓음) // 템플릿 경로 지정 (board의 경우 tpl에 관리자용 템플릿 모아놓음)
$template_path = sprintf("%stpl/",$this->module_path); $template_path = sprintf("%stpl/",$this->module_path);
$this->setTemplatePath($template_path); $this->setTemplatePath($template_path);
@ -39,7 +39,7 @@ class trashAdminView extends trash
$search_target = Context::get('search_target'); // /< search (title, contents ...) $search_target = Context::get('search_target'); // /< search (title, contents ...)
$search_keyword = Context::get('search_keyword'); // /< keyword to search $search_keyword = Context::get('search_keyword'); // /< keyword to search
switch($search_target) switch($search_target)
{ {
case 'title': case 'title':
@ -93,10 +93,10 @@ class trashAdminView extends trash
// 템플릿 파일 지정 // 템플릿 파일 지정
$this->setTemplateFile('trash_list'); $this->setTemplateFile('trash_list');
} }
// Trash View - sejin7940 // Trash View - sejin7940
function dispTrashAdminView() function dispTrashAdminView()
{ {
$trash_srl = Context::get('trash_srl'); $trash_srl = Context::get('trash_srl');
@ -122,7 +122,7 @@ class trashAdminView extends trash
$args_extra = new stdClass; $args_extra = new stdClass;
$args_extra->module_srl = $originObject->module_srl; $args_extra->module_srl = $originObject->module_srl;
$args_extra->document_srl = $originObject->document_srl; $args_extra->document_srl = $originObject->document_srl;
$output_extra = executeQueryArray('trash.getDocumentExtraVars', $args_extra); $output_extra = executeQueryArray('trash.getDocumentExtraVars', $args_extra);
Context::set('oOriginExtraVars',$output_extra->data); Context::set('oOriginExtraVars',$output_extra->data);
} }
$this->setTemplateFile('trash_view'); $this->setTemplateFile('trash_view');

View file

@ -18,7 +18,7 @@ class trash extends ModuleObject
*/ */
function moduleInstall() function moduleInstall()
{ {
} }
/** /**
@ -36,7 +36,7 @@ class trash extends ModuleObject
*/ */
function moduleUpdate() function moduleUpdate()
{ {
} }
} }
/* End of file trash.class.php */ /* End of file trash.class.php */

View file

@ -68,7 +68,7 @@ class widgetController extends widget
if(!in_array($widget,array('widgetBox','widgetContent')) && !Context::get('skin')) throw new Rhymix\Framework\Exception('msg_widget_skin_is_null'); if(!in_array($widget,array('widgetBox','widgetContent')) && !Context::get('skin')) throw new Rhymix\Framework\Exception('msg_widget_skin_is_null');
$this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars); $this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars);
// Wanted results // Wanted results
$widget_code = $this->execute($widget, $vars, true, false); $widget_code = $this->execute($widget, $vars, true, false);
$widget_code = Context::replaceUserLang($widget_code); $widget_code = Context::replaceUserLang($widget_code);
@ -103,7 +103,7 @@ class widgetController extends widget
$oLayoutModel = getModel('layout'); $oLayoutModel = getModel('layout');
$layout_info = $oLayoutModel->getLayout($module_srl); $layout_info = $oLayoutModel->getLayout($module_srl);
if(!$layout_info || $layout_info->type != 'faceoff') $err++; if(!$layout_info || $layout_info->type != 'faceoff') $err++;
// Destination Information Wanted page module // Destination Information Wanted page module
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');
$columnList = array('module_srl', 'module'); $columnList = array('module_srl', 'module');
@ -111,7 +111,7 @@ class widgetController extends widget
if(!$page_info->module_srl || $page_info->module != 'page') $err++; if(!$page_info->module_srl || $page_info->module != 'page') $err++;
if($err > 1) throw new Rhymix\Framework\Exceptions\InvalidRequest; if($err > 1) throw new Rhymix\Framework\Exceptions\InvalidRequest;
// Check permissions // Check permissions
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
if (!$logged_info->member_srl) if (!$logged_info->member_srl)
@ -123,7 +123,7 @@ class widgetController extends widget
{ {
throw new Rhymix\Framework\Exceptions\NotPermitted; throw new Rhymix\Framework\Exceptions\NotPermitted;
} }
// Enter post // Enter post
$oDocumentModel = getModel('document'); $oDocumentModel = getModel('document');
$oDocumentController = getController('document'); $oDocumentController = getController('document');
@ -144,10 +144,10 @@ class widgetController extends widget
$output = $oDocumentController->insertDocument($obj); $output = $oDocumentController->insertDocument($obj);
$obj->document_srl = $output->get('document_srl'); $obj->document_srl = $output->get('document_srl');
} }
// Stop when an error occurs // Stop when an error occurs
if(!$output->toBool()) return $output; if(!$output->toBool()) return $output;
// Return results // Return results
$this->add('document_srl', $obj->document_srl); $this->add('document_srl', $obj->document_srl);
} }
@ -167,13 +167,13 @@ class widgetController extends widget
$oDocument = $oDocumentModel->getDocument($document_srl); $oDocument = $oDocumentModel->getDocument($document_srl);
if(!$oDocument->isExists()) throw new Rhymix\Framework\Exceptions\InvalidRequest; if(!$oDocument->isExists()) throw new Rhymix\Framework\Exceptions\InvalidRequest;
$module_srl = $oDocument->get('module_srl'); $module_srl = $oDocument->get('module_srl');
// Destination Information Wanted page module // Destination Information Wanted page module
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');
$columnList = array('module_srl', 'module'); $columnList = array('module_srl', 'module');
$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); $page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
if(!$page_info->module_srl || $page_info->module != 'page') throw new Rhymix\Framework\Exceptions\InvalidRequest; if(!$page_info->module_srl || $page_info->module != 'page') throw new Rhymix\Framework\Exceptions\InvalidRequest;
// Check permissions // Check permissions
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
if (!$logged_info->member_srl) if (!$logged_info->member_srl)
@ -185,10 +185,10 @@ class widgetController extends widget
{ {
throw new Rhymix\Framework\Exceptions\NotPermitted; throw new Rhymix\Framework\Exceptions\NotPermitted;
} }
$output = $oDocumentAdminController->copyDocumentModule(array($oDocument->get('document_srl')), $oDocument->get('module_srl'),0); $output = $oDocumentAdminController->copyDocumentModule(array($oDocument->get('document_srl')), $oDocument->get('module_srl'),0);
if(!$output->toBool()) return $output; if(!$output->toBool()) return $output;
// Return results // Return results
$copied_srls = $output->get('copied_srls'); $copied_srls = $output->get('copied_srls');
$this->add('document_srl', $copied_srls[$oDocument->get('document_srl')]); $this->add('document_srl', $copied_srls[$oDocument->get('document_srl')]);
@ -208,12 +208,12 @@ class widgetController extends widget
$oDocument = $oDocumentModel->getDocument($document_srl); $oDocument = $oDocumentModel->getDocument($document_srl);
if(!$oDocument->isExists()) return; if(!$oDocument->isExists()) return;
$module_srl = $oDocument->get('module_srl'); $module_srl = $oDocument->get('module_srl');
// Destination Information Wanted page module // Destination Information Wanted page module
$oModuleModel = getModel('module'); $oModuleModel = getModel('module');
$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); $page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
if(!$page_info->module_srl || $page_info->module != 'page') throw new Rhymix\Framework\Exceptions\InvalidRequest; if(!$page_info->module_srl || $page_info->module != 'page') throw new Rhymix\Framework\Exceptions\InvalidRequest;
// Check permissions // Check permissions
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
if (!$logged_info->member_srl) if (!$logged_info->member_srl)
@ -225,7 +225,7 @@ class widgetController extends widget
{ {
throw new Rhymix\Framework\Exceptions\NotPermitted; throw new Rhymix\Framework\Exceptions\NotPermitted;
} }
$output = $oDocumentController->deleteDocument($oDocument->get('document_srl')); $output = $oDocumentController->deleteDocument($oDocument->get('document_srl'));
if(!$output->toBool()) return $output; if(!$output->toBool()) return $output;
} }
@ -278,20 +278,20 @@ class widgetController extends widget
{ {
return '<div>Invalid XML in widget code.</div>'; return '<div>Invalid XML in widget code.</div>';
} }
$vars = new stdClass; $vars = new stdClass;
foreach ($xml->img ? $xml->img->attributes() : $xml->attributes() as $key => $val) foreach ($xml->img ? $xml->img->attributes() : $xml->attributes() as $key => $val)
{ {
$vars->{$key} = strval($val); $vars->{$key} = strval($val);
} }
$widget = $vars->widget; $widget = $vars->widget;
if (!$widget) if (!$widget)
{ {
return $matches[0]; return $matches[0];
} }
unset($vars->widget); unset($vars->widget);
return $this->execute($widget, $vars, $this->javascript_mode); return $this->execute($widget, $vars, $this->javascript_mode);
} }
@ -337,15 +337,15 @@ class widgetController extends widget
{ {
continue; continue;
} }
$args->widget_sequence = $args->widget_sequence ?? 0; $args->widget_sequence = $args->widget_sequence ?? 0;
$args->colorset = $args->colorset ?? null; $args->colorset = $args->colorset ?? null;
foreach($args as $k => $v) foreach($args as $k => $v)
{ {
$args->{$k} = urldecode($v); $args->{$k} = urldecode($v);
} }
foreach($lang_list as $lang_type => $val) foreach($lang_list as $lang_type => $val)
{ {
$this->getCache($widget, $args, $lang_type, true); $this->getCache($widget, $args, $lang_type, true);
@ -363,14 +363,14 @@ class widgetController extends widget
{ {
$lang_type = Context::getLangType(); $lang_type = Context::getLangType();
} }
// Fix the widget sequence if it is missing // Fix the widget sequence if it is missing
$widget_sequence = $override_sequence ?: $args->widget_sequence; $widget_sequence = $override_sequence ?: $args->widget_sequence;
if (!$widget_sequence) if (!$widget_sequence)
{ {
$widget_sequence = sha1(json_encode($args)); $widget_sequence = sha1(json_encode($args));
} }
// Set the widget cache duration // Set the widget cache duration
$widget_cache = $args->widget_cache; $widget_cache = $args->widget_cache;
if (preg_match('/^([0-9\.]+)([smhd])$/i', $widget_cache, $matches)) if (preg_match('/^([0-9\.]+)([smhd])$/i', $widget_cache, $matches))
@ -449,7 +449,7 @@ class widgetController extends widget
{ {
// Save for debug run-time widget // Save for debug run-time widget
$start = microtime(true); $start = microtime(true);
// urldecode the value of args haejum // urldecode the value of args haejum
$object_vars = get_object_vars($args); $object_vars = get_object_vars($args);
if(count($object_vars)) if(count($object_vars))
@ -460,12 +460,12 @@ class widgetController extends widget
if($escaped) $args->{$key} = utf8RawUrlDecode($val); if($escaped) $args->{$key} = utf8RawUrlDecode($val);
} }
} }
// Set default // Set default
$args->widget_sequence = $args->widget_sequence ?? 0; $args->widget_sequence = $args->widget_sequence ?? 0;
$args->widget_cache = $args->widget_cache ?? 0; $args->widget_cache = $args->widget_cache ?? 0;
$args->colorset = $args->colorset ?? null; $args->colorset = $args->colorset ?? null;
/** /**
* Widgets widgetContent/widgetBox Wanted If you are not content * Widgets widgetContent/widgetBox Wanted If you are not content
*/ */
@ -671,7 +671,7 @@ class widgetController extends widget
'elapsed_time' => $elapsed_time, 'elapsed_time' => $elapsed_time,
)); ));
} }
// Return result // Return result
return $output; return $output;
} }