mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Remove trailing whitespace
This commit is contained in:
parent
c5267b42fd
commit
37b0d3a1e6
71 changed files with 806 additions and 806 deletions
|
|
@ -143,7 +143,7 @@ class addonAdminController extends addonController
|
|||
$this->makeCacheFile($site_srl, 'mobile', 'site');
|
||||
Rhymix\Framework\Cache::clearGroup('addonConfig');
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_updated', 'info');
|
||||
if(Context::get('success_return_url'))
|
||||
{
|
||||
|
|
@ -245,7 +245,7 @@ class addonAdminController extends addonController
|
|||
{
|
||||
$args->is_used = $isUsed === 'Y' ? 'Y' : 'N';
|
||||
}
|
||||
|
||||
|
||||
if($gtype == 'global')
|
||||
{
|
||||
$output = executeQuery('addon.insertAddon', $args);
|
||||
|
|
@ -256,7 +256,7 @@ class addonAdminController extends addonController
|
|||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.insertSiteAddon', $args);
|
||||
}
|
||||
|
||||
|
||||
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, 'mobile'));
|
||||
|
|
@ -293,7 +293,7 @@ class addonAdminController extends addonController
|
|||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
||||
|
||||
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, 'mobile'));
|
||||
|
|
@ -329,7 +329,7 @@ class addonAdminController extends addonController
|
|||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
||||
|
||||
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, 'mobile'));
|
||||
|
|
@ -338,4 +338,4 @@ class addonAdminController extends addonController
|
|||
|
||||
}
|
||||
/* End of file addon.admin.controller.php */
|
||||
/* Location: ./modules/addon/addon.admin.controller.php */
|
||||
/* Location: ./modules/addon/addon.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class addonAdminModel extends addon
|
|||
{
|
||||
// check blacklist
|
||||
$addonList[$key]->isBlacklisted = Context::isBlacklistedPlugin($addon->addon, 'addon');
|
||||
|
||||
|
||||
// get easyinstall remove url
|
||||
$packageSrl = $oAutoinstallModel->getPackageSrlByPath($addon->path);
|
||||
$addonList[$key]->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl);
|
||||
|
|
@ -109,7 +109,7 @@ class addonAdminModel extends addon
|
|||
$path = $this->getAddonPath($addon_name);
|
||||
// Wanted information on the add-on
|
||||
$info = $this->getAddonInfoXml($addon_name, $site_srl, $gtype);
|
||||
|
||||
|
||||
if(!$info) $info = new stdClass();
|
||||
|
||||
$info->addon = $addon_name;
|
||||
|
|
@ -331,16 +331,16 @@ class addonAdminModel extends addon
|
|||
$addon_info->title = $xml_obj->title->body;
|
||||
$addon_info->description = trim($xml_obj->author->description->body);
|
||||
$addon_info->version = $xml_obj->attrs->version;
|
||||
|
||||
|
||||
$date_obj = new stdClass();
|
||||
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);
|
||||
|
||||
|
||||
$author_obj = new stdClass();
|
||||
$author_obj->name = $xml_obj->author->name->body;
|
||||
$author_obj->email_address = $xml_obj->author->attrs->email_address;
|
||||
$author_obj->homepage = $xml_obj->author->attrs->link;
|
||||
|
||||
|
||||
$addon_info->author = array();
|
||||
$addon_info->author[] = $author_obj;
|
||||
|
||||
|
|
@ -462,7 +462,7 @@ class addonAdminModel extends addon
|
|||
);
|
||||
$always_return_false_for_compatibility = array(
|
||||
);
|
||||
|
||||
|
||||
if(isset($always_return_true_for_compatibility[$addon]))
|
||||
{
|
||||
return true;
|
||||
|
|
@ -471,7 +471,7 @@ class addonAdminModel extends addon
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->addon = $addon;
|
||||
if($gtype == 'global')
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
class addonController extends addon
|
||||
{
|
||||
public $addon_file_called = false;
|
||||
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
|
|
@ -78,41 +78,41 @@ class addonController extends addon
|
|||
foreach($addon_list as $addon => $val)
|
||||
{
|
||||
if(Context::isBlacklistedPlugin($addon, 'addon')
|
||||
|| ($type == "pc" && $val->is_used != 'Y')
|
||||
|| ($type == "mobile" && $val->is_used_m != 'Y')
|
||||
|| ($type == "pc" && $val->is_used != 'Y')
|
||||
|| ($type == "mobile" && $val->is_used_m != 'Y')
|
||||
|| ($gtype == 'global' && $val->is_fixed != 'Y')
|
||||
|| !is_dir(RX_BASEDIR . 'addons/' . $addon))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$extra_vars = unserialize($val->extra_vars);
|
||||
if(!$extra_vars)
|
||||
{
|
||||
$extra_vars = new stdClass;
|
||||
}
|
||||
|
||||
|
||||
$mid_list = $extra_vars->mid_list ?? [];
|
||||
if(!is_array($mid_list))
|
||||
{
|
||||
$mid_list = array();
|
||||
}
|
||||
|
||||
|
||||
// Initialize
|
||||
$buff[] = '$before_time = microtime(true);';
|
||||
|
||||
|
||||
// Run method and mid list
|
||||
$run_method = ($extra_vars->xe_run_method ?? null) ?: 'run_selected';
|
||||
$buff[] = '$rm = \'' . $run_method . "';";
|
||||
$buff[] = '$ml = ' . var_export(array_fill_keys($mid_list, true), true) . ';';
|
||||
$buff[] = '$_m = Context::get(\'mid\');';
|
||||
|
||||
|
||||
// Addon filename
|
||||
$buff[] = sprintf('$addon_file = RX_BASEDIR . \'addons/%s/%s.addon.php\';', $addon, $addon);
|
||||
|
||||
|
||||
// Addon configuration
|
||||
$buff[] = '$addon_info = unserialize(' . var_export(serialize($extra_vars), true) . ');';
|
||||
|
||||
|
||||
// Decide whether to run in this mid
|
||||
if ($run_method === 'no_run_selected')
|
||||
{
|
||||
|
|
@ -126,7 +126,7 @@ class addonController extends addon
|
|||
{
|
||||
$buff[] = '$run = isset($ml[$_m]);';
|
||||
}
|
||||
|
||||
|
||||
// Write debug info
|
||||
$buff[] = 'if ($run && file_exists($addon_file)):';
|
||||
$buff[] = ' include($addon_file);';
|
||||
|
|
@ -142,7 +142,7 @@ class addonController extends addon
|
|||
$buff[] = 'endif;';
|
||||
$buff[] = '';
|
||||
}
|
||||
|
||||
|
||||
// Write file in new location
|
||||
$addon_file = RX_BASEDIR . 'files/cache/addons/' . $type . '.php';
|
||||
FileHandler::writeFile($addon_file, join(PHP_EOL, $buff));
|
||||
|
|
@ -176,7 +176,7 @@ class addonController extends addon
|
|||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
||||
|
||||
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, 'mobile'));
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class AddonModel extends Addon
|
|||
{
|
||||
/**
|
||||
* Get configuration for addon
|
||||
*
|
||||
*
|
||||
* @param string $addon_name
|
||||
* @param string $type
|
||||
* @return object|null
|
||||
|
|
@ -15,14 +15,14 @@ class AddonModel extends Addon
|
|||
{
|
||||
$type = 'any';
|
||||
}
|
||||
|
||||
|
||||
$cache_key = sprintf('addonConfig:%s:%s', $addon_name, $type);
|
||||
$config = Rhymix\Framework\Cache::get($cache_key);
|
||||
if ($config !== null)
|
||||
{
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->addon = $addon_name;
|
||||
$args->site_srl = 0;
|
||||
|
|
@ -31,7 +31,7 @@ class AddonModel extends Addon
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$result = array_first($output->data);
|
||||
if ($type === 'pc' && $result->is_used !== 'Y')
|
||||
{
|
||||
|
|
@ -45,7 +45,7 @@ class AddonModel extends Addon
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$config = unserialize($result->extra_vars);
|
||||
unset($config->xe_validator_id);
|
||||
if (!isset($config->mid_list))
|
||||
|
|
@ -54,7 +54,7 @@ class AddonModel extends Addon
|
|||
}
|
||||
$config->use_pc = $result->is_used;
|
||||
$config->use_mobile = $result->is_used_m;
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::set($cache_key, $config, 0, true);
|
||||
return $config;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
// Get and validate the new configuration.
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
// Update the current module's configuration.
|
||||
$config = $this->getConfig();
|
||||
$config->log_sent_mail = toBool($vars->log_sent_mail);
|
||||
|
|
@ -33,7 +33,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
if (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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save the exception configuration.
|
||||
*/
|
||||
|
|
@ -52,7 +52,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
// Get the current configuration.
|
||||
$config = $this->getConfig();
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
|
||||
|
||||
// Get and validate the list of exceptions.
|
||||
$exceptions = array();
|
||||
for ($i = 1; $i <= 3; $i++)
|
||||
|
|
@ -77,7 +77,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
}
|
||||
$exceptions[$i]['method'] = $method;
|
||||
$exceptions[$i]['domains'] = array();
|
||||
|
||||
|
||||
$domains = array_map('trim', preg_split('/[,\n]/', $domains, null, PREG_SPLIT_NO_EMPTY));
|
||||
foreach ($domains as $domain)
|
||||
{
|
||||
|
|
@ -89,7 +89,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Save the new configuration.
|
||||
$config->exceptions = $exceptions;
|
||||
$output = getController('module')->insertModuleConfig('advanced_mailer', $config);
|
||||
|
|
@ -101,7 +101,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
if (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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check the DNS record of a domain.
|
||||
*/
|
||||
|
|
@ -128,14 +128,14 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('record_content', false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$records = @dns_get_record($check_config->hostname, constant('DNS_' . $check_config->record_type));
|
||||
if ($records === false)
|
||||
{
|
||||
$this->add('record_content', false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$return_values = array();
|
||||
foreach ($records as $record)
|
||||
{
|
||||
|
|
@ -147,7 +147,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('record_content', implode("\n\n", $return_values));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear old mail sending log.
|
||||
*/
|
||||
|
|
@ -163,15 +163,15 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->status = $status;
|
||||
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
|
||||
$output = executeQuery('advanced_mailer.deleteMailLogs', $obj);
|
||||
|
||||
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailLog', 'status', $status));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear old SMS sending log.
|
||||
*/
|
||||
|
|
@ -187,15 +187,15 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->status = $status;
|
||||
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
|
||||
$output = executeQuery('advanced_mailer.deleteSMSLogs', $obj);
|
||||
|
||||
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSLog', 'status', $status));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear old Push sending log.
|
||||
*/
|
||||
|
|
@ -211,15 +211,15 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->status = $status;
|
||||
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
|
||||
$output = executeQuery('advanced_mailer.deletePushLogs', $obj);
|
||||
|
||||
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminPushLog', 'status', $status));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send a test mail.
|
||||
*/
|
||||
|
|
@ -228,7 +228,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$recipient_config = Context::gets('recipient_name', 'recipient_email');
|
||||
$recipient_name = $recipient_config->recipient_name;
|
||||
$recipient_email = $recipient_config->recipient_email;
|
||||
|
||||
|
||||
if (!$recipient_name)
|
||||
{
|
||||
$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'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$oAdvancedMailerController = getController('advanced_mailer');
|
||||
$sending_method = $oAdvancedMailerController->getSendingMethodForEmailAddress($recipient_email) ?: config('mail.type');
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$oMail = new Rhymix\Framework\Mail();
|
||||
|
|
@ -256,7 +256,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
'<p>고급 메일 발송 모듈 <b>테스트</b> 메일입니다.</p><p>메일이 정상적으로 발송되고 있습니다.</p>');
|
||||
$oMail->addTo($recipient_email, $recipient_name);
|
||||
$result = $oMail->send();
|
||||
|
||||
|
||||
if (!$result)
|
||||
{
|
||||
if (count($oMail->getErrors()))
|
||||
|
|
@ -274,7 +274,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->add('test_result', nl2br(htmlspecialchars(implode("\n", $oMail->getErrors()))));
|
||||
return;
|
||||
}
|
||||
|
|
@ -290,11 +290,11 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('test_result', nl2br(htmlspecialchars($e->getMessage())));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->add('test_result', Context::getLang('msg_advanced_mailer_test_success'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send a test SMS.
|
||||
*/
|
||||
|
|
@ -303,7 +303,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$recipient_number = Context::get('recipient_number');
|
||||
$country_code = intval(Context::get('country_code'));
|
||||
$content = trim(Context::get('content'));
|
||||
|
||||
|
||||
if (!$recipient_number)
|
||||
{
|
||||
$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'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$oSMS = new Rhymix\Framework\SMS();
|
||||
$oSMS->addTo($recipient_number, $country_code);
|
||||
$oSMS->setBody($content);
|
||||
$result = $oSMS->send();
|
||||
|
||||
|
||||
if (!$result)
|
||||
{
|
||||
if (count($oSMS->getErrors()))
|
||||
|
|
@ -341,11 +341,11 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('test_result', nl2br(htmlspecialchars($e->getMessage())));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->add('test_result', Context::getLang('msg_advanced_mailer_test_success_sms'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send a test Push Notification.
|
||||
*/
|
||||
|
|
@ -355,14 +355,14 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$subject = trim(Context::get('subject'));
|
||||
$content = trim(Context::get('content'));
|
||||
$url = trim(Context::get('url'));
|
||||
|
||||
|
||||
$member_info = MemberModel::getMemberInfoByUserID($recipient_user_id);
|
||||
if (!$member_info || !$member_info->member_srl)
|
||||
{
|
||||
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_user_id_not_found'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass;
|
||||
$args->member_srl = $member_info->member_srl;
|
||||
$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'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!$subject)
|
||||
{
|
||||
$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'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$oPush = new Rhymix\Framework\Push;
|
||||
|
|
@ -396,7 +396,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$oPush->setContent($content);
|
||||
$oPush->setURL($url);
|
||||
$result = $oPush->send();
|
||||
|
||||
|
||||
if (!$result)
|
||||
{
|
||||
if (count($oPush->getErrors()))
|
||||
|
|
@ -416,7 +416,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('test_result', nl2br(htmlspecialchars($e->getMessage())));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->add('test_result', Context::getLang('msg_advanced_mailer_test_success_sms'));
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('config');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the exception domains configuration form.
|
||||
*/
|
||||
|
|
@ -27,7 +27,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
|
||||
|
||||
for ($i = 1; $i <= 3; $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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
Context::set('sending_method', config('mail.type'));
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('exceptions');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the SPF/DKIM setting guide.
|
||||
*/
|
||||
|
|
@ -55,7 +55,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
|
||||
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
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']));
|
||||
}
|
||||
|
||||
|
||||
$used_methods = array(config('mail.type'));
|
||||
$advanced_mailer_config->exceptions = $advanced_mailer_config->exceptions ?: array();
|
||||
foreach ($advanced_mailer_config->exceptions as $exception)
|
||||
|
|
@ -78,7 +78,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
Context::set('used_methods', $used_methods);
|
||||
|
||||
|
||||
$used_methods_with_usable_spf = array();
|
||||
$used_methods_with_usable_dkim = array();
|
||||
foreach ($used_methods as $method)
|
||||
|
|
@ -104,11 +104,11 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
ksort($used_methods_with_usable_dkim);
|
||||
Context::set('used_methods_with_usable_spf', $used_methods_with_usable_spf);
|
||||
Context::set('used_methods_with_usable_dkim', $used_methods_with_usable_dkim);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('spf_dkim');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the mail test form.
|
||||
*/
|
||||
|
|
@ -116,15 +116,15 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
|
||||
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
Context::set('sending_method', config('mail.type'));
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('mail_test');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the mail log.
|
||||
*/
|
||||
|
|
@ -137,20 +137,20 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
$maillog = $maillog->toBool() ? $this->procMailLog($maillog->data) : array();
|
||||
Context::set('advanced_mailer_log', $maillog);
|
||||
Context::set('advanced_mailer_status', $obj->status);
|
||||
|
||||
|
||||
$paging = $this->procPaging($obj->status, 'mail', $page);
|
||||
Context::set('total_count', $paging->total_count);
|
||||
Context::set('total_page', $paging->total_page);
|
||||
Context::set('page', $paging->page);
|
||||
Context::set('page_navigation', $paging->page_navigation);
|
||||
|
||||
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('mail_log');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the SMS test form.
|
||||
*/
|
||||
|
|
@ -158,15 +158,15 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
|
||||
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
Context::set('sending_method', config('mail.type'));
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('sms_test');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the SMS log.
|
||||
*/
|
||||
|
|
@ -179,20 +179,20 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
$smslog = $smslog->toBool() ? $smslog->data : array();
|
||||
Context::set('advanced_mailer_log', $smslog);
|
||||
Context::set('advanced_mailer_status', $obj->status);
|
||||
|
||||
|
||||
$paging = $this->procPaging($obj->status, 'sms', $page);
|
||||
Context::set('total_count', $paging->total_count);
|
||||
Context::set('total_page', $paging->total_page);
|
||||
Context::set('page', $paging->page);
|
||||
Context::set('page_navigation', $paging->page_navigation);
|
||||
|
||||
|
||||
$sending_methods = Rhymix\Framework\SMS::getSupportedDrivers();
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('sms_log');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the Push test form.
|
||||
*/
|
||||
|
|
@ -200,11 +200,11 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('push_test');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the Push log.
|
||||
*/
|
||||
|
|
@ -217,17 +217,17 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
$pushlog = $pushlog->toBool() ? $pushlog->data : array();
|
||||
Context::set('advanced_mailer_log', $pushlog);
|
||||
Context::set('advanced_mailer_status', $obj->status);
|
||||
|
||||
|
||||
$paging = $this->procPaging($obj->status, 'push', $page);
|
||||
Context::set('total_count', $paging->total_count);
|
||||
Context::set('total_page', $paging->total_page);
|
||||
Context::set('page', $paging->page);
|
||||
Context::set('page_navigation', $paging->page_navigation);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('push_log');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process mail log for display.
|
||||
*/
|
||||
|
|
@ -248,7 +248,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
$item->mail_from = $from;
|
||||
|
||||
|
||||
$to = explode("\n", $item->mail_to);
|
||||
foreach($to as &$toitem)
|
||||
{
|
||||
|
|
@ -263,10 +263,10 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
}
|
||||
$item->mail_to = $to;
|
||||
}
|
||||
|
||||
|
||||
return $log;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process paging.
|
||||
*/
|
||||
|
|
@ -288,7 +288,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
}
|
||||
$total_count = $count->data->count;
|
||||
$total_page = max(1, ceil($total_count / 20));
|
||||
|
||||
|
||||
$output = new stdClass;
|
||||
$output->total_count = $total_count;
|
||||
$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);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the public IPv4 address of the current server.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -18,23 +18,23 @@ class Advanced_Mailer extends ModuleObject
|
|||
{
|
||||
$config = new stdClass();
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->is_enabled) || isset($config->sending_method) || isset($config->send_type))
|
||||
{
|
||||
$config = $this->migrateConfig($config);
|
||||
getController('module')->insertModuleConfig('advanced_mailer', $config);
|
||||
}
|
||||
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Migrate from previous configuration format.
|
||||
*/
|
||||
public function migrateConfig($config)
|
||||
{
|
||||
$systemconfig = array();
|
||||
|
||||
|
||||
if (isset($config->sending_method))
|
||||
{
|
||||
$systemconfig['mail.type'] = $config->sending_method;
|
||||
|
|
@ -47,7 +47,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
{
|
||||
$systemconfig['mail.type'] = 'mailfunction';
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->username))
|
||||
{
|
||||
if (in_array('username', $this->sending_methods[$config->sending_method]['conf']))
|
||||
|
|
@ -56,7 +56,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
unset($config->username);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->password))
|
||||
{
|
||||
if (in_array('password', $this->sending_methods[$config->sending_method]['conf']))
|
||||
|
|
@ -65,7 +65,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
unset($config->password);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->domain))
|
||||
{
|
||||
if (in_array('domain', $this->sending_methods[$config->sending_method]['conf']))
|
||||
|
|
@ -74,7 +74,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
unset($config->domain);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->api_key))
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->account_type))
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->aws_region))
|
||||
{
|
||||
$config->ses_region = $config->aws_region;
|
||||
unset($config->aws_region);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->aws_access_key))
|
||||
{
|
||||
$config->ses_access_key = $config->aws_access_key;
|
||||
unset($config->aws_access_key);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->aws_secret_key))
|
||||
{
|
||||
$config->ses_secret_key = $config->aws_secret_key;
|
||||
unset($config->aws_secret_key);
|
||||
}
|
||||
|
||||
|
||||
$mail_drivers = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
foreach ($mail_drivers as $driver_name => $driver_definition)
|
||||
{
|
||||
|
|
@ -153,7 +153,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (count($systemconfig))
|
||||
{
|
||||
foreach ($systemconfig as $key => $value)
|
||||
|
|
@ -162,7 +162,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
Rhymix\Framework\Config::save();
|
||||
}
|
||||
|
||||
|
||||
unset($config->is_enabled);
|
||||
unset($config->sending_method);
|
||||
unset($config->send_type);
|
||||
|
|
@ -173,10 +173,10 @@ class Advanced_Mailer extends ModuleObject
|
|||
{
|
||||
$config->exceptions = array();
|
||||
}
|
||||
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register triggers.
|
||||
*/
|
||||
|
|
@ -205,7 +205,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
$oModuleController->insertTrigger('push.send', 'advanced_mailer', 'controller', 'triggerAfterPushSend', 'after');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Install.
|
||||
*/
|
||||
|
|
@ -213,7 +213,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
{
|
||||
$this->registerTriggers();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check update.
|
||||
*/
|
||||
|
|
@ -242,7 +242,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update.
|
||||
*/
|
||||
|
|
@ -250,7 +250,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
{
|
||||
$this->registerTriggers();
|
||||
}
|
||||
|
||||
|
||||
public function recompileCache()
|
||||
{
|
||||
// no-op
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
public function triggerBeforeMailSend($mail)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
$recipients = $mail->message->getTo() ?: array();
|
||||
if ($recipients)
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$mail->getFrom())
|
||||
{
|
||||
list($default_from, $default_name) = $this->getDefaultEmailIdentity();
|
||||
|
|
@ -58,20 +58,20 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* After mail send trigger.
|
||||
*/
|
||||
public function triggerAfterMailSend($mail)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
if (toBool($config->log_sent_mail ?? 'N') || (toBool($config->log_errors ?? 'N') && count($mail->errors)))
|
||||
{
|
||||
$obj = new \stdClass();
|
||||
$obj->mail_from = '';
|
||||
$obj->mail_to = '';
|
||||
|
||||
|
||||
if ($real_sender = $mail->message->getFrom())
|
||||
{
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($real_to = $mail->message->getTo())
|
||||
{
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($real_cc = $mail->message->getCc())
|
||||
{
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($real_bcc = $mail->message->getBcc())
|
||||
{
|
||||
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_from = trim($obj->mail_from);
|
||||
$obj->mail_to = trim($obj->mail_to);
|
||||
$obj->subject = $mail->message->getSubject();
|
||||
|
|
@ -118,10 +118,10 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the default identity for sending email.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDefaultEmailIdentity()
|
||||
|
|
@ -134,13 +134,13 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
$email = $member_config->webmaster_email;
|
||||
$name = $member_config->webmaster_name ?: 'webmaster';
|
||||
}
|
||||
|
||||
|
||||
return [$email, $name];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if an email address is on a list of exceptions.
|
||||
*
|
||||
*
|
||||
* @param string $email
|
||||
* @param object $config (optional)
|
||||
* @return string|null
|
||||
|
|
@ -151,14 +151,14 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
{
|
||||
$config = $this->getConfig();
|
||||
}
|
||||
|
||||
|
||||
if (!isset($config->exceptions) || !is_array($config->exceptions) || !count($config->exceptions))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$email = Rhymix\Framework\URL::encodeIdna($email);
|
||||
|
||||
|
||||
foreach ($config->exceptions as $exception)
|
||||
{
|
||||
$domains = array();
|
||||
|
|
@ -171,17 +171,17 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
return $exception['method'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* After SMS send trigger.
|
||||
*/
|
||||
public function triggerAfterSMSSend($sms)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
if (toBool($config->log_sent_sms ?? 'N') || (toBool($config->log_sms_errors ?? 'N') && count($sms->errors)))
|
||||
{
|
||||
$obj = new \stdClass();
|
||||
|
|
@ -211,14 +211,14 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* After Push send trigger.
|
||||
*/
|
||||
public function triggerAfterPushSend($push)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
if (toBool($config->log_sent_push ?? 'N') || (toBool($config->log_push_errors ?? 'N') && count($push->getErrors())))
|
||||
{
|
||||
$obj = new \stdClass();
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@ class Advanced_MailerModel extends Advanced_Mailer
|
|||
*/
|
||||
public function triggerReplaceMailClass()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class communicationAdminController extends communication
|
|||
$output = $oModuleController->insertModuleConfig('communication', $args);
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispCommunicationAdminConfig');
|
||||
|
||||
|
||||
return $this->setRedirectUrl($returnUrl, $output);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class communicationAdminModel extends communication
|
|||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir);
|
||||
Context::set('skin_info', $skin_info);
|
||||
Context::set('communication_config', CommunicationModel::getConfig());
|
||||
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('skin_info.colorset..title', 'skin_info.colorset..name');
|
||||
$security->encodeHTML('skin_info.colorset..name');
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
||||
|
||||
/**
|
||||
* @class communication
|
||||
* @class communication
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* communication module of the high class
|
||||
*/
|
||||
|
|
@ -22,7 +22,7 @@ class communication extends ModuleObject
|
|||
function moduleInstall()
|
||||
{
|
||||
$oModuleController = getController('module');
|
||||
|
||||
|
||||
foreach($this->triggers as $trigger)
|
||||
{
|
||||
$oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
|
||||
|
|
@ -39,7 +39,7 @@ class communication extends ModuleObject
|
|||
function checkUpdate()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
|
||||
foreach($this->triggers as $trigger)
|
||||
{
|
||||
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
|
||||
|
|
@ -65,7 +65,7 @@ class communication extends ModuleObject
|
|||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ class communication extends ModuleObject
|
|||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController = getController('module');
|
||||
|
||||
|
||||
foreach($this->triggers as $trigger)
|
||||
{
|
||||
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
|
||||
|
|
@ -106,7 +106,7 @@ class communication extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class communicationController extends communication
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
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'));
|
||||
|
|
@ -82,7 +82,7 @@ class communicationController extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_content_is_null');
|
||||
}
|
||||
|
||||
|
||||
$temp_srl = intval(Context::get('temp_srl')) ?: null;
|
||||
if($temp_srl && !$_SESSION['upload_info'][$temp_srl]->enabled)
|
||||
{
|
||||
|
|
@ -241,7 +241,7 @@ class communicationController extends communication
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// update attached files
|
||||
if ($temp_srl)
|
||||
{
|
||||
|
|
@ -251,10 +251,10 @@ class communicationController extends communication
|
|||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('communication.sendMessage', 'after', $trigger_obj);
|
||||
|
||||
|
||||
$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);
|
||||
|
||||
return new BaseObject(0, 'success_sended');
|
||||
|
|
@ -395,7 +395,7 @@ class communicationController extends communication
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Delete attachment, only if related message has also been deleted
|
||||
$related = $message->related_srl ? $oCommunicationModel->getSelectedMessage($message->related_srl) : true;
|
||||
if (!$related)
|
||||
|
|
@ -404,7 +404,7 @@ class communicationController extends communication
|
|||
$oFileController->deleteFiles($message->message_srl);
|
||||
$oFileController->deleteFiles($message->related_srl);
|
||||
}
|
||||
|
||||
|
||||
$this->updateFlagFile($member_srl);
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
|
@ -467,7 +467,7 @@ class communicationController extends communication
|
|||
// Organize variables
|
||||
$args = new stdClass();
|
||||
$args->message_srls = implode(',', $target);
|
||||
|
||||
|
||||
if ($message_type === 'N')
|
||||
{
|
||||
$args->message_type = 'R';
|
||||
|
|
@ -476,7 +476,7 @@ class communicationController extends communication
|
|||
{
|
||||
$args->message_type = $message_type;
|
||||
}
|
||||
|
||||
|
||||
if($message_type == 'S')
|
||||
{
|
||||
$args->sender_srl = $member_srl;
|
||||
|
|
@ -503,14 +503,14 @@ class communicationController extends communication
|
|||
unset($related[$item->message_srl]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Delete
|
||||
$output = executeQuery('communication.deleteMessages', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Delete attachment, only if related message has also been deleted
|
||||
$oFileController = getController('file');
|
||||
foreach ($related as $message_srl => $related_srl)
|
||||
|
|
@ -518,7 +518,7 @@ class communicationController extends communication
|
|||
$oFileController->deleteFiles($message_srl);
|
||||
$oFileController->deleteFiles($related_srl);
|
||||
}
|
||||
|
||||
|
||||
$this->updateFlagFile($member_srl);
|
||||
$this->setMessage('success_deleted');
|
||||
|
||||
|
|
@ -549,7 +549,7 @@ class communicationController extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_no_self_friend');
|
||||
}
|
||||
|
||||
|
||||
// Check duplicate friend
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
|
|
@ -567,7 +567,7 @@ class communicationController extends communication
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
// Variable
|
||||
$args->friend_srl = getNextSequence();
|
||||
$args->list_order = $args->friend_srl * -1;
|
||||
|
|
@ -579,7 +579,7 @@ class communicationController extends communication
|
|||
|
||||
// Call trigger (after)
|
||||
$trigger_output = ModuleHandler::triggerCall('communication.addFriend', 'after', $args);
|
||||
|
||||
|
||||
$this->add('member_srl', $target_srl);
|
||||
$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)
|
||||
*/
|
||||
function procCommunicationDeleteFriend()
|
||||
|
|
@ -693,14 +693,14 @@ class communicationController extends communication
|
|||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->friend_srl_list = $friend_srl_list;
|
||||
|
||||
|
||||
// Call trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('communication.deleteFriend', 'before', $args);
|
||||
if(!$trigger_output->toBool())
|
||||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
// Delete
|
||||
$output = executeQuery('communication.deleteFriend', $args);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -710,7 +710,7 @@ class communicationController extends communication
|
|||
|
||||
// Call trigger (after)
|
||||
$trigger_output = ModuleHandler::triggerCall('communication.deleteFriend', 'after', $args);
|
||||
|
||||
|
||||
$this->setMessage('success_deleted');
|
||||
|
||||
$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'
|
||||
* @param int $message_srl
|
||||
* @param int $message_srl
|
||||
* @return Object
|
||||
*/
|
||||
function setMessageReaded($message_srl)
|
||||
|
|
@ -864,14 +864,14 @@ class communicationController extends communication
|
|||
$args->message_srl = $message_srl;
|
||||
$args->related_srl = $message_srl;
|
||||
$output = executeQuery('communication.setMessageReaded', $args);
|
||||
|
||||
|
||||
// Update flag file
|
||||
$logged_info = Context::get('logged_info');
|
||||
$this->updateFlagFile($logged_info->member_srl);
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update flag file
|
||||
* @param int $member_srl
|
||||
|
|
@ -897,12 +897,12 @@ class communicationController extends communication
|
|||
// Add menus on the member login information
|
||||
$config = getModel('communication')->getConfig();
|
||||
$oMemberController = getController('member');
|
||||
|
||||
|
||||
if($config->enable_message == 'Y')
|
||||
{
|
||||
$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
|
||||
}
|
||||
|
||||
|
||||
if($config->enable_friend == 'Y')
|
||||
{
|
||||
$oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
|
||||
|
|
@ -921,10 +921,10 @@ class communicationController extends communication
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$oCommunicationModel = getModel('communication');
|
||||
$config = $oCommunicationModel->getConfig();
|
||||
|
||||
|
||||
if($config->enable_message == 'N' && $config->enable_friend == 'N')
|
||||
{
|
||||
return;
|
||||
|
|
@ -933,12 +933,12 @@ class communicationController extends communication
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$mid = Context::get('cur_mid');
|
||||
$member_srl = Context::get('target_srl');
|
||||
$logged_info = Context::get('logged_info');
|
||||
$oMemberController = getController('member');
|
||||
|
||||
|
||||
// Add a feature to display own message box.
|
||||
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');
|
||||
}
|
||||
|
||||
|
||||
// Display a list of friends
|
||||
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');
|
||||
}
|
||||
|
||||
|
||||
// Add a menu for listing friends (if a friend is new)
|
||||
if($config->enable_friend == 'Y' && !$oCommunicationModel->isAddedFriend($member_srl))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class communicationMobile extends communicationView
|
|||
$this->module_info->mlayout_srl = $this->config->mlayout_srl;
|
||||
$this->setLayoutPath($layout_info->path);
|
||||
}
|
||||
|
||||
|
||||
$this->setTemplatePath($template_path);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class communicationModel extends communication
|
|||
{
|
||||
$config = new stdClass();
|
||||
}
|
||||
|
||||
|
||||
$config->enable_message = $config->enable_message ?? 'Y';
|
||||
$config->enable_friend = $config->enable_friend ?? 'Y';
|
||||
$config->enable_attachment = $config->enable_attachment ?? 'N';
|
||||
|
|
@ -42,12 +42,12 @@ class communicationModel extends communication
|
|||
$config->mskin = $config->mskin ?? 'default';
|
||||
$config->mcolorset = $config->mcolorset ?? 'white';
|
||||
$config->grant_send = $config->grant_send ?? array('default' => 'member');
|
||||
|
||||
|
||||
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 array $group
|
||||
* @return array
|
||||
|
|
@ -59,17 +59,17 @@ class communicationModel extends communication
|
|||
{
|
||||
$grant = array('default' => $default);
|
||||
}
|
||||
else if(is_array($group))
|
||||
else if(is_array($group))
|
||||
{
|
||||
$grant_group = array();
|
||||
foreach($group as $group_srl)
|
||||
{
|
||||
$grant_group[$group_srl] = true;
|
||||
}
|
||||
|
||||
|
||||
$grant = array('group' => $grant_group);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $grant;
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ class communicationModel extends communication
|
|||
public static function checkGrant($arrGrant)
|
||||
{
|
||||
if(!$arrGrant) return false;
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y') return true;
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ class communicationModel extends communication
|
|||
|
||||
$oCommunicationController = getController('communication');
|
||||
$oCommunicationController->setMessageReaded($message->message_srl);
|
||||
|
||||
|
||||
if (!$message->member_srl)
|
||||
{
|
||||
$message->member_srl = $message->sender_srl;
|
||||
|
|
@ -280,13 +280,13 @@ class communicationModel extends communication
|
|||
$message->user_name = $message->nick_name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of files attached to a message.
|
||||
*
|
||||
*
|
||||
* @param object $message
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -318,7 +318,7 @@ class communicationModel extends communication
|
|||
$args->page_count = 10;
|
||||
|
||||
$output = executeQuery('communication.getFriends', $args, $columnList);
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -334,7 +334,7 @@ class communicationModel extends communication
|
|||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->target_srl = $member_srl;
|
||||
|
||||
|
||||
$output = executeQuery('communication.isAddedFriend', $args);
|
||||
|
||||
return $output->data->count;
|
||||
|
|
@ -354,7 +354,7 @@ class communicationModel extends communication
|
|||
$args->friend_group_srl = $friend_group_srl;
|
||||
|
||||
$output = executeQuery('communication.getFriendGroup', $args);
|
||||
|
||||
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
|
|
@ -372,15 +372,15 @@ class communicationModel extends communication
|
|||
$friend_group_list = array();
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* check whether to be added in the friend list
|
||||
* @param int $target_srl
|
||||
* @return boolean (true : friend, false : not friend)
|
||||
* @param int $target_srl
|
||||
* @return boolean (true : friend, false : not friend)
|
||||
*/
|
||||
public static function isFriend($target_srl)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class communicationView extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -117,7 +117,7 @@ class communicationView extends communication
|
|||
stripEmbedTagForAdmin($message->content, $message->sender_srl);
|
||||
Context::set('message', $message);
|
||||
Context::set('message_files', CommunicationModel::getMessageFiles($message));
|
||||
|
||||
|
||||
if(Mobile::isFromMobilePhone() && file_exists($this->getTemplatePath() . 'read_message.html'))
|
||||
{
|
||||
$template_filename = 'read_message';
|
||||
|
|
@ -132,7 +132,7 @@ class communicationView extends communication
|
|||
// Extract a list
|
||||
$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);
|
||||
|
||||
|
||||
// set a template file
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
|
|
@ -159,7 +159,7 @@ class communicationView extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -200,13 +200,13 @@ class communicationView extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// Fix missing mid (it causes errors when uploading)
|
||||
if(!Context::get('mid'))
|
||||
{
|
||||
Context::set('mid', Context::get('site_module_info')->mid);
|
||||
}
|
||||
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -231,7 +231,7 @@ class communicationView extends communication
|
|||
|
||||
$oCommunicationModel = getModel('communication');
|
||||
$oMemberModel = getModel('member');
|
||||
|
||||
|
||||
// get message_srl of the original message if it is a reply
|
||||
$message_srl = Context::get('message_srl');
|
||||
if($message_srl)
|
||||
|
|
@ -292,13 +292,13 @@ class communicationView extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
}
|
||||
|
||||
|
||||
$oCommunicationModel = getModel('communication');
|
||||
|
||||
// get a group list
|
||||
|
|
@ -346,12 +346,12 @@ class communicationView extends communication
|
|||
{
|
||||
$this->setLayoutPath('./common/tpl/');
|
||||
$this->setLayoutFile("popup_layout");
|
||||
|
||||
|
||||
if($this->config->enable_friend == 'N')
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -396,12 +396,12 @@ class communicationView extends communication
|
|||
{
|
||||
$this->setLayoutPath('./common/tpl/');
|
||||
$this->setLayoutFile("popup_layout");
|
||||
|
||||
|
||||
if($this->config->enable_friend == 'N')
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// error apprears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class editorAdminController extends editor
|
|||
{
|
||||
$oModuleController = getController('module');
|
||||
$configVars = Context::getRequestVars();
|
||||
|
||||
|
||||
$config = new stdClass;
|
||||
$config->editor_skin = $configVars->editor_skin;
|
||||
$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_toolbar = $configVars->mobile_comment_editor_toolbar;
|
||||
$config->mobile_comment_editor_toolbar_hide = $configVars->mobile_comment_editor_toolbar_hide === 'Y' ? 'Y' : 'N';
|
||||
|
||||
|
||||
if ($configVars->font_defined === 'Y')
|
||||
{
|
||||
$config->font_defined = 'Y';
|
||||
|
|
@ -177,7 +177,7 @@ class editorAdminController extends editor
|
|||
$config->font_defined = $configVars->font_defined = 'N';
|
||||
$config->content_font = $configVars->content_font;
|
||||
}
|
||||
|
||||
|
||||
if ($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();
|
||||
}
|
||||
|
||||
|
||||
if ($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();
|
||||
}
|
||||
|
||||
|
||||
if ($configVars->additional_plugins)
|
||||
{
|
||||
$additional_plugins = array_map('trim', explode(',', $configVars->additional_plugins));
|
||||
|
|
@ -210,7 +210,7 @@ class editorAdminController extends editor
|
|||
{
|
||||
$config->additional_plugins = array();
|
||||
}
|
||||
|
||||
|
||||
if ($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->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_line_height = trim($configVars->content_line_height);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class editorAdminView extends editor
|
|||
$editor_config->$key = $val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get skin info
|
||||
$editor_skin_list = array();
|
||||
$skin_dir_list = FileHandler::readDir($this->module_path . 'skins');
|
||||
|
|
@ -46,7 +46,7 @@ class editorAdminView extends editor
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Context::set('editor_config', $editor_config);
|
||||
Context::set('editor_skin_list', $editor_skin_list);
|
||||
Context::set('component_list', $component_list);
|
||||
|
|
@ -108,7 +108,7 @@ class editorAdminView extends editor
|
|||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
Context::set('component', $component);
|
||||
|
||||
|
||||
// Get a group list to set a group
|
||||
$group_list = MemberModel::getGroups(0);
|
||||
Context::set('group_list', $group_list);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* @class editorAPI
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* @brief
|
||||
* @brief
|
||||
*/
|
||||
class editorAPI extends editor
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* @class editor
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* @brief high class of the editor odule
|
||||
* @brief high class of the editor odule
|
||||
*/
|
||||
class editor extends ModuleObject
|
||||
{
|
||||
|
|
@ -17,7 +17,7 @@ class editor extends ModuleObject
|
|||
'default_paragraph_spacing' => '0',
|
||||
'default_word_break' => 'normal',
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Default editor config
|
||||
*/
|
||||
|
|
@ -58,7 +58,7 @@ class editor extends ModuleObject
|
|||
'additional_plugins' => array(),
|
||||
'remove_plugins' => array('liststyle', 'tabletools', 'tableselection', 'contextmenu', 'exportpdf'),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Implement if additional tasks are necessary when installing
|
||||
*/
|
||||
|
|
@ -104,7 +104,7 @@ class editor extends ModuleObject
|
|||
// 2009. 06. 19 Remove unused trigger
|
||||
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;
|
||||
|
||||
return false;
|
||||
|
|
@ -117,7 +117,7 @@ class editor extends ModuleObject
|
|||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleController = getController('module');
|
||||
|
||||
|
||||
// XEVE-17-030
|
||||
if(!$oDB->isColumnExists('editor_autosave', 'certify_key'))
|
||||
{
|
||||
|
|
@ -127,23 +127,23 @@ class editor extends ModuleObject
|
|||
{
|
||||
$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
|
||||
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');
|
||||
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');
|
||||
// 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');
|
||||
// 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');
|
||||
// 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');
|
||||
|
||||
// 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'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after');
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class editorController extends editor
|
|||
{
|
||||
// Get request vars
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
// To configure many of modules at once
|
||||
$target_module_srl = $vars->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';
|
||||
}
|
||||
|
||||
|
||||
// Apply module-specific editor settings.
|
||||
$config->editor_skin = $vars->editor_skin;
|
||||
$config->editor_colorset = $vars->editor_colorset;
|
||||
|
|
@ -152,7 +152,7 @@ class editorController extends editor
|
|||
$config->font_defined = $vars->font_defined = 'N';
|
||||
$config->content_font = $vars->content_font;
|
||||
}
|
||||
|
||||
|
||||
$config->content_font_size = trim($vars->content_font_size);
|
||||
$config->enable_autosave = $vars->enable_autosave ?: 'Y';
|
||||
$config->auto_dark_mode = $vars->auto_dark_mode ?: 'Y';
|
||||
|
|
@ -217,7 +217,7 @@ class editorController extends editor
|
|||
{
|
||||
$editor_config = getModel('module')->getModuleConfig('editor');
|
||||
}
|
||||
|
||||
|
||||
if ($editor_config)
|
||||
{
|
||||
$default_font_config = self::$default_font_config;
|
||||
|
|
@ -457,7 +457,7 @@ class editorController extends editor
|
|||
{
|
||||
$xml_info->mid_list = $extra_vars->mid_list;
|
||||
}
|
||||
|
||||
|
||||
// Check the configuration of the editor component
|
||||
if(!empty($xml_info->extra_vars))
|
||||
{
|
||||
|
|
@ -469,7 +469,7 @@ class editorController extends editor
|
|||
}
|
||||
|
||||
$component_list->{$component_name} = $xml_info;
|
||||
|
||||
|
||||
// Get buttons, icons, images
|
||||
$icon_file = RX_BASEDIR . 'modules/editor/components/'.$component_name.'/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);
|
||||
}
|
||||
|
||||
|
||||
return $component_list;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class editorModel extends editor
|
|||
*/
|
||||
protected static $_module_config = array();
|
||||
protected static $_loaded_component_list = array();
|
||||
|
||||
|
||||
/**
|
||||
* @brief Return the editor
|
||||
*
|
||||
|
|
@ -45,7 +45,7 @@ class editorModel extends editor
|
|||
{
|
||||
$editor_config = new stdClass;
|
||||
}
|
||||
|
||||
|
||||
// Fill in some other values.
|
||||
$grant_vars = array(
|
||||
'enable_html_grant',
|
||||
|
|
@ -64,10 +64,10 @@ class editorModel extends editor
|
|||
$editor_config->{$var} = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Load the default config for editor module.
|
||||
$editor_default_config = ModuleModel::getModuleConfig('editor') ?: new stdClass;
|
||||
|
||||
|
||||
// Check whether we should use the default config.
|
||||
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';
|
||||
}
|
||||
|
||||
|
||||
// Apply the default config for missing values.
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $editor_config;
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ class editorModel extends editor
|
|||
public static function getSkinConfig($skin_name)
|
||||
{
|
||||
$skin_config = new stdClass;
|
||||
|
||||
|
||||
if($skin_info = ModuleModel::loadSkinInfo('./modules/editor', $skin_name))
|
||||
{
|
||||
foreach ($skin_info->extra_vars as $val)
|
||||
|
|
@ -107,7 +107,7 @@ class editorModel extends editor
|
|||
$skin_config->{$val->name} = $val->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $skin_config;
|
||||
}
|
||||
|
||||
|
|
@ -120,12 +120,12 @@ class editorModel extends editor
|
|||
{
|
||||
// Load language files.
|
||||
Context::loadLang('./modules/editor/lang');
|
||||
|
||||
|
||||
// Initialize options.
|
||||
if (!is_object($option))
|
||||
{
|
||||
$option = new stdClass;
|
||||
|
||||
|
||||
}
|
||||
// Set editor sequence and upload options.
|
||||
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('upload_target_srl', $upload_target_srl);
|
||||
Context::set('editor_sequence', $option->editor_sequence);
|
||||
|
||||
|
||||
// Check that the skin exist.
|
||||
if (!$option->editor_skin)
|
||||
{
|
||||
|
|
@ -173,7 +173,7 @@ class editorModel extends editor
|
|||
Context::set('editor_toolbar', $option->editor_toolbar);
|
||||
Context::set('editor_toolbar_hide', toBool($option->editor_toolbar_hide));
|
||||
Context::set('module_type', $option->module_type);
|
||||
|
||||
|
||||
// Default font setting
|
||||
Context::set('content_font', $option->content_font);
|
||||
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_plugins', $option->additional_plugins);
|
||||
Context::set('editor_remove_plugins', $option->remove_plugins);
|
||||
|
||||
|
||||
// Set the primary key valueof the document or comments
|
||||
Context::set('editor_primary_key_name', $option->primary_key_name);
|
||||
|
||||
|
||||
// Set content column name to sync contents
|
||||
Context::set('editor_content_key_name', $option->content_key_name);
|
||||
|
||||
|
||||
// Set autosave (do not use if the post is edited)
|
||||
$option->enable_autosave = toBool($option->enable_autosave) && !Context::get($option->primary_key_name);
|
||||
if ($option->enable_autosave)
|
||||
|
|
@ -199,12 +199,12 @@ class editorModel extends editor
|
|||
Context::set('saved_doc', self::getSavedDoc($upload_target_srl));
|
||||
}
|
||||
Context::set('enable_autosave', $option->enable_autosave);
|
||||
|
||||
|
||||
// Set allow html and focus
|
||||
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_auto_dark_mode', $option->auto_dark_mode !== 'N');
|
||||
|
||||
|
||||
// Load editor components.
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
// Do not allow chunked uploads in IE < 10, Android browser, and Opera
|
||||
$browser = Rhymix\Framework\UA::getBrowserInfo();
|
||||
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.
|
||||
$tpl_path = Context::get('editor_path');
|
||||
Context::loadLang($tpl_path.'lang');
|
||||
|
||||
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
return $oTemplate->compile($tpl_path, 'editor.html');
|
||||
}
|
||||
|
|
@ -287,7 +287,7 @@ class editorModel extends editor
|
|||
|
||||
// Check mobile status
|
||||
$is_mobile = Mobile::isFromMobilePhone() || \Rhymix\Framework\UA::isMobile();
|
||||
|
||||
|
||||
// Initialize options
|
||||
$option = new stdClass();
|
||||
$option->module_type = $type;
|
||||
|
|
@ -335,7 +335,7 @@ class editorModel extends editor
|
|||
$option->additional_css = $option->additional_mobile_css;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check a group_list of the currently logged-in user for permission check
|
||||
if(Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -346,7 +346,7 @@ class editorModel extends editor
|
|||
{
|
||||
$group_list = array();
|
||||
}
|
||||
|
||||
|
||||
// Permission check for file upload
|
||||
if($module_srl)
|
||||
{
|
||||
|
|
@ -367,7 +367,7 @@ class editorModel extends editor
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Permission check for using default components
|
||||
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
|
||||
if($logged_info->is_admin === 'Y' || !count($option->enable_component_grant))
|
||||
{
|
||||
|
|
@ -403,7 +403,7 @@ class editorModel extends editor
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// HTML editing privileges
|
||||
if($logged_info->is_admin === 'Y' || !count($option->enable_html_grant))
|
||||
{
|
||||
|
|
@ -421,7 +421,7 @@ class editorModel extends editor
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Other settings
|
||||
$option->primary_key_name = $primary_key_name;
|
||||
$option->content_key_name = $content_key_name;
|
||||
|
|
@ -468,7 +468,7 @@ class editorModel extends editor
|
|||
{
|
||||
$saved_doc = array_first($saved_doc);
|
||||
}
|
||||
|
||||
|
||||
// Return null if certify key does not match
|
||||
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_mtime = filemtime($xml_file);
|
||||
$lang_type = Context::getLangType();
|
||||
|
||||
|
||||
// Get from cache
|
||||
$cache_key = sprintf('editor:component:%s:%s:%d', $component, $lang_type, $xml_mtime);
|
||||
$info = Rhymix\Framework\Cache::get($cache_key);
|
||||
|
|
@ -691,15 +691,15 @@ class editorModel extends editor
|
|||
{
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
// Parse XML file
|
||||
$info = Rhymix\Framework\Parsers\EditorComponentParser::loadXML($xml_file, $component, $lang_type);
|
||||
|
||||
|
||||
// Set to cache and return
|
||||
Rhymix\Framework\Cache::set($cache_key, $info, 0, true);
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return converted content
|
||||
* @param object $obj
|
||||
|
|
@ -709,7 +709,7 @@ class editorModel extends editor
|
|||
{
|
||||
$converter = null;
|
||||
$config = self::getEditorConfig($obj->module_srl);
|
||||
|
||||
|
||||
// Get editor skin
|
||||
if (in_array($type, array('document', 'comment')))
|
||||
{
|
||||
|
|
@ -720,13 +720,13 @@ class editorModel extends editor
|
|||
$converter = $obj->converter;
|
||||
$skin = $obj->editor_skin ?: $config->editor_skin;
|
||||
}
|
||||
|
||||
|
||||
// if not inserted converter, Get converter from skin
|
||||
if (!$converter)
|
||||
{
|
||||
$converter = self::getSkinConfig($skin)->converter;
|
||||
}
|
||||
|
||||
|
||||
// if not inserted converter, Check
|
||||
if (!$converter)
|
||||
{
|
||||
|
|
@ -743,7 +743,7 @@ class editorModel extends editor
|
|||
$converter = 'nl2br';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Convert
|
||||
if ($converter)
|
||||
{
|
||||
|
|
@ -751,13 +751,13 @@ class editorModel extends editor
|
|||
{
|
||||
// Remove Tag
|
||||
$obj->content = strip_tags($obj->content);
|
||||
|
||||
|
||||
// Trim space
|
||||
$obj->content = utf8_trim($obj->content);
|
||||
|
||||
|
||||
// Escape
|
||||
$obj->content = escape($obj->content, false);
|
||||
|
||||
|
||||
// Insert HTML line
|
||||
$obj->content = nl2br($obj->content);
|
||||
}
|
||||
|
|
@ -778,7 +778,7 @@ class editorModel extends editor
|
|||
$obj->content = nl2br($obj->content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $obj->content;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class editorView extends editor
|
|||
$parent_input_id = Context::get('parent_input_id');
|
||||
Context::set('parent_input_id', preg_replace('/[^a-z0-9_]/i', '', $parent_input_id));
|
||||
Context::addBodyClass('disable_debug_panel');
|
||||
|
||||
|
||||
// Load editor
|
||||
$oEditorModel = getModel('editor');
|
||||
$option = $oEditorModel->getEditorConfig();
|
||||
|
|
@ -40,7 +40,7 @@ class editorView extends editor
|
|||
$option->editor_focus = 'Y';
|
||||
$editor = $oEditorModel->getEditor(0, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
|
||||
// Set template
|
||||
$this->setLayoutPath('./common/tpl/');
|
||||
$this->setLayoutFile("default_layout");
|
||||
|
|
@ -124,7 +124,7 @@ class editorView extends editor
|
|||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new BaseObject();
|
||||
}
|
||||
|
||||
|
||||
// Get editors settings
|
||||
$oEditorModel = getModel('editor');
|
||||
$editor_config = $oEditorModel->getEditorConfig($current_module_srl);
|
||||
|
|
@ -151,7 +151,7 @@ class editorView extends editor
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin);
|
||||
foreach ($skin_info->colorset ?: [] as $colorset)
|
||||
{
|
||||
|
|
@ -162,7 +162,7 @@ class editorView extends editor
|
|||
|
||||
Context::set('editor_config', $editor_config);
|
||||
Context::set('editor_skin_list', $editor_skin_list);
|
||||
|
||||
|
||||
// Get a group list
|
||||
$group_list = MemberModel::getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
|
@ -195,7 +195,7 @@ class editorView extends editor
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest();
|
||||
}
|
||||
|
||||
|
||||
$skin_info = ModuleModel::loadSkinInfo($this->module_path,$skin);
|
||||
$colorset = $skin_info->colorset ?? null;
|
||||
Context::set('colorset', $colorset);
|
||||
|
|
@ -204,7 +204,7 @@ class editorView extends editor
|
|||
function dispEditorConfigPreview()
|
||||
{
|
||||
Context::set('editor', getModel('editor')->getModuleEditor(Context::get('type'), 0, 0, 'dummy_key', 'dummy_content'));
|
||||
|
||||
|
||||
$this->setLayoutFile('default_layout');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('config_preview');
|
||||
|
|
|
|||
|
|
@ -43,16 +43,16 @@ class installAdminController extends install
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Session::close();
|
||||
|
||||
|
||||
$output = $oModule->moduleUpdate();
|
||||
if($output instanceof BaseObject && !$output->toBool())
|
||||
{
|
||||
Rhymix\Framework\Session::start();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$oModuleController = getController('module');
|
||||
$output = $oModuleController->registerActionForwardRoutes($module_name);
|
||||
if($output instanceof BaseObject && !$output->toBool())
|
||||
|
|
@ -60,7 +60,7 @@ class installAdminController extends install
|
|||
Rhymix\Framework\Session::start();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Session::start();
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class install extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +28,7 @@ class install extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class installController extends install
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_already_installed');
|
||||
}
|
||||
|
||||
|
||||
// Increase time limit.
|
||||
@set_time_limit(0);
|
||||
}
|
||||
|
|
@ -31,13 +31,13 @@ class installController extends install
|
|||
{
|
||||
// Get DB config variables.
|
||||
$config = Context::gets('db_type', 'db_host', 'db_port', 'db_user', 'db_pass', 'db_database', 'db_prefix');
|
||||
|
||||
|
||||
// Disallow installation using the root account.
|
||||
if (trim($config->db_user) === 'root' && !preg_match('/Development Server$/', $_SERVER['SERVER_SOFTWARE']))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_dbroot_disallowed');
|
||||
}
|
||||
|
||||
|
||||
// Create a temporary setting object.
|
||||
Rhymix\Framework\Config::set('db.master', array(
|
||||
'type' => $config->db_type,
|
||||
|
|
@ -48,7 +48,7 @@ class installController extends install
|
|||
'database' => $config->db_database,
|
||||
'prefix' => $config->db_prefix ? (rtrim($config->db_prefix, '_') . '_') : '',
|
||||
));
|
||||
|
||||
|
||||
// Check connection to the DB.
|
||||
$oDB = DB::getInstance();
|
||||
$output = $oDB->getError();
|
||||
|
|
@ -56,7 +56,7 @@ class installController extends install
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Check MySQL server capabilities.
|
||||
if(stripos($config->db_type, 'mysql') !== false)
|
||||
{
|
||||
|
|
@ -70,12 +70,12 @@ class installController extends install
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if utf8mb4 is supported.
|
||||
$oDB->charset = $oDB->getBestSupportedCharset();
|
||||
$config->db_charset = $oDB->charset;
|
||||
}
|
||||
|
||||
|
||||
// Check if tables already exist.
|
||||
$table_check = array('documents', 'comments', 'modules', 'sites');
|
||||
foreach ($table_check as $table_name)
|
||||
|
|
@ -85,10 +85,10 @@ class installController extends install
|
|||
throw new Rhymix\Framework\Exception('msg_table_already_exists');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Save DB config in session.
|
||||
$_SESSION['db_config'] = $config;
|
||||
|
||||
|
||||
// Continue the installation.
|
||||
if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON')))
|
||||
{
|
||||
|
|
@ -107,7 +107,7 @@ class installController extends install
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_already_installed');
|
||||
}
|
||||
|
||||
|
||||
// Get install parameters.
|
||||
$config = Rhymix\Framework\Config::getDefaults();
|
||||
if ($install_config)
|
||||
|
|
@ -147,23 +147,23 @@ class installController extends install
|
|||
$time_zone = Context::get('time_zone');
|
||||
$user_info = Context::gets('email_address', 'password', 'nick_name', 'user_id');
|
||||
}
|
||||
|
||||
|
||||
// Fix the database table prefix.
|
||||
$config['db']['master']['prefix'] = rtrim($config['db']['master']['prefix'], '_');
|
||||
if ($config['db']['master']['prefix'] !== '')
|
||||
{
|
||||
$config['db']['master']['prefix'] .= '_';
|
||||
}
|
||||
|
||||
|
||||
// Create new crypto keys.
|
||||
$config['crypto']['encryption_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');
|
||||
|
||||
|
||||
// Set the default language.
|
||||
$config['locale']['default_lang'] = Context::getLangType();
|
||||
$config['locale']['enabled_lang'] = array($config['locale']['default_lang']);
|
||||
|
||||
|
||||
// Set the default time zone.
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set the internal time zone.
|
||||
if ($config['locale']['default_timezone'] === 'Asia/Seoul')
|
||||
{
|
||||
|
|
@ -197,24 +197,24 @@ class installController extends install
|
|||
{
|
||||
$config['locale']['internal_timezone'] = 0;
|
||||
}
|
||||
|
||||
|
||||
// Set the default URL.
|
||||
$config['url']['default'] = Context::getRequestUri();
|
||||
|
||||
|
||||
// Set the default umask.
|
||||
$config['file']['umask'] = Rhymix\Framework\Storage::recommendUmask();
|
||||
|
||||
|
||||
// Load the new configuration.
|
||||
Rhymix\Framework\Config::setAll($config);
|
||||
Context::loadDBInfo($config);
|
||||
|
||||
|
||||
// Check DB.
|
||||
$oDB = DB::getInstance();
|
||||
if (!$oDB->isConnected())
|
||||
{
|
||||
return $oDB->getError();
|
||||
}
|
||||
|
||||
|
||||
// Assign a temporary administrator while installing.
|
||||
foreach ($user_info as $key => $val)
|
||||
{
|
||||
|
|
@ -222,7 +222,7 @@ class installController extends install
|
|||
}
|
||||
$user_info->is_admin = 'Y';
|
||||
Context::set('logged_info', $user_info);
|
||||
|
||||
|
||||
// Install all the modules.
|
||||
try
|
||||
{
|
||||
|
|
@ -235,7 +235,7 @@ class installController extends install
|
|||
$oDB->rollback();
|
||||
throw new Rhymix\Framework\Exception($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
// Execute the install script.
|
||||
$scripts = FileHandler::readDir(RX_BASEDIR . 'modules/install/script', '/(\.php)$/');
|
||||
if(count($scripts))
|
||||
|
|
@ -247,7 +247,7 @@ class installController extends install
|
|||
$output = include($script_path . $script);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Apply site lock.
|
||||
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.allow', array('127.0.0.1', $user_ip_range));
|
||||
}
|
||||
|
||||
|
||||
// Use APC cache if available.
|
||||
if (function_exists('apcu_exists'))
|
||||
{
|
||||
Rhymix\Framework\Config::set('cache.type', 'apc');
|
||||
}
|
||||
|
||||
|
||||
// Save the new configuration.
|
||||
Rhymix\Framework\Config::save();
|
||||
|
||||
|
||||
// Unset temporary session variables.
|
||||
unset($_SESSION['use_rewrite']);
|
||||
unset($_SESSION['db_config']);
|
||||
|
||||
|
||||
// Redirect to the home page.
|
||||
$this->setMessage('msg_install_completed');
|
||||
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : RX_BASEURL;
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
return new BaseObject();
|
||||
|
|
@ -315,13 +315,13 @@ class installController extends install
|
|||
{
|
||||
$checklist['permission'] = false;
|
||||
}
|
||||
|
||||
|
||||
// Check session availability
|
||||
$license_agreement_time = intval(trim(FileHandler::readFile($this->flagLicenseAgreement)));
|
||||
if(isset($_SESSION['license_agreement']) && (!$license_agreement_time || ($license_agreement_time == $_SESSION['license_agreement'])))
|
||||
{
|
||||
$sess_autostart = intval(ini_get('session.auto_start'));
|
||||
|
||||
|
||||
if($sess_autostart === 0)
|
||||
{
|
||||
$checklist['session'] = true;
|
||||
|
|
@ -425,7 +425,7 @@ class installController extends install
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_must_accept_license_agreement');
|
||||
}
|
||||
|
||||
|
||||
$license_agreement_time = time();
|
||||
$_SESSION['license_agreement'] = $license_agreement_time;
|
||||
FileHandler::writeFile($this->flagLicenseAgreement, $license_agreement_time . PHP_EOL);
|
||||
|
|
@ -465,13 +465,13 @@ class installController extends install
|
|||
{
|
||||
// Get module name
|
||||
$module = basename($module_path);
|
||||
|
||||
|
||||
// Only install default modules at this time
|
||||
if (!Context::isDefaultPlugin($module, 'module'))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Try to group modules by category
|
||||
$xml_info = ModuleModel::getModuleInfoXml($module);
|
||||
if (!$xml_info)
|
||||
|
|
@ -480,14 +480,14 @@ class installController extends install
|
|||
}
|
||||
$modules[$xml_info->category ?: 'other'][] = $module;
|
||||
}
|
||||
|
||||
|
||||
// Install "module" module in advance
|
||||
$this->installModule('module','./modules/module');
|
||||
$this->updateModule('module');
|
||||
|
||||
|
||||
// Determine the order of module installation depending on category
|
||||
$install_step = array('system','content','member');
|
||||
|
||||
|
||||
// Install all the remaining modules
|
||||
foreach($install_step as $category)
|
||||
{
|
||||
|
|
@ -502,7 +502,7 @@ class installController extends install
|
|||
unset($modules[$category]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Install all the remaining modules
|
||||
if(count($modules))
|
||||
{
|
||||
|
|
@ -544,16 +544,16 @@ class installController extends install
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$table_name = $matches[1];
|
||||
if(isset($schema_sorted[$table_name]) || $oDB->isTableExists($table_name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$schema_sorted[$table_name] = $filename;
|
||||
}
|
||||
|
||||
|
||||
$schema_sorted = Rhymix\Framework\Parsers\DBTableParser::resolveDependency($schema_sorted);
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create a table and module instance and then execute install() method
|
||||
$oModule = ModuleModel::getModuleInstallClass($module);
|
||||
if($oModule && method_exists($oModule, 'moduleInstall'))
|
||||
|
|
@ -572,10 +572,10 @@ class installController extends install
|
|||
}
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update a module if necessary.
|
||||
*
|
||||
*
|
||||
* @param string $module
|
||||
* @return mixed
|
||||
*/
|
||||
|
|
@ -590,10 +590,10 @@ class installController extends install
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Placeholder for third-party apps that try to manipulate system configuration.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function makeConfigFile()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class installModel extends install
|
|||
|
||||
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');
|
||||
}
|
||||
|
|
@ -57,17 +57,17 @@ class installModel extends install
|
|||
if(!$connection) return $this->setError(sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
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');
|
||||
}
|
||||
|
||||
if($ftp_info->ftp_pasv != "N")
|
||||
if($ftp_info->ftp_pasv != "N")
|
||||
{
|
||||
ftp_pasv($connection, true);
|
||||
}
|
||||
|
||||
$_list = ftp_rawlist($connection, $this->pwd);
|
||||
ftp_close($connection);
|
||||
ftp_close($connection);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -92,7 +92,7 @@ class installModel extends install
|
|||
{
|
||||
foreach($_list as $k => $v)
|
||||
{
|
||||
$src = new stdClass();
|
||||
$src = new stdClass();
|
||||
$src->data = $v;
|
||||
$res = Context::convertEncoding($src);
|
||||
$v = $res->data;
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@ class installView extends install
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_already_installed');
|
||||
}
|
||||
|
||||
|
||||
// Set the browser title.
|
||||
Context::setBrowserTitle(lang('introduce_title'));
|
||||
|
||||
|
||||
// Specify the template path.
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
|
||||
|
||||
// Check the environment.
|
||||
$oInstallController = getController('install');
|
||||
self::$checkEnv = $oInstallController->checkInstallEnv();
|
||||
|
|
@ -46,7 +46,7 @@ class installView extends install
|
|||
if (file_exists(RX_BASEDIR . 'config/install.config.php'))
|
||||
{
|
||||
include RX_BASEDIR . 'config/install.config.php';
|
||||
|
||||
|
||||
if (isset($install_config) && is_array($install_config))
|
||||
{
|
||||
$oInstallController = getController('install');
|
||||
|
|
@ -61,7 +61,7 @@ class installView extends install
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Otherwise, display the license agreement screen.
|
||||
Context::set('lang_type', Context::getLangType());
|
||||
$this->setTemplateFile('license_agreement');
|
||||
|
|
@ -75,7 +75,7 @@ class installView extends install
|
|||
// Create a temporary file for mod_rewrite check.
|
||||
self::$rewriteCheckString = Rhymix\Framework\Security::getRandom(32);
|
||||
FileHandler::writeFile(RX_BASEDIR . self::$rewriteCheckFilePath, self::$rewriteCheckString);
|
||||
|
||||
|
||||
// Check if the web server is nginx.
|
||||
Context::set('use_nginx', stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false);
|
||||
$this->setTemplateFile('check_env');
|
||||
|
|
@ -91,16 +91,16 @@ class installView extends install
|
|||
{
|
||||
return $this->dispInstallCheckEnv();
|
||||
}
|
||||
|
||||
|
||||
// Delete mod_rewrite check file
|
||||
FileHandler::removeFile(RX_BASEDIR . self::$rewriteCheckFilePath);
|
||||
|
||||
|
||||
// Save mod_rewrite check status.
|
||||
if(Context::get('rewrite') === 'Y')
|
||||
{
|
||||
Context::set('use_rewrite', $_SESSION['use_rewrite'] = 'Y');
|
||||
}
|
||||
|
||||
|
||||
Context::set('error_return_url', getNotEncodedUrl('', 'act', Context::get('act')));
|
||||
$this->setTemplateFile('db_config');
|
||||
}
|
||||
|
|
@ -115,19 +115,19 @@ class installView extends install
|
|||
{
|
||||
return $this->dispInstallCheckEnv();
|
||||
}
|
||||
|
||||
|
||||
// Get list of time zones.
|
||||
Context::set('timezones', Rhymix\Framework\DateTime::getTimezoneList());
|
||||
|
||||
|
||||
// Automatically select a time zone for the user.
|
||||
Context::set('selected_timezone', $this->detectUserTimeZone());
|
||||
|
||||
|
||||
// Always use SSL if installing via SSL.
|
||||
Context::set('use_ssl', RX_SSL ? 'always' : 'none');
|
||||
Context::set('sitelock_ip_range', $this->detectUserIPRange());
|
||||
$this->setTemplateFile('other_config');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Detect the IP range of the user.
|
||||
*/
|
||||
|
|
@ -148,7 +148,7 @@ class installView extends install
|
|||
return RX_CLIENT_IP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Detect best time zone for the user.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class layoutAdminController extends layout
|
|||
/**
|
||||
* Create a new layout
|
||||
* Insert a title into "layouts" table in order to create a layout
|
||||
* @deprecated
|
||||
* @deprecated
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
*/
|
||||
function procLayoutAdminInsert()
|
||||
|
|
@ -65,7 +65,7 @@ class layoutAdminController extends layout
|
|||
* Initiate if it is faceoff layout
|
||||
* @param int $layout_srl
|
||||
* @param string $layout_name
|
||||
* @return void
|
||||
* @return void
|
||||
*/
|
||||
function initLayout($layout_srl, $layout_name)
|
||||
{
|
||||
|
|
@ -278,12 +278,12 @@ class layoutAdminController extends layout
|
|||
|
||||
$layout_file = $oLayoutModel->getUserLayoutHtml($layout_srl);
|
||||
FileHandler::removeFile($layout_file);
|
||||
|
||||
|
||||
// Delete Layout
|
||||
$args = new stdClass();
|
||||
$args->layout_srl = $layout_srl;
|
||||
$output = executeQuery("layout.deleteLayout", $args);
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete('layout:' . $args->layout_srl);
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -390,7 +390,7 @@ class layoutAdminController extends layout
|
|||
$ext = substr(strrchr($filename,'.'),1);
|
||||
$filename = sprintf('%s.%s', md5($filename), $ext);
|
||||
}
|
||||
|
||||
|
||||
if(file_exists($path .'/'. $filename)) @unlink($path . $filename);
|
||||
if(!move_uploaded_file($source['tmp_name'], $path . $filename )) return false;
|
||||
return true;
|
||||
|
|
@ -693,7 +693,7 @@ class layoutAdminController extends layout
|
|||
$args->extra_vars = $output->extra_vars;
|
||||
$extra_vars = unserialize($args->extra_vars);
|
||||
$image_list = array();
|
||||
|
||||
|
||||
if($layout->extra_var_count && $extra_vars)
|
||||
{
|
||||
$reg = "/^.\/files\/attach\/images\/([0-9]+)\/(.*)/";
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class layoutAdminView extends layout
|
|||
$layout_info = $oLayoutModel->getLayoutInfo($item->layout, null, $type);
|
||||
if ($layout_info)
|
||||
{
|
||||
$layout_list[$item->layout]['title'] = $layout_info->title;
|
||||
$layout_list[$item->layout]['title'] = $layout_info->title;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* @class layout
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* high class of the layout module
|
||||
* high class of the layout module
|
||||
*/
|
||||
class layout extends ModuleObject
|
||||
{
|
||||
|
|
@ -13,7 +13,7 @@ class layout extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +31,7 @@ class layout extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -40,7 +40,7 @@ class layout extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/* End of file layout.class.php */
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class layoutModel extends layout
|
|||
unset($output->data[$no]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oLayoutAdminModel = getAdminModel('layout');
|
||||
$siteDefaultLayoutSrl = $oLayoutAdminModel->getSiteDefaultLayout($layout_type);
|
||||
if($siteDefaultLayoutSrl)
|
||||
|
|
@ -64,7 +64,7 @@ class layoutModel extends layout
|
|||
$responsiveLayoutInfo->title = lang('use_responsive_pc_layout');
|
||||
array_unshift($output->data, $responsiveLayoutInfo);
|
||||
}
|
||||
|
||||
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ class layoutModel extends layout
|
|||
$titleList[$dLayoutInfo->layout] = $dLayoutInfo->title;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($layout)
|
||||
{
|
||||
if(count($instanceList) < 1 && $downloadedList[$layout])
|
||||
|
|
@ -265,7 +265,7 @@ class layoutModel extends layout
|
|||
{
|
||||
return $layout_info;
|
||||
}
|
||||
|
||||
|
||||
// Get information from the DB
|
||||
$args = new stdClass();
|
||||
$args->layout_srl = $layout_srl;
|
||||
|
|
@ -589,7 +589,7 @@ class layoutModel extends layout
|
|||
|
||||
$count = count($extra_vars);
|
||||
$extra_var_count += $count;
|
||||
|
||||
|
||||
for($i=0;$i<$count;$i++)
|
||||
{
|
||||
unset($var, $options);
|
||||
|
|
@ -680,7 +680,7 @@ class layoutModel extends layout
|
|||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
|
||||
|
||||
|
||||
$extra_var_count = 0;
|
||||
$buff[] = '$layout_info->extra_var = new stdClass;';
|
||||
foreach($extra_var_groups as $group)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class layoutView extends layout
|
|||
|
||||
/**
|
||||
* Preview a layout with module.
|
||||
*
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
public function dispLayoutPreviewWithModule()
|
||||
|
|
@ -260,7 +260,7 @@ class layoutView extends layout
|
|||
{
|
||||
throw new Rhymix\Framework\Exception(lang('msg_unabled_preview'));
|
||||
}
|
||||
|
||||
|
||||
$mid = current($output->data)->mid;
|
||||
}
|
||||
|
||||
|
|
@ -397,7 +397,7 @@ class layoutView extends layout
|
|||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -413,7 +413,7 @@ class layoutView extends layout
|
|||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change the menu design (layout)
|
||||
*/
|
||||
|
|
@ -253,7 +253,7 @@ class menuAdminController extends menu
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass;
|
||||
$args->menu_srl = $menu_srl;
|
||||
$output = executeQueryArray('layout.getLayoutModules', $args);
|
||||
|
|
@ -285,7 +285,7 @@ class menuAdminController extends menu
|
|||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::clearGroup('site_and_module');
|
||||
}
|
||||
}
|
||||
|
|
@ -1653,10 +1653,10 @@ class menuAdminController extends menu
|
|||
$oModuleModel = getModel('module');
|
||||
//$info = $oModuleModel->getModuleInfoXml($moduleName);
|
||||
$info = $oModuleModel->getModuleActionXml($moduleName);
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->url = 'index.php?module=admin';
|
||||
|
||||
|
||||
if($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->menu_item_srl = (!$requestArgs->menu_item_srl) ? getNextSequence() : $requestArgs->menu_item_srl;
|
||||
$args->parent_srl = $requestArgs->parent_srl;
|
||||
$args->menu_srl = $requestArgs->menu_srl;
|
||||
|
|
@ -1730,7 +1730,7 @@ class menuAdminController extends menu
|
|||
{
|
||||
$exposure = implode(',', $exposure);
|
||||
}
|
||||
|
||||
|
||||
if(in_array($exposure, array('-1','-3')))
|
||||
{
|
||||
$args->group_srls = $exposure;
|
||||
|
|
@ -1835,7 +1835,7 @@ class menuAdminController extends menu
|
|||
FileHandler::writeFile($xml_file, '<root />');
|
||||
FileHandler::writeFile($php_file, '<?php if(!defined("__XE__")) exit(); ?>');
|
||||
return $xml_file;
|
||||
}
|
||||
}
|
||||
$site_srl = 0;
|
||||
$domain = null;
|
||||
|
||||
|
|
@ -1947,7 +1947,7 @@ class menuAdminController extends menu
|
|||
{
|
||||
$child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
|
||||
}
|
||||
|
||||
|
||||
// List variables
|
||||
$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
|
||||
$name_arr_str = '';
|
||||
|
|
@ -1976,11 +1976,11 @@ class menuAdminController extends menu
|
|||
$normal_btn = strval($node->normal_btn);
|
||||
if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = escape($normal_btn);
|
||||
else $normal_btn = '';
|
||||
|
||||
|
||||
$hover_btn = strval($node->hover_btn);
|
||||
if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = escape($hover_btn);
|
||||
else $hover_btn = '';
|
||||
|
||||
|
||||
$active_btn = strval($node->active_btn);
|
||||
if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = escape($active_btn);
|
||||
else $active_btn = '';
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ class menuAdminModel extends menu
|
|||
$menu_info->php_file = sprintf('./files/cache/menu/%d.php',$menu_srl);
|
||||
return $menu_info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get actual menu info data
|
||||
*
|
||||
*
|
||||
* @param int $menu_srl
|
||||
* @return object
|
||||
*/
|
||||
|
|
@ -85,7 +85,7 @@ class menuAdminModel extends menu
|
|||
{
|
||||
$menu = new stdClass;
|
||||
$menu->list = [];
|
||||
|
||||
|
||||
$filename = sprintf('./files/cache/menu/%d.php', $menu_srl);
|
||||
if (!FileHandler::exists($filename))
|
||||
{
|
||||
|
|
@ -95,7 +95,7 @@ class menuAdminModel extends menu
|
|||
{
|
||||
include $filename;
|
||||
}
|
||||
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
|
|
@ -350,7 +350,7 @@ class menuAdminModel extends menu
|
|||
|
||||
$oAutoinstallAdminModel = getAdminModel('autoinstall');
|
||||
$config = $oAutoinstallAdminModel->getAutoInstallAdminModuleConfig();
|
||||
|
||||
|
||||
foreach($_allModules as $module_name)
|
||||
{
|
||||
$module = $oModuleModel->getModuleInfoXml($module_name);
|
||||
|
|
@ -489,7 +489,7 @@ class menuAdminModel extends menu
|
|||
$oModuleModel = getModel('module');
|
||||
$oMenuAdminController = getAdminController('menu');
|
||||
$columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl');
|
||||
|
||||
|
||||
$start_module_list = executeQuery('module.getDomainInfo', new stdClass);
|
||||
$start_module = $start_module_list->data;
|
||||
|
||||
|
|
@ -503,7 +503,7 @@ class menuAdminModel extends menu
|
|||
{
|
||||
include($php_file);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$oMenuAdminController->makeXmlFile($menuSrl);
|
||||
}
|
||||
|
|
@ -663,7 +663,7 @@ class menuAdminModel extends menu
|
|||
{
|
||||
$start_module = $start_module ? array($start_module) : array();
|
||||
}
|
||||
|
||||
|
||||
// if url is empty and is_shortcut is 'N', change to is_shortcut 'Y'
|
||||
if(!$menu['url'] && $menu['is_shortcut'] == 'N')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class menuAdminView extends menu
|
|||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Site map admin menu index page
|
||||
* @return void
|
||||
|
|
@ -40,7 +40,7 @@ class menuAdminView extends menu
|
|||
$oMenuController = getAdminController('menu');
|
||||
$oMenuController->linkAllModuleInstancesToSitemap();
|
||||
}
|
||||
|
||||
|
||||
// get installed module list
|
||||
$oPageController = getController('page'); //for lang
|
||||
$oMenuAdminModel = getAdminModel('menu');
|
||||
|
|
@ -79,7 +79,7 @@ class menuAdminView extends menu
|
|||
}
|
||||
}
|
||||
Context::set('group_list', $groupList);
|
||||
|
||||
|
||||
// Get layout instance list
|
||||
$oLayoutModel = getModel('layout');
|
||||
$layouts_P = $oLayoutModel->getLayoutList(0, 'P') ?: [];
|
||||
|
|
|
|||
|
|
@ -27,19 +27,19 @@ class menu extends ModuleObject
|
|||
function checkUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
|
||||
// 2015. 06. 15 add column desc
|
||||
if(!$oDB->isColumnExists('menu_item', 'desc'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 2021. 01. 20 add column icon
|
||||
if(!$oDB->isColumnExists('menu_item', 'icon'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -50,13 +50,13 @@ class menu extends ModuleObject
|
|||
function moduleUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
|
||||
// 2015. 06. 15 add column desc
|
||||
if(!$oDB->isColumnExists('menu_item', 'desc'))
|
||||
{
|
||||
$oDB->addColumn('menu_item', 'desc', 'varchar', 250, null, false, 'name');
|
||||
}
|
||||
|
||||
|
||||
// 2021. 01. 20 add column icon
|
||||
if(!$oDB->isColumnExists('menu_item', 'icon'))
|
||||
{
|
||||
|
|
@ -116,4 +116,4 @@ class menu extends ModuleObject
|
|||
}
|
||||
}
|
||||
/* End of file menu.class.php */
|
||||
/* Location: ./modules/menu/menu.class.php */
|
||||
/* Location: ./modules/menu/menu.class.php */
|
||||
|
|
|
|||
|
|
@ -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->setTemplateFile('menu.html');
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Message extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
class MessageMobile extends MessageView
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
/* End of file message.mobile.php */
|
||||
/* Location: ./modules/message/message.mobile.php */
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class MessageView extends Message
|
|||
{
|
||||
$config->mskin = 'default';
|
||||
}
|
||||
|
||||
|
||||
// Set the template path
|
||||
if (contains('mobile', get_class($this), false))
|
||||
{
|
||||
|
|
@ -63,13 +63,13 @@ class MessageView extends Message
|
|||
// Get the member configuration
|
||||
$member_config = ModuleModel::getModuleConfig('member');
|
||||
Context::set('member_config', $member_config);
|
||||
|
||||
|
||||
// Disable location if debug not available
|
||||
if (!Rhymix\Framework\Debug::isEnabledForCurrentUser())
|
||||
{
|
||||
$location = null;
|
||||
}
|
||||
|
||||
|
||||
// Remove basedir from location (if any)
|
||||
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_detail', nl2br($detail));
|
||||
Context::set('system_message_location', escape($location));
|
||||
|
||||
|
||||
if ($this->getError())
|
||||
{
|
||||
if ($detail)
|
||||
|
|
@ -94,7 +94,7 @@ class MessageView extends Message
|
|||
}
|
||||
|
||||
$this->setTemplateFile('system_message');
|
||||
|
||||
|
||||
// Default 403 Error
|
||||
if($this->getHttpStatusCode() === 200)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class ncenterliteAdminController extends ncenterlite
|
|||
$config->admin_notify_module_srls = array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($obj->disp_act == 'dispNcenterliteAdminOtherComment')
|
||||
{
|
||||
if(!$obj->comment_all)
|
||||
|
|
@ -116,7 +116,7 @@ class ncenterliteAdminController extends ncenterlite
|
|||
$config->notify_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$output = $oModuleController->insertModuleConfig('ncenterlite', $config);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
|
|
@ -203,7 +203,7 @@ class ncenterliteAdminController extends ncenterlite
|
|||
}
|
||||
|
||||
$this->setMessage('msg_test_notifycation_success');
|
||||
|
||||
|
||||
if (Context::get('success_return_url'))
|
||||
{
|
||||
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class ncenterliteAdminView extends ncenterlite
|
|||
Context::set('mid_list', $mid_list);
|
||||
Context::set('config', $config);
|
||||
}
|
||||
|
||||
|
||||
function dispNcenterliteAdminOtherComment()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class ncenterlite extends ModuleObject
|
|||
|
||||
function moduleInstall()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
function checkUpdate()
|
||||
|
|
@ -93,7 +93,7 @@ class ncenterlite extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// #1903 #1906
|
||||
foreach(['target_browser', 'target_summary'] as $column_name)
|
||||
{
|
||||
|
|
@ -103,7 +103,7 @@ class ncenterlite extends ModuleObject
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// PK duplicate
|
||||
if($oDB->isIndexExists('ncenterlite_notify', 'idx_notify'))
|
||||
{
|
||||
|
|
@ -114,7 +114,7 @@ class ncenterlite extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if($oDB->isColumnExists('ncenterlite_user_set','custom_notify'))
|
||||
{
|
||||
return true;
|
||||
|
|
@ -182,7 +182,7 @@ class ncenterlite extends ModuleObject
|
|||
{
|
||||
$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)
|
||||
{
|
||||
if(!$oDB->isIndexExists('ncenterlite_notify', $index_name))
|
||||
|
|
@ -219,13 +219,13 @@ class ncenterlite extends ModuleObject
|
|||
{
|
||||
$oDB->dropColumn('ncenterlite_user_set', 'custom_notify');
|
||||
}
|
||||
|
||||
|
||||
// Composite index to speed up getNotifyList
|
||||
if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_member_srl_and_readed'))
|
||||
{
|
||||
$oDB->addIndex('ncenterlite_notify', 'idx_member_srl_and_readed', array('member_srl', 'readed'));
|
||||
}
|
||||
|
||||
|
||||
// #1903 #1906
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// PK duplicate
|
||||
if($oDB->isIndexExists('ncenterlite_notify', 'idx_notify'))
|
||||
{
|
||||
|
|
@ -309,7 +309,7 @@ class ncenterlite extends ModuleObject
|
|||
{
|
||||
return $oSmsHandler;
|
||||
}
|
||||
|
||||
|
||||
$variable_name = array();
|
||||
$member_config = getModel('member')->getMemberConfig();
|
||||
foreach($member_config->signupForm as $value)
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ class ncenterliteController extends ncenterlite
|
|||
'dispNcenterliteNotifyList' => true,
|
||||
'dispEditorFrame' => true,
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Send any message to a member.
|
||||
*
|
||||
*
|
||||
* @param int $from_member_srl Sender
|
||||
* @param int $to_member_srl Recipient
|
||||
* @param string|object $message Message content
|
||||
|
|
@ -36,7 +36,7 @@ class ncenterliteController extends ncenterlite
|
|||
$args->target_browser = '';
|
||||
$args->target_summary = '';
|
||||
$args->target_content = null;
|
||||
|
||||
|
||||
if (is_object($message))
|
||||
{
|
||||
$args->target_body = $message->subject;
|
||||
|
|
@ -48,7 +48,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$args->target_body = $message;
|
||||
}
|
||||
|
||||
|
||||
$output = $this->_insertNotify($args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
|
|
@ -152,7 +152,7 @@ class ncenterliteController extends ncenterlite
|
|||
$this->setRedirectUrl(getNotEncodedUrl('act', 'dispNcenterliteUserConfig', 'member_srl', $member_srl));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function procNcenterliteInsertUnsubscribe()
|
||||
{
|
||||
$config = NcenterliteModel::getConfig();
|
||||
|
|
@ -164,19 +164,19 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_unsubscribe_block_not_support');
|
||||
}
|
||||
|
||||
|
||||
$obj = Context::getRequestVars();
|
||||
|
||||
|
||||
if(!$this->user->member_srl || (!intval($obj->unsubscribe_srl) && !intval($obj->target_srl)))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
if($obj->target_srl)
|
||||
{
|
||||
$oNcenterliteModel = getModel('ncenterlite');
|
||||
$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($userBlockData)
|
||||
{
|
||||
|
|
@ -184,24 +184,24 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$obj->unsubscribe_srl = $userBlockData->unsubscribe_srl;
|
||||
}
|
||||
|
||||
|
||||
if (intval($obj->unsubscribe_srl) != intval($userBlockData->unsubscribe_srl))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!$userBlockData && $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.
|
||||
if(intval($this->user->member_srl) != intval($userBlockData->member_srl))
|
||||
{
|
||||
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($userBlockData)
|
||||
{
|
||||
|
|
@ -209,19 +209,19 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$obj->target_srl = $userBlockData->target_srl;
|
||||
}
|
||||
|
||||
|
||||
if (intval($obj->target_srl) != intval($userBlockData->target_srl))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($userBlockData)
|
||||
{
|
||||
$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.
|
||||
if($obj->unsubscribe_type == 'document')
|
||||
{
|
||||
|
|
@ -237,7 +237,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $this->user->member_srl;
|
||||
$args->target_srl = $obj->target_srl;
|
||||
|
|
@ -251,7 +251,7 @@ class ncenterliteController extends ncenterlite
|
|||
}
|
||||
$args->unsubscribe_type = $obj->unsubscribe_type;
|
||||
$args->text = $text;
|
||||
|
||||
|
||||
if($obj->value == 'Y')
|
||||
{
|
||||
// 데이터가 있으면 차단, 데이터가 없으면 차단하지 않기 때문에 따로 업데이트를 하지 않는다.
|
||||
|
|
@ -275,7 +275,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_unsubscribe_not_in_list');
|
||||
}
|
||||
|
||||
|
||||
$args->unsubscribe_srl = $obj->unsubscribe_srl;
|
||||
$output = executeQuery('ncenterlite.deleteUnsubscribe', $args);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -329,7 +329,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$this->removeFlagFile($args->member_srl);
|
||||
}
|
||||
|
||||
|
||||
// Delete to user setting.
|
||||
$userSetOutput = executeQuery('ncenterlite.deleteNcenterliteUserSettingData', $args);
|
||||
if(!$userSetOutput->toBool())
|
||||
|
|
@ -436,7 +436,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->config_type = 'comment_all';
|
||||
$args->member_srl = abs($value->member_srl);
|
||||
|
|
@ -461,7 +461,7 @@ class ncenterliteController extends ncenterlite
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$obj->admin_comment_notify = false;
|
||||
$admin_list = $oNcenterliteModel->getMemberAdmins();
|
||||
|
||||
|
|
@ -547,12 +547,12 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if($oNcenterliteModel->getUserUnsubscribeConfigByTargetSrl($parent_srl, $abs_member_srl))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->config_type = 'comment_comment';
|
||||
$args->member_srl = $abs_member_srl;
|
||||
|
|
@ -592,7 +592,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if($config->user_notify_setting == 'Y')
|
||||
{
|
||||
$document_comment_member_config = NcenterliteModel::getUserConfig($abs_member_srl);
|
||||
|
|
@ -673,7 +673,7 @@ class ncenterliteController extends ncenterlite
|
|||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function triggerAfterScrap($obj)
|
||||
{
|
||||
$config = NcenterliteModel::getConfig();
|
||||
|
|
@ -681,7 +681,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if($config->user_notify_setting === 'Y')
|
||||
{
|
||||
$target_member_config = NcenterliteModel::getUserConfig(abs($obj->target_member_srl));
|
||||
|
|
@ -690,10 +690,10 @@ class ncenterliteController extends ncenterlite
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl);
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->config_type = 'scrap';
|
||||
$args->target_member_srl = abs($obj->member_srl);
|
||||
|
|
@ -755,7 +755,7 @@ class ncenterliteController extends ncenterlite
|
|||
$args->module_srl = $obj->module_srl;
|
||||
$this->_insertNotify($args, $config->anonymous_voter !== 'N');
|
||||
}
|
||||
|
||||
|
||||
function triggerAfterDocumentVotedCancel($obj)
|
||||
{
|
||||
$config = NcenterliteModel::getConfig();
|
||||
|
|
@ -771,7 +771,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if($config->anonymous_voter === 'Y')
|
||||
{
|
||||
$member_srl = -1 * $this->user->member_srl;
|
||||
|
|
@ -780,7 +780,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$member_srl = $this->user->member_srl;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->type = $this->_TYPE_DOCUMENT;
|
||||
$args->target_type = $this->_TYPE_VOTED;
|
||||
|
|
@ -792,7 +792,7 @@ class ncenterliteController extends ncenterlite
|
|||
$this->removeFlagFile(abs($obj->member_srl));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function triggerAfterCommentVotedCount($obj)
|
||||
{
|
||||
$config = NcenterliteModel::getConfig();
|
||||
|
|
@ -812,14 +812,14 @@ class ncenterliteController extends ncenterlite
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$oComment = $oCommentModel->getComment($obj->comment_srl);
|
||||
|
||||
|
||||
$content = $oComment->get('content');
|
||||
$document_srl = $oComment->get('document_srl');
|
||||
$module_info = getModel('module')->getModuleInfoByDocumentSrl($document_srl);
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->config_type = 'vote';
|
||||
$args->member_srl = abs($obj->member_srl);
|
||||
|
|
@ -852,7 +852,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->type = $this->_TYPE_COMMENT;
|
||||
$args->target_type = $this->_TYPE_VOTED;
|
||||
|
|
@ -872,7 +872,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$member_srls = ncenterliteModel::getInstance()->getNotifyMemberSrlBySrl($obj->comment_srl);
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -894,7 +894,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$member_srls = ncenterliteModel::getInstance()->getNotifyMemberSrlBySrl($obj->document_srl);
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -1058,23 +1058,23 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 레이아웃에서 알림센터 사용중이라면 중지
|
||||
if(Context::get('layout_info')->use_ncenter_widget == 'Y')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Context::set('ncenterlite_config', $config);
|
||||
|
||||
|
||||
if($config->highlight_effect === 'Y')
|
||||
{
|
||||
Context::loadFile(array('./modules/ncenterlite/tpl/js/ncenterlite.js', 'body', '', 100000));
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$_output = $oNcenterliteModel->getMyNotifyList($logged_info->member_srl);
|
||||
|
||||
|
||||
if($config->always_display !== 'Y')
|
||||
{
|
||||
if(!$_output->data)
|
||||
|
|
@ -1082,7 +1082,7 @@ class ncenterliteController extends ncenterlite
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$_latest_notify_id = array_slice($_output->data, 0, 1);
|
||||
$_latest_notify_id = count($_latest_notify_id) > 0 ? $_latest_notify_id[0]->notify : "";
|
||||
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 . ';" ');
|
||||
}
|
||||
|
||||
|
||||
$result = TemplateHandler::getInstance()->compile($this->template_path, 'ncenterlite.html');
|
||||
$this->_addFile();
|
||||
$output_display = $result . $output_display;
|
||||
|
|
@ -1331,7 +1331,7 @@ class ncenterliteController extends ncenterlite
|
|||
function _insertNotify($args, $anonymous = FALSE)
|
||||
{
|
||||
$config = NcenterliteModel::getConfig();
|
||||
|
||||
|
||||
if(is_array($config->hide_module_srls) && in_array($args->module_srl, $config->hide_module_srls))
|
||||
{
|
||||
return new BaseObject();
|
||||
|
|
@ -1348,7 +1348,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$args->notify = $this->_getNotifyId($args);
|
||||
}
|
||||
|
||||
|
||||
// 날짜가 없는 경우 자동 생성
|
||||
if (!$args->regdate)
|
||||
{
|
||||
|
|
@ -1389,7 +1389,7 @@ class ncenterliteController extends ncenterlite
|
|||
$args->target_user_id = '';
|
||||
$args->target_email_address = '';
|
||||
}
|
||||
|
||||
|
||||
// 수신자가 웹 알림을 거부한 경우 이미 읽은 것으로 처리
|
||||
if($config->user_notify_setting == 'Y')
|
||||
{
|
||||
|
|
@ -1405,7 +1405,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
$output = executeQuery('ncenterlite.insertNotify', $args);
|
||||
if($output->toBool())
|
||||
{
|
||||
|
|
@ -1431,7 +1431,7 @@ class ncenterliteController extends ncenterlite
|
|||
|
||||
$cache_key = sprintf('ncenterlite:notify_list:%d', $member_srl);
|
||||
Rhymix\Framework\Cache::set($cache_key, $output);
|
||||
|
||||
|
||||
$flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($member_srl) . $member_srl . '.php';
|
||||
if (Rhymix\Framework\Cache::getDriverName() !== 'dummy')
|
||||
{
|
||||
|
|
@ -1454,7 +1454,7 @@ class ncenterliteController extends ncenterlite
|
|||
|
||||
$cache_key = sprintf('ncenterlite:notify_list:%d', $member_srl);
|
||||
Rhymix\Framework\Cache::delete($cache_key);
|
||||
|
||||
|
||||
$flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($member_srl) . $member_srl . '.php';
|
||||
if(file_exists($flag_path))
|
||||
{
|
||||
|
|
@ -1479,13 +1479,13 @@ class ncenterliteController extends ncenterlite
|
|||
$oMemberModel = getModel('member');
|
||||
$config = NcenterliteModel::getConfig();
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
||||
// Extract mentions.
|
||||
$content = html_entity_decode(strip_tags($content));
|
||||
preg_match_all('/(?:^|\s)@([^\pC\pM\pP\pS\pZ]+)/u', $content, $matches);
|
||||
$mentions = array_unique($matches[1]);
|
||||
$members = array();
|
||||
|
||||
|
||||
// Find members.
|
||||
foreach ($mentions as $mention)
|
||||
{
|
||||
|
|
@ -1493,12 +1493,12 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (count($members) >= $config->mention_limit)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ($config->mention_suffix_always_cut != 'Y')
|
||||
{
|
||||
if ($config->mention_names === 'id')
|
||||
|
|
@ -1514,7 +1514,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$member_srl = null;
|
||||
}
|
||||
|
||||
|
||||
if (!$member_srl)
|
||||
{
|
||||
foreach ($config->mention_suffixes as $suffix)
|
||||
|
|
@ -1524,7 +1524,7 @@ class ncenterliteController extends ncenterlite
|
|||
$mention = substr($mention, 0, $pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($members[$mention]))
|
||||
{
|
||||
continue;
|
||||
|
|
@ -1542,10 +1542,10 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$members[$mention] = $member_srl;
|
||||
}
|
||||
|
||||
|
||||
return array_values($members);
|
||||
}
|
||||
|
||||
|
|
@ -1568,11 +1568,11 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$oNcenterliteModel = getModel('ncenterlite');
|
||||
$content = $oNcenterliteModel->getNotificationText($args);
|
||||
$content = htmlspecialchars_decode(preg_replace('/<\/?(strong|)[^>]*>/', '', $content));
|
||||
|
||||
|
||||
$target_url = $args->target_url;
|
||||
if (!preg_match('!^https?://!', $target_url))
|
||||
{
|
||||
|
|
@ -1604,10 +1604,10 @@ class ncenterliteController extends ncenterlite
|
|||
$oPush->setURL(strval($target_url));
|
||||
$oPush->addTo(intval($args->member_srl));
|
||||
$output = $oPush->send();
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
function sendSmsMessage($args)
|
||||
{
|
||||
$config = NcenterliteModel::getConfig();
|
||||
|
|
@ -1645,7 +1645,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$phone_country = $member_info->phone_country;
|
||||
$phone_number = $member_info->phone_number;
|
||||
|
||||
|
||||
// Sending SMS outside of Korea is currently not supported.
|
||||
if($phone_country !== 'KOR')
|
||||
{
|
||||
|
|
@ -1695,7 +1695,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$oNcenterliteModel = getModel('ncenterlite');
|
||||
$content = $oNcenterliteModel->getNotificationText($args);
|
||||
|
||||
|
|
@ -1711,7 +1711,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$target_url = Rhymix\Framework\URL::getCurrentDomainUrl($target_url);
|
||||
}
|
||||
|
||||
|
||||
$mail_content = sprintf("<p>%s</p>\n<p>%s</p>\n", $content, $target_url);
|
||||
$member_info = MemberModel::getMemberInfoByMemberSrl($args->member_srl);
|
||||
|
||||
|
|
@ -1816,9 +1816,9 @@ class ncenterliteController extends ncenterlite
|
|||
$document_srl = Context::get('target_srl');
|
||||
|
||||
$config = NcenterliteModel::getConfig();
|
||||
|
||||
|
||||
if($config->unsubscribe !== 'Y') return;
|
||||
|
||||
|
||||
$oDocumentController = getController('document');
|
||||
$url = getUrl('','module','ncenterlite','act','dispNcenterliteInsertUnsubscribe', 'target_srl', $document_srl, 'unsubscribe_type', 'document');
|
||||
$oDocumentController->addDocumentPopupMenu($url,'ncenterlite_cmd_unsubscribe_settings','','popup');
|
||||
|
|
@ -1838,17 +1838,17 @@ class ncenterliteController extends ncenterlite
|
|||
$comment_srl = Context::get('target_srl');
|
||||
|
||||
$config = NcenterliteModel::getConfig();
|
||||
|
||||
|
||||
if($config->unsubscribe !== 'Y') return;
|
||||
|
||||
|
||||
$oCommentController = getController('comment');
|
||||
$url = getUrl('','module','ncenterlite','act','dispNcenterliteInsertUnsubscribe', 'target_srl', $comment_srl, 'unsubscribe_type', 'comment');
|
||||
$oCommentController->addCommentPopupMenu($url,'ncenterlite_cmd_unsubscribe_settings','','popup');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cut a string to fit the notification summary column.
|
||||
*
|
||||
*
|
||||
* @param string $str
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -1864,10 +1864,10 @@ class ncenterliteController extends ncenterlite
|
|||
return cut_str($str, 45);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cut a string to fit the notification content column.
|
||||
*
|
||||
*
|
||||
* @param string $str
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ class ncenterliteModel extends ncenterlite
|
|||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('ncenterlite');
|
||||
|
||||
|
||||
if(!$config)
|
||||
{
|
||||
$config = new stdClass();
|
||||
}
|
||||
|
||||
|
||||
$config->use = $config->use ?? array('message' => array('web' => 1));
|
||||
$config->display_use = $config->display_use ?? 'all';
|
||||
$config->always_display = $config->always_display ?? 'N';
|
||||
|
|
@ -45,7 +45,7 @@ class ncenterliteModel extends ncenterlite
|
|||
$config->mcolorset = $config->mcolorset ?? 'black';
|
||||
$config->zindex = $config->zindex ?? '9999';
|
||||
$config->notify_count = $config->notify_count ?? 5;
|
||||
|
||||
|
||||
if(!isset($config->hide_module_srls))
|
||||
{
|
||||
$config->hide_module_srls = array();
|
||||
|
|
@ -54,7 +54,7 @@ class ncenterliteModel extends ncenterlite
|
|||
{
|
||||
$config->hide_module_srls = explode('|@|', $config->hide_module_srls);
|
||||
}
|
||||
|
||||
|
||||
// Convert old config format
|
||||
if($config->use === 'Y')
|
||||
{
|
||||
|
|
@ -74,13 +74,13 @@ class ncenterliteModel extends ncenterlite
|
|||
getController('module')->insertModuleConfig('ncenterlite', $config);
|
||||
}
|
||||
unset($config->mention_format);
|
||||
|
||||
|
||||
self::$_config = $config;
|
||||
}
|
||||
|
||||
return self::$_config;
|
||||
}
|
||||
|
||||
|
||||
public static function getNotifyTypes()
|
||||
{
|
||||
$default = array(
|
||||
|
|
@ -95,7 +95,7 @@ class ncenterliteModel extends ncenterlite
|
|||
{
|
||||
$default['admin_content'] = 0;
|
||||
}
|
||||
|
||||
|
||||
$custom_types = Rhymix\Framework\Cache::get('ncenterlite:notify_types');
|
||||
if (!$custom_types)
|
||||
{
|
||||
|
|
@ -109,11 +109,11 @@ class ncenterliteModel extends ncenterlite
|
|||
$default[$type->notify_type_id] = $type->notify_type_srl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$default['custom'] = 0;
|
||||
return $default;
|
||||
}
|
||||
|
||||
|
||||
public static function getUserSetNotifyTypes()
|
||||
{
|
||||
return array(
|
||||
|
|
@ -196,20 +196,20 @@ class ncenterliteModel extends ncenterlite
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$member_srl = intval($member_srl);
|
||||
$config = self::$_user_config[$member_srl] ?? null;
|
||||
if ($config !== null)
|
||||
{
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
$config = Rhymix\Framework\Cache::get('ncenterlite:user_config:' . $member_srl);
|
||||
if ($config !== null)
|
||||
{
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('ncenterlite.getUserConfig', $args);
|
||||
|
|
@ -238,7 +238,7 @@ class ncenterliteModel extends ncenterlite
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
self::$_user_config[$member_srl] = $config;
|
||||
Rhymix\Framework\Cache::set('ncenterlite:user_config:' . $member_srl, $config);
|
||||
return $config;
|
||||
|
|
@ -271,31 +271,31 @@ class ncenterliteModel extends ncenterlite
|
|||
{
|
||||
$output = $this->_getMyNotifyList($member_srl, $page, $readed);
|
||||
}
|
||||
|
||||
|
||||
$config = $this->getConfig();
|
||||
$oMemberModel = getModel('member');
|
||||
$list = $output->data;
|
||||
|
||||
|
||||
foreach($list as $k => $v)
|
||||
{
|
||||
$v->text = $this->getNotificationText($v);
|
||||
$v->ago = $this->getAgo($v->regdate);
|
||||
$v->url = getUrl('','act','procNcenterliteRedirect', 'notify', $v->notify);
|
||||
|
||||
|
||||
if($v->target_member_srl < 0)
|
||||
{
|
||||
$v->target_member_srl = 0;
|
||||
$v->target_nick_name = lang('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'))
|
||||
{
|
||||
$v->target_member_srl = 0;
|
||||
$v->target_nick_name = lang('anonymous');
|
||||
$v->target_user_id = $v->target_email_address = 'anonymous';
|
||||
}
|
||||
|
||||
|
||||
if($v->target_member_srl)
|
||||
{
|
||||
$profileImage = $oMemberModel->getProfileImage($v->target_member_srl);
|
||||
|
|
@ -389,19 +389,19 @@ class ncenterliteModel extends ncenterlite
|
|||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $member_srl;
|
||||
|
||||
|
||||
$args->page = $page ? $page : 1;
|
||||
if ($readed)
|
||||
{
|
||||
$args->readed = $readed;
|
||||
}
|
||||
|
||||
|
||||
$notify_count = intval(self::getConfig()->notify_count);
|
||||
if($notify_count)
|
||||
{
|
||||
$args->list_count = $notify_count;
|
||||
}
|
||||
|
||||
|
||||
$output = executeQueryArray('ncenterlite.getNotifyList', $args);
|
||||
if (!$output->data)
|
||||
{
|
||||
|
|
@ -467,7 +467,7 @@ class ncenterliteModel extends ncenterlite
|
|||
{
|
||||
$member_srl[] = $member->member_srl;
|
||||
}
|
||||
|
||||
|
||||
return $member_srl;
|
||||
}
|
||||
|
||||
|
|
@ -495,7 +495,7 @@ class ncenterliteModel extends ncenterlite
|
|||
$output = $this->_getMyNotifyList($member_srl);
|
||||
return $output->total_count;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('ncenterlite.getNotifyNewCount', $args);
|
||||
|
|
@ -520,10 +520,10 @@ class ncenterliteModel extends ncenterlite
|
|||
if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
|
||||
$this->add('colorset_list', $colorsets);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get information about a single notification.
|
||||
*
|
||||
*
|
||||
* @param string $notify
|
||||
* @param int $member_srl
|
||||
* @return object|false
|
||||
|
|
@ -543,10 +543,10 @@ class ncenterliteModel extends ncenterlite
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the notification text.
|
||||
*
|
||||
*
|
||||
* @param object $notification
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -599,15 +599,15 @@ class ncenterliteModel extends ncenterlite
|
|||
$notification->target_summary, // %6$s
|
||||
$notification->target_url, // %7$s
|
||||
));
|
||||
|
||||
|
||||
// Other.
|
||||
case 'U':
|
||||
default:
|
||||
return $this->getNotifyTypeString($notification->notify_type, unserialize($notification->target_body)) ?: lang('ncenterlite');
|
||||
}
|
||||
|
||||
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
// Get the notification text.
|
||||
switch ($notification->target_type)
|
||||
{
|
||||
|
|
@ -685,7 +685,7 @@ class ncenterliteModel extends ncenterlite
|
|||
case 'I':
|
||||
$str = sprintf(lang('ncenterlite_insert_member_message'), $notification->target_nick_name);
|
||||
break;
|
||||
|
||||
|
||||
case 'G':
|
||||
$str = sprintf(lang('ncenterlite_commented'), $notification->target_nick_name, $type, $notification->target_summary);
|
||||
break;
|
||||
|
|
@ -754,7 +754,7 @@ class ncenterliteModel extends ncenterlite
|
|||
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 알림에서 member_srl 만 정리해서 보내준다.
|
||||
* @param int $srl
|
||||
|
|
@ -773,7 +773,7 @@ class ncenterliteModel extends ncenterlite
|
|||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
$member_srls = array();
|
||||
foreach($output->data ?? [] as $value)
|
||||
{
|
||||
|
|
@ -798,7 +798,7 @@ class ncenterliteModel extends ncenterlite
|
|||
{
|
||||
$member_srl = $this->user->member_srl;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->target_srl = $target_srl;
|
||||
$args->member_srl = $member_srl;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class ncenterliteView extends ncenterlite
|
|||
throw new Rhymix\Framework\Exceptions\NotPermitted('ncenterlite_stop_no_permission_other_user');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$user_selected = [];
|
||||
$user_config = NcenterliteModel::getUserConfig($member_srl) ?: new stdClass;
|
||||
$notify_types = NcenterliteModel::getUserSetNotifyTypes();
|
||||
|
|
@ -84,7 +84,7 @@ class ncenterliteView extends ncenterlite
|
|||
$user_selected[$notify_type][$item]->selected = $selected;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Context::set('member_info', $member_info ?? null);
|
||||
Context::set('notify_types', $notify_types);
|
||||
Context::set('user_config', $user_config);
|
||||
|
|
@ -105,12 +105,12 @@ class ncenterliteView extends ncenterlite
|
|||
/** @var ncenterliteModel $oNcenterliteModel */
|
||||
$oNcenterliteModel = getModel('ncenterlite');
|
||||
$config = $oNcenterliteModel->getConfig();
|
||||
|
||||
|
||||
if($config->unsubscribe !== 'Y')
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_unsubscribe_block_not_support');
|
||||
}
|
||||
|
||||
|
||||
if(!Rhymix\Framework\Session::getMemberSrl())
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
|
|
@ -125,7 +125,7 @@ class ncenterliteView extends ncenterlite
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted('msg_unsubscribe_not_permission');
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->page = Context::get('page');
|
||||
$args->list_count = '20';
|
||||
|
|
@ -138,32 +138,32 @@ class ncenterliteView extends ncenterlite
|
|||
Context::set('page', $output->page);
|
||||
Context::set('unsubscribe_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
|
||||
$this->setTemplateFileOrDefault('unsubscribeList');
|
||||
}
|
||||
|
||||
|
||||
function dispNcenterliteInsertUnsubscribe()
|
||||
{
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
|
||||
/** @var ncenterliteModel $oNcenterliteModel */
|
||||
$oNcenterliteModel = getModel('ncenterlite');
|
||||
$target_srl = Context::get('target_srl');
|
||||
$unsubscribe_srl = Context::get('unsubscribe_srl');
|
||||
$unsubscribe_type = Context::get('unsubscribe_type');
|
||||
|
||||
|
||||
$member_srl = Context::get('member_srl');
|
||||
|
||||
|
||||
if(!$member_srl)
|
||||
{
|
||||
$member_srl = $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');
|
||||
}
|
||||
|
||||
|
||||
if($unsubscribe_srl)
|
||||
{
|
||||
$output = $oNcenterliteModel->getUserUnsubscribeConfigByUnsubscribeSrl($unsubscribe_srl);
|
||||
|
|
@ -172,12 +172,12 @@ class ncenterliteView extends ncenterlite
|
|||
{
|
||||
$output = $oNcenterliteModel->getUserUnsubscribeConfigByTargetSrl($target_srl, $member_srl);
|
||||
}
|
||||
|
||||
|
||||
if((!$target_srl || !$unsubscribe_type) && empty($output))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
if($unsubscribe_type == 'document')
|
||||
{
|
||||
$text = getModel('document')->getDocument($target_srl)->getTitleText();
|
||||
|
|
@ -215,11 +215,11 @@ class ncenterliteView extends ncenterlite
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Context::set('unsubscribeData', $output);
|
||||
Context::set('text', $text);
|
||||
Context::set('type', $type);
|
||||
|
||||
|
||||
$this->setTemplateFileOrDefault('unsubscribe');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class pageAdminController extends page
|
|||
$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_description = trim(utf8_normalize_spaces($args->meta_description));
|
||||
|
||||
|
||||
// Check if an original module exists by using module_srl
|
||||
if($args->module_srl)
|
||||
{
|
||||
|
|
@ -328,7 +328,7 @@ class pageAdminController extends page
|
|||
$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);
|
||||
$msg_code = 'success_updated';
|
||||
|
|
|
|||
|
|
@ -188,10 +188,10 @@ class pageAdminView extends page
|
|||
{
|
||||
throw new Rhymix\Framework\Exception(sprintf('%s method is not exists', $method));
|
||||
}
|
||||
|
||||
|
||||
Context::set('module_info', $this->module_info);
|
||||
Context::set('page_content', $page_content);
|
||||
|
||||
|
||||
$this->setLayoutFile('');
|
||||
$this->setTemplateFile('mcontent');
|
||||
}
|
||||
|
|
@ -258,11 +258,11 @@ class pageAdminView extends page
|
|||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('widget_list..title','module_info.mid');
|
||||
|
||||
|
||||
// Load admin resources
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
$oTemplate->compile('modules/admin/tpl', '_admin_common.html');
|
||||
|
||||
|
||||
// Set a template file
|
||||
$this->setLayoutFile('');
|
||||
$this->setTemplateFile($templateFile);
|
||||
|
|
@ -289,7 +289,7 @@ class pageAdminView extends page
|
|||
$document_srl = $this->module_info->{$target};
|
||||
$oDocument->setDocument($document_srl);
|
||||
Context::set('document_srl', $document_srl);
|
||||
}
|
||||
}
|
||||
else if(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);
|
||||
}
|
||||
|
||||
|
||||
Context::addJsFilter($this->module_path.'tpl/filter', 'insert_article.xml');
|
||||
Context::set('oDocument', $oDocument);
|
||||
Context::set('mid', $this->module_info->mid);
|
||||
|
||||
|
||||
$this->setLayoutFile('');
|
||||
$this->setTemplateFile('article_content_modify');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class pageView extends page
|
|||
$this instanceof pageMobile ? 'm' : 'pc',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
if ($this->module_info->page_type === 'OUTSIDE')
|
||||
{
|
||||
$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('page_content', $page_content);
|
||||
|
||||
|
||||
// if the page type is the widget or outside, there might be usable GET entities.
|
||||
$request_vars = Context::getRequestVars();
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
if ($this->interval > 0)
|
||||
{
|
||||
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)
|
||||
{
|
||||
$page_content = FileHandler::readFile($this->cache_file);
|
||||
$page_content = FileHandler::readFile($this->cache_file);
|
||||
$page_content = str_replace('<!--#Meta:', '<!--Meta:', $page_content);
|
||||
}
|
||||
else
|
||||
|
|
@ -135,7 +135,7 @@ class pageView extends page
|
|||
FileHandler::removeFile($this->cache_file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $page_content;
|
||||
}
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ class pageView extends page
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Kick out anyone who tries to exploit RVE-2022-2.
|
||||
foreach (Context::getRequestVars() as $key => $val)
|
||||
{
|
||||
|
|
@ -176,13 +176,13 @@ class pageView extends page
|
|||
throw new Rhymix\Framework\Exceptions\SecurityViolation();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// External URL
|
||||
if (preg_match('!^[a-z]+://!i', $this->path))
|
||||
{
|
||||
return $this->getHtmlPage($this->path, $this->interval, $this->cache_file);
|
||||
}
|
||||
|
||||
|
||||
// Internal PHP document
|
||||
else
|
||||
{
|
||||
|
|
@ -205,10 +205,10 @@ class pageView extends page
|
|||
FileHandler::getRemoteFile($path, $cache_file);
|
||||
$content = FileHandler::readFile($cache_file);
|
||||
}
|
||||
|
||||
|
||||
// Create opage controller
|
||||
$oPageController = getController('page');
|
||||
|
||||
|
||||
// change url of image, css, javascript and so on if the page is from external server
|
||||
$content = $oPageController->replaceSrc($content, $path);
|
||||
|
||||
|
|
@ -217,15 +217,15 @@ class pageView extends page
|
|||
$buff->content = $content;
|
||||
$buff = Context::convertEncoding($buff);
|
||||
$content = $buff->content;
|
||||
|
||||
|
||||
// Extract a title
|
||||
$title = $oPageController->getTitle($content);
|
||||
if($title) Context::setBrowserTitle($title);
|
||||
|
||||
|
||||
// Extract header script
|
||||
$head_script = $oPageController->getHeadScript($content);
|
||||
if($head_script) Context::addHtmlHeader($head_script);
|
||||
|
||||
|
||||
// Extract content from the body
|
||||
$body_script = $oPageController->getBodyScript($content);
|
||||
if(!$body_script) $body_script = $content;
|
||||
|
|
@ -250,7 +250,7 @@ class pageView extends page
|
|||
{
|
||||
return file_get_contents($cache_file);
|
||||
}
|
||||
|
||||
|
||||
// Parse as template if enabled.
|
||||
if ($this->proc_tpl)
|
||||
{
|
||||
|
|
@ -264,7 +264,7 @@ class pageView extends page
|
|||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
// Include template file in an isolated scope.
|
||||
$content = '';
|
||||
$include_path = get_include_path();
|
||||
|
|
@ -282,7 +282,7 @@ class pageView extends page
|
|||
{
|
||||
$content .= ob_get_clean();
|
||||
}
|
||||
|
||||
|
||||
// Insert comments for debugging.
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Parse as PHP if enabled.
|
||||
elseif ($this->proc_php)
|
||||
{
|
||||
|
|
@ -300,13 +300,13 @@ class pageView extends page
|
|||
});
|
||||
$content = ob_get_clean();
|
||||
}
|
||||
|
||||
|
||||
// Otherwise, get the raw content of the file.
|
||||
else
|
||||
{
|
||||
$content = file_get_contents($real_target_file);
|
||||
}
|
||||
|
||||
|
||||
// Convert relative paths to absolute paths.
|
||||
$this->path = str_replace('\\', '/', dirname($real_target_file)) . '/';
|
||||
$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)
|
||||
{
|
||||
$val = trim($matches[3]);
|
||||
|
||||
|
||||
// Pass if the path is external or starts with /, #, { characters
|
||||
// /=absolute path, #=hash in a page, {=Template syntax
|
||||
if(strpos($val, '.') === FALSE || preg_match('@^((?:http|https|ftp|telnet|mms)://|(?:mailto|javascript):|[/#{])@i',$val))
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class pointAdminController extends point
|
|||
|
||||
// A function to calculate per-level points
|
||||
$config->expression = $args->expression;
|
||||
|
||||
|
||||
// Save
|
||||
$oModuleController->insertModuleConfig('point', $config);
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ class pointAdminController extends point
|
|||
'voter', 'blamer', 'voter_comment', 'blamer_comment',
|
||||
'download_file_author', 'read_document_author', 'voted', 'blamed', 'voted_comment', 'blamed_comment',
|
||||
);
|
||||
|
||||
|
||||
foreach($configTypeList AS $config)
|
||||
{
|
||||
if(is_array($args->{$config}))
|
||||
|
|
@ -385,7 +385,7 @@ class pointAdminController extends point
|
|||
$output = executeQuery("point.initMemberPoint");
|
||||
if(!$output->toBool()) return $output;
|
||||
// Save the file temporarily
|
||||
|
||||
|
||||
$str = '';
|
||||
foreach($member as $key => $val)
|
||||
{
|
||||
|
|
@ -432,7 +432,7 @@ class pointAdminController extends point
|
|||
{
|
||||
FileHandler::removeFile('./files/cache/pointRecal.txt');
|
||||
$idx = $total;
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::clearGroup('member');
|
||||
FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old');
|
||||
FileHandler::removeDir('./files/member_extra_info/point.old');
|
||||
|
|
|
|||
|
|
@ -47,11 +47,11 @@ class pointAdminView extends point
|
|||
}
|
||||
}
|
||||
Context::set('group_list', $selected_group_list);
|
||||
|
||||
|
||||
// Get max level allowed by system
|
||||
$system_max_level = min(1000, ini_get('max_input_vars') - 100);
|
||||
Context::set('system_max_level', $system_max_level);
|
||||
|
||||
|
||||
//Security
|
||||
$security = new Security();
|
||||
$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');
|
||||
$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_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
|
|
|
|||
|
|
@ -11,17 +11,17 @@ class point extends ModuleObject
|
|||
* Cache for the point module's own configuration.
|
||||
*/
|
||||
protected static $_config = null;
|
||||
|
||||
|
||||
/**
|
||||
* Cache for other modules' point configuration.
|
||||
*/
|
||||
protected static $_module_config_cache = array();
|
||||
|
||||
|
||||
/**
|
||||
* Cache for member points.
|
||||
*/
|
||||
protected static $_member_point_cache = array();
|
||||
|
||||
|
||||
/**
|
||||
* Triggers to insert.
|
||||
*/
|
||||
|
|
@ -49,7 +49,7 @@ class point extends ModuleObject
|
|||
array('module.procModuleAdminCopyModule', 'after', 'controller', 'triggerCopyModule'),
|
||||
array('module.dispAdditionSetup', 'after', 'view', 'triggerDispPointAdditionSetup'),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Triggers to delete.
|
||||
*/
|
||||
|
|
@ -58,7 +58,7 @@ class point extends ModuleObject
|
|||
array('document.deleteDocument', 'before', 'controller', 'triggerBeforeDeleteDocument'),
|
||||
array('file.insertFile', 'after', 'controller', 'triggerInsertFile'),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Shortcut to getting module configuration
|
||||
*/
|
||||
|
|
@ -70,10 +70,10 @@ class point extends ModuleObject
|
|||
}
|
||||
return self::$_config;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check triggers.
|
||||
*
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkTriggers()
|
||||
|
|
@ -95,10 +95,10 @@ class point extends ModuleObject
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register triggers.
|
||||
*
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function registerTriggers()
|
||||
|
|
@ -120,7 +120,7 @@ class point extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
|
||||
|
||||
// Define default points.
|
||||
$config->signup_point = 10;
|
||||
$config->login_point = 5;
|
||||
|
|
@ -153,10 +153,10 @@ class point extends ModuleObject
|
|||
$config->blamed = 0;
|
||||
$config->voted_comment = 0;
|
||||
$config->blamed_comment = 0;
|
||||
|
||||
|
||||
// Save module config.
|
||||
getController('module')->insertModuleConfig('point', $config);
|
||||
|
||||
|
||||
// Create a directory to store points information.
|
||||
FileHandler::makeDir('./files/member_extra_info/point');
|
||||
}
|
||||
|
|
@ -186,7 +186,7 @@ class point extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/* End of file point.class.php */
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class pointController extends point
|
|||
* Variables for internal reference.
|
||||
*/
|
||||
protected $_original;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
*/
|
||||
|
|
@ -29,7 +29,7 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$config = $this->getConfig();
|
||||
$diff = intval($config->signup_point);
|
||||
if ($diff != 0)
|
||||
|
|
@ -49,13 +49,13 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Points are given only once a day.
|
||||
if (substr($obj->last_login, 0, 8) === date('Ymd'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$config = $this->getConfig();
|
||||
$diff = intval($config->login_point);
|
||||
if ($diff != 0)
|
||||
|
|
@ -72,7 +72,7 @@ class pointController extends point
|
|||
{
|
||||
$group_srl = $obj->group_srl;
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
// Exclude deleted group from point/level/group integration
|
||||
if($config->point_group && isset($config->point_group[$group_srl]))
|
||||
{
|
||||
|
|
@ -80,7 +80,7 @@ class pointController extends point
|
|||
getController('module')->insertModuleConfig('point', $config);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief A trigger to add points to the member for creating a post
|
||||
*/
|
||||
|
|
@ -92,7 +92,7 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// The fix to disable giving points for saving the document temporarily
|
||||
if ($module_srl == $member_srl)
|
||||
{
|
||||
|
|
@ -102,19 +102,19 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$diff = 0;
|
||||
|
||||
// Add points for the document.
|
||||
$diff += $this->_getModulePointConfig($module_srl, 'insert_document');
|
||||
|
||||
|
||||
// Add points for attached files.
|
||||
if ($obj->updated_file_count > 0)
|
||||
{
|
||||
$upload_point = $this->_getModulePointConfig($module_srl, 'upload_file');
|
||||
$diff += $upload_point * $obj->updated_file_count;
|
||||
}
|
||||
|
||||
|
||||
// Increase the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
|
|
@ -137,7 +137,7 @@ class pointController extends point
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @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
|
||||
|
|
@ -154,15 +154,15 @@ class pointController extends point
|
|||
$module_srl = $obj->module_srl;
|
||||
$member_srl = $obj->member_srl;
|
||||
}
|
||||
|
||||
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
$this->_original = null;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$diff = 0;
|
||||
|
||||
|
||||
// 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'))
|
||||
{
|
||||
|
|
@ -175,14 +175,14 @@ class pointController extends point
|
|||
$upload_point = $this->_getModulePointConfig($module_srl, 'upload_file');
|
||||
$diff += $upload_point * $obj->updated_file_count;
|
||||
}
|
||||
|
||||
|
||||
// Increase the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
$cur_point = PointModel::getPoint($member_srl);
|
||||
$this->setPoint($member_srl, $cur_point + $diff);
|
||||
}
|
||||
|
||||
|
||||
// Remove the reference to the original document.
|
||||
$this->_original = null;
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ class pointController extends point
|
|||
*/
|
||||
public function triggerBeforeDeleteDocument($obj)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -210,14 +210,14 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Return if disabled
|
||||
$config = $this->getConfig();
|
||||
if ($config->insert_document_revert_on_delete === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// The fix to disable giving points for saving the document temporarily
|
||||
if ($module_srl == $member_srl)
|
||||
{
|
||||
|
|
@ -227,10 +227,10 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Subtract points for the document.
|
||||
$diff = $this->_getModulePointConfig($module_srl, 'insert_document');
|
||||
|
||||
|
||||
// Increase the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
|
|
@ -258,14 +258,14 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Abort if the comment and the document have the same author.
|
||||
$oDocument = DocumentModel::getDocument($obj->document_srl);
|
||||
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Abort if the document is older than a configured limit.
|
||||
$config = $this->getConfig();
|
||||
$time_limit = $config->insert_comment_limit ?: $config->no_point_date;
|
||||
|
|
@ -273,22 +273,22 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$diff = 0;
|
||||
|
||||
|
||||
// Add points for the comment.
|
||||
if ($mode === 'insert')
|
||||
{
|
||||
$diff += $this->_getModulePointConfig($module_srl, 'insert_comment');
|
||||
}
|
||||
|
||||
|
||||
// Add points for attached files.
|
||||
if ($obj->updated_file_count > 0)
|
||||
{
|
||||
$upload_point = $this->_getModulePointConfig($module_srl, 'upload_file');
|
||||
$diff += $upload_point * $obj->updated_file_count;
|
||||
}
|
||||
|
||||
|
||||
// Increase the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
|
|
@ -304,7 +304,7 @@ class pointController extends point
|
|||
{
|
||||
$this->triggerInsertComment($obj, 'update');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief A trigger which gives points for deleting a comment
|
||||
*/
|
||||
|
|
@ -320,32 +320,32 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Return if disabled
|
||||
$config = $this->getConfig();
|
||||
if ($config->insert_comment_revert_on_delete === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Abort if the comment and the document have the same author.
|
||||
$oDocument = DocumentModel::getDocument($obj->document_srl);
|
||||
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Abort if the document is older than a configured limit.
|
||||
$time_limit = $config->insert_comment_limit ?: $config->no_point_date;
|
||||
if ($time_limit > 0 && ztime($oDocument->get('regdate')) < RX_TIME - ($time_limit * 86400))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Calculate points based on the module_srl of the document to which this comment belongs
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
$diff = $this->_getModulePointConfig($module_srl, 'insert_comment');
|
||||
|
||||
|
||||
// Decrease the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
|
|
@ -368,7 +368,7 @@ class pointController extends point
|
|||
*/
|
||||
public function triggerInsertFile($obj)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -383,19 +383,19 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Return if disabled
|
||||
$config = $this->getConfig();
|
||||
if ($config->upload_file_revert_on_delete === false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Get the points of the member
|
||||
|
||||
// Subtract points for the file.
|
||||
$diff = $this->_getModulePointConfig($module_srl, 'upload_file');
|
||||
|
||||
|
||||
// Update the point.
|
||||
if ($diff != 0)
|
||||
{
|
||||
|
|
@ -417,23 +417,23 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$point = $this->_getModulePointConfig($module_srl, 'download_file');
|
||||
if (!$point)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Get current points.
|
||||
$cur_point = $logged_member_srl ? PointModel::getPoint($logged_member_srl) : 0;
|
||||
|
||||
|
||||
// If the user (member or guest) does not have enough points, deny access.
|
||||
$config = $this->getConfig();
|
||||
if ($config->disable_download == 'Y' && $cur_point + $point < 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cannot_download');
|
||||
}
|
||||
|
||||
|
||||
// Points will be adjusted after downloading (triggerDownloadFile).
|
||||
}
|
||||
|
||||
|
|
@ -450,7 +450,7 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Adjust points of the downloader.
|
||||
if ($logged_member_srl)
|
||||
{
|
||||
|
|
@ -461,7 +461,7 @@ class pointController extends point
|
|||
$this->setPoint($logged_member_srl, $cur_point + $point);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust points of the uploader.
|
||||
if ($author_member_srl)
|
||||
{
|
||||
|
|
@ -488,7 +488,7 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Load configuration for reader and author points.
|
||||
$reader_point = $this->_getModulePointConfig($module_srl, 'read_document');
|
||||
$author_point = $this->_getModulePointConfig($module_srl, 'read_document_author');
|
||||
|
|
@ -496,7 +496,7 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// If the reader has already read this document, do not adjust points again.
|
||||
if ($logged_member_srl)
|
||||
{
|
||||
|
|
@ -509,7 +509,7 @@ class pointController extends point
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Give no points if the document is older than a configured limit.
|
||||
$regdate = ztime($obj->get('regdate'));
|
||||
$config = $this->getConfig();
|
||||
|
|
@ -521,7 +521,7 @@ class pointController extends point
|
|||
{
|
||||
$author_point = 0;
|
||||
}
|
||||
|
||||
|
||||
// Give no points if the document is a notice and an exception has been configured.
|
||||
if ($obj->get('is_notice') === 'Y')
|
||||
{
|
||||
|
|
@ -534,13 +534,13 @@ class pointController extends point
|
|||
$author_point = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust points of the reader.
|
||||
if ($reader_point)
|
||||
{
|
||||
// Get current points.
|
||||
$cur_point = $logged_member_srl ? PointModel::getPoint($logged_member_srl) : 0;
|
||||
|
||||
|
||||
// If the reader does not have enough points, deny access.
|
||||
if ($cur_point + $reader_point < 0 && $config->disable_read_document == 'Y')
|
||||
{
|
||||
|
|
@ -556,7 +556,7 @@ class pointController extends point
|
|||
return new BaseObject(-1, $message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Record the fact that this member has already read this document.
|
||||
if ($logged_member_srl)
|
||||
{
|
||||
|
|
@ -567,7 +567,7 @@ class pointController extends point
|
|||
$this->setPoint($logged_member_srl, $cur_point + $reader_point);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust points of the person who wrote the document.
|
||||
if ($author_point && $author_member_srl)
|
||||
{
|
||||
|
|
@ -588,10 +588,10 @@ class pointController extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Document or comment?
|
||||
$is_comment = isset($obj->comment_srl) && $obj->comment_srl;
|
||||
|
||||
|
||||
// Give no points if the document or comment is older than a configured limit.
|
||||
$config = $this->getConfig();
|
||||
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));
|
||||
$target_enabled = !($config->$target_config_key > 0 && $regdate < RX_TIME - ($config->$target_config_key * 86400));
|
||||
|
||||
|
||||
// Adjust points of the voter.
|
||||
if ($logged_member_srl && $logged_enabled)
|
||||
{
|
||||
|
|
@ -624,7 +624,7 @@ class pointController extends point
|
|||
$this->setPoint($logged_member_srl, $cur_point + $point);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust points of the person who wrote the document or comment.
|
||||
if ($target_member_srl && $target_enabled)
|
||||
{
|
||||
|
|
@ -752,7 +752,7 @@ class pointController extends point
|
|||
{
|
||||
$change_group = ($level != $current_level);
|
||||
}
|
||||
|
||||
|
||||
if ($change_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
|
||||
$default_group = MemberModel::getDefaultGroup();
|
||||
asort($point_group);
|
||||
|
||||
|
||||
// Reset group after initialization
|
||||
if($config->group_reset != 'N')
|
||||
{
|
||||
|
|
@ -862,10 +862,10 @@ class pointController extends point
|
|||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get point configuration for module, falling back to defaults if not set.
|
||||
*
|
||||
*
|
||||
* @param int $module_srl
|
||||
* @param string $config_key
|
||||
* @return int
|
||||
|
|
@ -878,7 +878,7 @@ class pointController extends point
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if ($module_srl)
|
||||
{
|
||||
if (!isset(self::$_module_config_cache[$module_srl]))
|
||||
|
|
@ -895,7 +895,7 @@ class pointController extends point
|
|||
{
|
||||
$module_config = array();
|
||||
}
|
||||
|
||||
|
||||
if (isset($module_config[$config_key]) && $module_config[$config_key] !== '')
|
||||
{
|
||||
$point = $module_config[$config_key];
|
||||
|
|
@ -905,7 +905,7 @@ class pointController extends point
|
|||
$default_config = $this->getConfig();
|
||||
$point = $default_config->{$config_key};
|
||||
}
|
||||
|
||||
|
||||
return intval($point);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class pointModel extends point
|
|||
$args = new stdClass;
|
||||
$args->member_srl = abs($member_srl);
|
||||
$output = executeQuery('point.getPoint', $args, array('member_srl'));
|
||||
|
||||
|
||||
return isset($output->data->member_srl);
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ class pointModel extends point
|
|||
return parent::$_member_point_cache[$member_srl] = $point;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get from file cache
|
||||
$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);
|
||||
|
|
@ -79,7 +79,7 @@ class pointModel extends point
|
|||
$exists = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Save to cache
|
||||
parent::$_member_point_cache[$member_srl] = $point;
|
||||
if (Rhymix\Framework\Cache::getDriverName() !== 'dummy')
|
||||
|
|
@ -121,7 +121,7 @@ class pointModel extends point
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if (!$logged_info->member_srl)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class spamfilterAdminController extends spamfilter
|
|||
{
|
||||
// Get current config
|
||||
$config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass;
|
||||
|
||||
|
||||
// Get the default information
|
||||
$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
|
||||
$config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass;
|
||||
|
||||
|
||||
// Get updated values
|
||||
$vars = Context::getRequestVars();
|
||||
if (!isset($vars->target_devices) || !is_array($vars->target_devices))
|
||||
|
|
@ -71,7 +71,7 @@ class spamfilterAdminController extends spamfilter
|
|||
{
|
||||
$vars->target_actions = [];
|
||||
}
|
||||
|
||||
|
||||
// Check values
|
||||
if (!isset($config->captcha))
|
||||
{
|
||||
|
|
@ -84,7 +84,7 @@ class spamfilterAdminController extends spamfilter
|
|||
{
|
||||
return new BaseObject(-1, 'msg_recaptcha_keys_not_set');
|
||||
}
|
||||
|
||||
|
||||
$config->captcha->theme = escape(utf8_trim($vars->captcha_theme));
|
||||
$config->captcha->size = escape(utf8_trim($vars->captcha_size));
|
||||
$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_frequency = escape(utf8_trim($vars->target_frequency)) ?: 'first_time_only';
|
||||
|
||||
|
||||
// Insert new config
|
||||
$output = getController('module')->insertModuleConfig('spamfilter', $config);
|
||||
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');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
|
||||
public function procSpamfilterAdminInsertDeniedIP()
|
||||
{
|
||||
//스팸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');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
|
||||
public function procSpamfilterAdminUpdateDeniedIP()
|
||||
{
|
||||
$ipaddress = Context::get('ipaddress');
|
||||
|
|
@ -138,10 +138,10 @@ class spamfilterAdminController extends spamfilter
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$args = new \stdClass;
|
||||
$args->ipaddress = $ipaddress;
|
||||
|
||||
|
||||
$except_member = Context::get('except_member');
|
||||
if (!empty($except_member))
|
||||
{
|
||||
|
|
@ -151,13 +151,13 @@ class spamfilterAdminController extends spamfilter
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$output = executeQuery('spamfilter.updateDeniedIPAttributes', $args);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete('spamfilter:denied_ip_list');
|
||||
}
|
||||
|
||||
|
|
@ -196,36 +196,36 @@ class spamfilterAdminController extends spamfilter
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$args = new \stdClass;
|
||||
$args->word = $word;
|
||||
|
||||
|
||||
$except_member = Context::get('except_member');
|
||||
if (!empty($except_member))
|
||||
{
|
||||
$args->except_member = $except_member === 'Y' ? 'Y' : 'N';
|
||||
}
|
||||
|
||||
|
||||
$filter_html = Context::get('filter_html');
|
||||
if (!empty($filter_html))
|
||||
{
|
||||
$args->filter_html = $filter_html === 'Y' ? 'Y' : 'N';
|
||||
}
|
||||
|
||||
|
||||
if (!isset($args->except_member) && !isset($args->filter_html))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$output = executeQuery('spamfilter.updateDeniedWordAttributes', $args);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete('spamfilter:denied_word_list');
|
||||
}
|
||||
|
||||
|
||||
public function procSpamfilterAdminDeleteDeniedWord()
|
||||
{
|
||||
$wordList = Context::get('word');
|
||||
|
|
@ -248,7 +248,7 @@ class spamfilterAdminController extends spamfilter
|
|||
$args = new stdClass;
|
||||
$args->ipaddress = $ipaddress;
|
||||
$output = executeQuery('spamfilter.deleteDeniedIP', $args);
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete('spamfilter:denied_ip_list');
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -281,12 +281,12 @@ class spamfilterAdminController extends spamfilter
|
|||
{
|
||||
$description = null;
|
||||
}
|
||||
|
||||
|
||||
if (mb_strlen($word, 'UTF-8') < 2 || mb_strlen($word, 'UTF-8') > 180)
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_invalid_word');
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass;
|
||||
$args->word = $word;
|
||||
$args->description = $description;
|
||||
|
|
@ -297,12 +297,12 @@ class spamfilterAdminController extends spamfilter
|
|||
$fail_list .= $args->word . '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($output)
|
||||
{
|
||||
$output->add('fail_list', $fail_list);
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete('spamfilter:denied_word_list');
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -317,7 +317,7 @@ class spamfilterAdminController extends spamfilter
|
|||
$args = new stdClass;
|
||||
$args->word = $word;
|
||||
$output = executeQuery('spamfilter.deleteDeniedWord', $args);
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete('spamfilter:denied_word_list');
|
||||
return $output;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* @author NAVER (developers@xpressengine.com)
|
||||
* @brief The admin view class of the spamfilter module
|
||||
*/
|
||||
class spamfilterAdminView extends spamfilter
|
||||
class spamfilterAdminView extends spamfilter
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
|
|
@ -27,7 +27,7 @@ class spamfilterAdminView extends spamfilter
|
|||
{
|
||||
$sort_index = 'regdate';
|
||||
}
|
||||
|
||||
|
||||
// Get the list of denied IP addresses and words
|
||||
$oSpamFilterModel = getModel('spamfilter');
|
||||
$ip_list = $oSpamFilterModel->getDeniedIPList($sort_index);
|
||||
|
|
@ -52,7 +52,7 @@ class spamfilterAdminView extends spamfilter
|
|||
{
|
||||
$sort_index = 'hit';
|
||||
}
|
||||
|
||||
|
||||
// Get the list of denied IP addresses and words
|
||||
$oSpamFilterModel = getModel('spamfilter');
|
||||
$word_list = $oSpamFilterModel->getDeniedWordList($sort_index);
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@ class spamfilter extends ModuleObject
|
|||
array('communication.sendMessage', 'before', 'controller', 'triggerSendMessage'),
|
||||
array('moduleObject.proc', 'before', 'controller', 'triggerCheckCaptcha'),
|
||||
);
|
||||
|
||||
|
||||
protected static $_delete_triggers = array(
|
||||
array('trackback.insertTrackback', 'before', 'controller', 'triggerInsertTrackback'),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Register all triggers.
|
||||
*
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function registerTriggers()
|
||||
|
|
@ -45,7 +45,7 @@ class spamfilter extends ModuleObject
|
|||
}
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Additional tasks required to accomplish during the installation
|
||||
*/
|
||||
|
|
@ -73,7 +73,7 @@ class spamfilter extends ModuleObject
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
if(!$oDB->isColumnExists('spamfilter_denied_word', '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', 'except_member')) return true;
|
||||
if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) return true;
|
||||
|
||||
|
||||
$config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass;
|
||||
if (!isset($config->captcha))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ class spamfilter extends ModuleObject
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
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');
|
||||
}
|
||||
|
||||
|
||||
$config = ModuleModel::getModuleConfig('spamfilter') ?: new stdClass;
|
||||
if (!isset($config->captcha))
|
||||
{
|
||||
|
|
@ -167,7 +167,7 @@ class spamfilter extends ModuleObject
|
|||
$config->captcha = new stdClass;
|
||||
$config->captcha->type = 'none';
|
||||
}
|
||||
|
||||
|
||||
$output = getController('module')->insertModuleConfig($this->module, $config);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
|
|
@ -181,9 +181,9 @@ class spamfilter extends ModuleObject
|
|||
*/
|
||||
public function recompileCache()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Import configuration from reCAPTCHA addon.
|
||||
*/
|
||||
|
|
@ -195,7 +195,7 @@ class spamfilter extends ModuleObject
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
if ($config->use_pc === 'Y' || $config->use_mobile === 'Y')
|
||||
{
|
||||
$output->type = 'recaptcha';
|
||||
|
|
@ -222,7 +222,7 @@ class spamfilter extends ModuleObject
|
|||
$output->target_modules[$module_srl] = true;
|
||||
}
|
||||
$output->target_modules_type = ($config->xe_run_method === 'run_selected') ? '+' : '-';
|
||||
|
||||
|
||||
$oAddonAdminController = getAdminController('addon');
|
||||
if ($output->target_devices['pc'])
|
||||
{
|
||||
|
|
@ -234,7 +234,7 @@ class spamfilter extends ModuleObject
|
|||
$oAddonAdminController->doDeactivate('recaptcha', 0, 'mobile');
|
||||
$oAddonAdminController->makeCacheFile(0, 'mobile');
|
||||
}
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class spamfilterController extends spamfilter
|
|||
}
|
||||
else
|
||||
{
|
||||
$text = $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage;
|
||||
$text = $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage;
|
||||
}
|
||||
$output = $oFilterModel->isDeniedWord($text);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -141,14 +141,14 @@ class spamfilterController extends spamfilter
|
|||
}
|
||||
$fail_list = '';
|
||||
$output = null;
|
||||
|
||||
|
||||
foreach ($ipaddress_list as $ipaddress)
|
||||
{
|
||||
if ($ipaddress === '')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass;
|
||||
if (preg_match('@^(.+?)(?://|#)(.*)$@', $ipaddress, $matches))
|
||||
{
|
||||
|
|
@ -160,24 +160,24 @@ class spamfilterController extends spamfilter
|
|||
$args->ipaddress = $ipaddress;
|
||||
$args->description = $description;
|
||||
}
|
||||
|
||||
|
||||
if (!Rhymix\Framework\Filters\IpFilter::validateRange($args->ipaddress))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_ip');
|
||||
}
|
||||
|
||||
|
||||
$output = executeQuery('spamfilter.insertDeniedIP', $args);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
$fail_list .= $args->ipaddress . '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($output)
|
||||
{
|
||||
$output->add('fail_list', $fail_list);
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete('spamfilter:denied_ip_list');
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -210,7 +210,7 @@ class spamfilterController extends spamfilter
|
|||
// Save a log
|
||||
$this->insertLog();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief while document manager is running, stop filter
|
||||
*/
|
||||
|
|
@ -245,7 +245,7 @@ class spamfilterController extends spamfilter
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$target_actions = [];
|
||||
foreach (['signup', 'login', 'recovery', 'document', 'comment'] as $action)
|
||||
{
|
||||
|
|
@ -257,12 +257,12 @@ class spamfilterController extends spamfilter
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (count($target_actions))
|
||||
{
|
||||
include_once __DIR__ . '/spamfilter.lib.php';
|
||||
spamfilter_reCAPTCHA::init($config->captcha);
|
||||
|
||||
|
||||
if (strncasecmp('proc', $obj->act, 4) === 0)
|
||||
{
|
||||
spamfilter_reCAPTCHA::check();
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ class spamfilter_reCAPTCHA
|
|||
protected static $instances_inserted = 0;
|
||||
protected static $sequence = 1;
|
||||
protected $_target_actions = [];
|
||||
|
||||
|
||||
public static function init($config)
|
||||
{
|
||||
self::$config = $config;
|
||||
}
|
||||
|
||||
|
||||
public static function check()
|
||||
{
|
||||
$response = Context::get('g-recaptcha-response');
|
||||
|
|
@ -21,7 +21,7 @@ class spamfilter_reCAPTCHA
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_recaptcha_invalid_response');
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$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');
|
||||
}
|
||||
|
||||
|
||||
$verify = @json_decode($verify_request->body, true);
|
||||
if (!$verify || !$verify['success'])
|
||||
{
|
||||
|
|
@ -44,10 +44,10 @@ class spamfilter_reCAPTCHA
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_recaptcha_invalid_response');
|
||||
}
|
||||
|
||||
|
||||
$_SESSION['recaptcha_authenticated'] = true;
|
||||
}
|
||||
|
||||
|
||||
public function addScripts()
|
||||
{
|
||||
if (!self::$scripts_added)
|
||||
|
|
@ -60,17 +60,17 @@ class spamfilter_reCAPTCHA
|
|||
Context::addHtmlFooter($html);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function setTargetActions(array $target_actions)
|
||||
{
|
||||
$this->_target_actions = $target_actions;
|
||||
}
|
||||
|
||||
|
||||
public function isTargetAction(string $action): bool
|
||||
{
|
||||
return isset($this->_target_actions[$action]);
|
||||
}
|
||||
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return sprintf('<div id="recaptcha-instance-%d" class="g-recaptcha"></div>', self::$instances_inserted++);
|
||||
|
|
|
|||
|
|
@ -64,11 +64,11 @@ class spamfilterModel extends spamfilter
|
|||
$args = new stdClass();
|
||||
$args->ipaddress = $ip_range->ipaddress;
|
||||
executeQuery('spamfilter.updateDeniedIPHit', $args);
|
||||
|
||||
|
||||
return new BaseObject(-1, 'msg_alert_registered_denied_ip');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ class spamfilterModel extends spamfilter
|
|||
$is_logged = Context::get('is_logged');
|
||||
$fulltext = strtolower(utf8_trim(utf8_normalize_spaces($text)));
|
||||
$plaintext = htmlspecialchars_decode(strip_tags($fulltext, '<a><img>'));
|
||||
|
||||
|
||||
foreach ($word_list as $word_item)
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
return new BaseObject(-1, $custom_message);
|
||||
}
|
||||
}
|
||||
|
|
@ -182,7 +182,7 @@ class spamfilterModel extends spamfilter
|
|||
{
|
||||
$suffix = $config->ipv6_block_range ?: '';
|
||||
}
|
||||
|
||||
|
||||
$oSpamFilterController = getController('spamfilter');
|
||||
$oSpamFilterController->insertIP(\RX_CLIENT_IP . $suffix, 'AUTO-DENIED : Over limit');
|
||||
return new BaseObject(-1, 'msg_alert_registered_denied_ip');
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class tagAdminController extends tag
|
|||
{
|
||||
$config = new stdClass;
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
$config->separators = [];
|
||||
foreach ($vars->separators ?? [] as $val)
|
||||
{
|
||||
|
|
@ -23,18 +23,18 @@ class tagAdminController extends tag
|
|||
$config->separators[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oModuleController = ModuleController::getInstance();
|
||||
$output = $oModuleController->insertModuleConfig($this->module, $config);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_registed');
|
||||
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Delete all tags for a particular module
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ class tagAdminView extends tag
|
|||
{
|
||||
$config = ModuleModel::getModuleConfig($this->module) ?: new stdClass;
|
||||
Context::set('tag_config', $config);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path . 'tpl');
|
||||
$this->setTemplateFile('config');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,27 +57,27 @@ class tag extends ModuleObject
|
|||
$oModuleController = getController('module');
|
||||
$oDB = &DB::getInstance();
|
||||
// 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');
|
||||
|
||||
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');
|
||||
|
||||
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');
|
||||
|
||||
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');
|
||||
|
||||
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');
|
||||
// 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'))
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after');
|
||||
// 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"));
|
||||
|
||||
|
||||
if(!$oModuleModel->getTrigger('document.moveDocumentModule', 'tag', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('document.moveDocumentModule', 'tag', 'controller', 'triggerMoveDocument', 'after');
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class tagController extends tag
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$tag_list = tagModel::splitString($obj->tags ?? '');
|
||||
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.
|
||||
*
|
||||
*
|
||||
* @param object $obj
|
||||
* @return BaseObject
|
||||
*/
|
||||
|
|
@ -67,7 +67,7 @@ class tagController extends tag
|
|||
|
||||
/**
|
||||
* Delete all tags belonging to a document.
|
||||
*
|
||||
*
|
||||
* @param object $obj
|
||||
* @return BaseObject
|
||||
*/
|
||||
|
|
@ -96,7 +96,7 @@ class tagController extends tag
|
|||
$oTagController = getAdminController('tag');
|
||||
return $oTagController->deleteModuleTags($obj->module_srl);
|
||||
}
|
||||
|
||||
|
||||
function triggerMoveDocument($obj)
|
||||
{
|
||||
executeQuery('tag.updateTagModule', $obj);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class tagModel extends tag
|
|||
*/
|
||||
protected static $_separator_list = null;
|
||||
protected static $_separator_regexp = null;
|
||||
|
||||
|
||||
/**
|
||||
* Generate and cache separator list and regexp.
|
||||
*/
|
||||
|
|
@ -27,7 +27,7 @@ class tagModel extends tag
|
|||
{
|
||||
self::$_separator_list = ['comma', 'hash'];
|
||||
}
|
||||
|
||||
|
||||
$regexp = '/[';
|
||||
$regexp_map = [
|
||||
'comma' => ',',
|
||||
|
|
@ -39,13 +39,13 @@ class tagModel extends tag
|
|||
$regexp .= $regexp_map[$separator];
|
||||
}
|
||||
$regexp .= ']+/';
|
||||
|
||||
|
||||
self::$_separator_regexp = $regexp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Split a string of tags into an array.
|
||||
*
|
||||
*
|
||||
* @param string $str
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -55,14 +55,14 @@ class tagModel extends tag
|
|||
{
|
||||
self::_generateSeparatorConfig();
|
||||
}
|
||||
|
||||
|
||||
// Clean up the input string.
|
||||
$str = trim(utf8_normalize_spaces(utf8_clean($str)));
|
||||
if ($str === '')
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
// Split the input string and collect non-empty fragments.
|
||||
$fragments = preg_split(self::$_separator_regexp, $str, -1, PREG_SPLIT_NO_EMPTY);
|
||||
$tags = [];
|
||||
|
|
@ -74,11 +74,11 @@ class tagModel extends tag
|
|||
$tags[strtolower($fragment)] = $fragment;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Return a list of valid fragments with no duplicates.
|
||||
return array_values(array_unique($tags));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Imported Tag List
|
||||
* Many of the specified module in order to extract the number of tags
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class trashAdminController extends trash
|
|||
if(!$output2->toBool()) return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return new BaseObject(0, 'success_deleted');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class trashAdminView extends trash
|
|||
// 문서 및 댓글 모듈 lang 파일 로딩
|
||||
Context::loadLang('./modules/document/lang');
|
||||
Context::loadLang('./modules/comment/lang');
|
||||
|
||||
|
||||
// 템플릿 경로 지정 (board의 경우 tpl에 관리자용 템플릿 모아놓음)
|
||||
$template_path = sprintf("%stpl/",$this->module_path);
|
||||
$this->setTemplatePath($template_path);
|
||||
|
|
@ -39,7 +39,7 @@ class trashAdminView extends trash
|
|||
|
||||
$search_target = Context::get('search_target'); // /< search (title, contents ...)
|
||||
$search_keyword = Context::get('search_keyword'); // /< keyword to search
|
||||
|
||||
|
||||
switch($search_target)
|
||||
{
|
||||
case 'title':
|
||||
|
|
@ -93,10 +93,10 @@ class trashAdminView extends trash
|
|||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('trash_list');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Trash View - sejin7940
|
||||
function dispTrashAdminView()
|
||||
function dispTrashAdminView()
|
||||
{
|
||||
$trash_srl = Context::get('trash_srl');
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ class trashAdminView extends trash
|
|||
$args_extra = new stdClass;
|
||||
$args_extra->module_srl = $originObject->module_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);
|
||||
}
|
||||
$this->setTemplateFile('trash_view');
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class trash extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -36,7 +36,7 @@ class trash extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/* End of file trash.class.php */
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
$this->arrangeWidgetVars($widget, Context::getRequestVars(), $vars);
|
||||
|
||||
|
||||
// Wanted results
|
||||
$widget_code = $this->execute($widget, $vars, true, false);
|
||||
$widget_code = Context::replaceUserLang($widget_code);
|
||||
|
|
@ -103,7 +103,7 @@ class widgetController extends widget
|
|||
$oLayoutModel = getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($module_srl);
|
||||
if(!$layout_info || $layout_info->type != 'faceoff') $err++;
|
||||
|
||||
|
||||
// Destination Information Wanted page module
|
||||
$oModuleModel = getModel('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($err > 1) throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
|
||||
|
||||
// Check permissions
|
||||
$logged_info = Context::get('logged_info');
|
||||
if (!$logged_info->member_srl)
|
||||
|
|
@ -123,7 +123,7 @@ class widgetController extends widget
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// Enter post
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocumentController = getController('document');
|
||||
|
|
@ -144,10 +144,10 @@ class widgetController extends widget
|
|||
$output = $oDocumentController->insertDocument($obj);
|
||||
$obj->document_srl = $output->get('document_srl');
|
||||
}
|
||||
|
||||
|
||||
// Stop when an error occurs
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
||||
// Return results
|
||||
$this->add('document_srl', $obj->document_srl);
|
||||
}
|
||||
|
|
@ -167,13 +167,13 @@ class widgetController extends widget
|
|||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if(!$oDocument->isExists()) throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
|
||||
|
||||
// Destination Information Wanted page module
|
||||
$oModuleModel = getModel('module');
|
||||
$columnList = array('module_srl', 'module');
|
||||
$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
if(!$page_info->module_srl || $page_info->module != 'page') throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
|
||||
|
||||
// Check permissions
|
||||
$logged_info = Context::get('logged_info');
|
||||
if (!$logged_info->member_srl)
|
||||
|
|
@ -185,10 +185,10 @@ class widgetController extends widget
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$output = $oDocumentAdminController->copyDocumentModule(array($oDocument->get('document_srl')), $oDocument->get('module_srl'),0);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
||||
// Return results
|
||||
$copied_srls = $output->get('copied_srls');
|
||||
$this->add('document_srl', $copied_srls[$oDocument->get('document_srl')]);
|
||||
|
|
@ -208,12 +208,12 @@ class widgetController extends widget
|
|||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if(!$oDocument->isExists()) return;
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
|
||||
|
||||
// Destination Information Wanted page module
|
||||
$oModuleModel = getModel('module');
|
||||
$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$page_info->module_srl || $page_info->module != 'page') throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
|
||||
|
||||
// Check permissions
|
||||
$logged_info = Context::get('logged_info');
|
||||
if (!$logged_info->member_srl)
|
||||
|
|
@ -225,7 +225,7 @@ class widgetController extends widget
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$output = $oDocumentController->deleteDocument($oDocument->get('document_srl'));
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
|
@ -278,20 +278,20 @@ class widgetController extends widget
|
|||
{
|
||||
return '<div>Invalid XML in widget code.</div>';
|
||||
}
|
||||
|
||||
|
||||
$vars = new stdClass;
|
||||
foreach ($xml->img ? $xml->img->attributes() : $xml->attributes() as $key => $val)
|
||||
{
|
||||
$vars->{$key} = strval($val);
|
||||
}
|
||||
|
||||
|
||||
$widget = $vars->widget;
|
||||
if (!$widget)
|
||||
{
|
||||
return $matches[0];
|
||||
}
|
||||
unset($vars->widget);
|
||||
|
||||
|
||||
return $this->execute($widget, $vars, $this->javascript_mode);
|
||||
}
|
||||
|
||||
|
|
@ -337,15 +337,15 @@ class widgetController extends widget
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$args->widget_sequence = $args->widget_sequence ?? 0;
|
||||
$args->colorset = $args->colorset ?? null;
|
||||
|
||||
|
||||
foreach($args as $k => $v)
|
||||
{
|
||||
$args->{$k} = urldecode($v);
|
||||
}
|
||||
|
||||
|
||||
foreach($lang_list as $lang_type => $val)
|
||||
{
|
||||
$this->getCache($widget, $args, $lang_type, true);
|
||||
|
|
@ -363,14 +363,14 @@ class widgetController extends widget
|
|||
{
|
||||
$lang_type = Context::getLangType();
|
||||
}
|
||||
|
||||
|
||||
// Fix the widget sequence if it is missing
|
||||
$widget_sequence = $override_sequence ?: $args->widget_sequence;
|
||||
if (!$widget_sequence)
|
||||
{
|
||||
$widget_sequence = sha1(json_encode($args));
|
||||
}
|
||||
|
||||
|
||||
// Set the widget cache duration
|
||||
$widget_cache = $args->widget_cache;
|
||||
if (preg_match('/^([0-9\.]+)([smhd])$/i', $widget_cache, $matches))
|
||||
|
|
@ -449,7 +449,7 @@ class widgetController extends widget
|
|||
{
|
||||
// Save for debug run-time widget
|
||||
$start = microtime(true);
|
||||
|
||||
|
||||
// urldecode the value of args haejum
|
||||
$object_vars = get_object_vars($args);
|
||||
if(count($object_vars))
|
||||
|
|
@ -460,12 +460,12 @@ class widgetController extends widget
|
|||
if($escaped) $args->{$key} = utf8RawUrlDecode($val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set default
|
||||
$args->widget_sequence = $args->widget_sequence ?? 0;
|
||||
$args->widget_cache = $args->widget_cache ?? 0;
|
||||
$args->colorset = $args->colorset ?? null;
|
||||
|
||||
|
||||
/**
|
||||
* Widgets widgetContent/widgetBox Wanted If you are not content
|
||||
*/
|
||||
|
|
@ -671,7 +671,7 @@ class widgetController extends widget
|
|||
'elapsed_time' => $elapsed_time,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
// Return result
|
||||
return $output;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue