mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 08:41:39 +09:00
Remove unnecessary use of BaseObject
- 트리거 등 반환값이 필요하지 않은 곳에서 new BaseObject()를 반환하는 것 삭제 - 모듈 설치, 업데이트 후 무의미한 new BaseObject()를 반환하는 것 삭제 - 사용자에게 에러 메시지를 돌려주는 용도로 new BaseObject(-1, '에러메시지')를 사용하는 경우는 대부분 $this->setError()로 변경함. 언어 변환과 sprintf() 처리까지 한 번에 이루어지므로 이쪽이 더 편리함.
This commit is contained in:
parent
03d74a984f
commit
84e5542d77
103 changed files with 692 additions and 862 deletions
|
|
@ -18,7 +18,7 @@ class reCAPTCHA
|
|||
$response = Context::get('g-recaptcha-response');
|
||||
if (!$response)
|
||||
{
|
||||
return new BaseObject(-1, lang('recaptcha.msg_recaptcha_invalid_response'));
|
||||
return new BaseObject(-1, 'recaptcha.msg_recaptcha_invalid_response');
|
||||
}
|
||||
|
||||
try
|
||||
|
|
@ -31,17 +31,17 @@ class reCAPTCHA
|
|||
}
|
||||
catch (\Requests_Exception $e)
|
||||
{
|
||||
return new BaseObject(-1, lang('recaptcha.msg_recaptcha_connection_error'));
|
||||
return new BaseObject(-1, 'recaptcha.msg_recaptcha_connection_error');
|
||||
}
|
||||
|
||||
$verify = @json_decode($verify_request->body, true);
|
||||
if ($verify && isset($verify['error-codes']) && in_array('invalid-input-response', $verify['error-codes']))
|
||||
{
|
||||
return new BaseObject(-1, lang('recaptcha.msg_recaptcha_invalid_response'));
|
||||
return new BaseObject(-1, 'recaptcha.msg_recaptcha_invalid_response');
|
||||
}
|
||||
elseif (!$verify || !$verify['success'] || (isset($verify['error-codes']) && $verify['error-codes']))
|
||||
{
|
||||
return new BaseObject(-1, lang('recaptcha.msg_recaptcha_server_error'));
|
||||
return new BaseObject(-1, 'recaptcha.msg_recaptcha_server_error');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class addon extends ModuleObject
|
|||
/**
|
||||
* Implement if additional tasks are necessary when installing
|
||||
*
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
|
|
@ -21,7 +21,6 @@ class addon extends ModuleObject
|
|||
$oAddonController->doInsert('member_extra_info', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('resize_image', 0, 'site', 'Y');
|
||||
$oAddonController->makeCacheFile(0);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -53,7 +52,7 @@ class addon extends ModuleObject
|
|||
/**
|
||||
* Execute update
|
||||
*
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
|
|
@ -88,8 +87,6 @@ class addon extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -158,8 +158,8 @@ class adminAdminController extends admin
|
|||
}
|
||||
|
||||
// create a DesignInfo file
|
||||
$output = $this->updateDefaultDesignInfo($vars);
|
||||
return $this->setRedirectUrl(Context::get('error_return_url'), $output);
|
||||
$this->updateDefaultDesignInfo($vars);
|
||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
}
|
||||
|
||||
public function updateDefaultDesignInfo($vars)
|
||||
|
|
@ -209,8 +209,6 @@ class adminAdminController extends admin
|
|||
}
|
||||
|
||||
$this->makeDefaultDesignFile($designInfo, $vars->site_srl);
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
function makeDefaultDesignFile($designInfo, $site_srl = 0)
|
||||
|
|
@ -287,7 +285,7 @@ class adminAdminController extends admin
|
|||
|
||||
/**
|
||||
* Cleanning favorite
|
||||
* @return Object
|
||||
* @return object|void
|
||||
*/
|
||||
function cleanFavorite()
|
||||
{
|
||||
|
|
@ -301,7 +299,7 @@ class adminAdminController extends admin
|
|||
$favoriteList = $output->get('favoriteList');
|
||||
if(!$favoriteList)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$deleteTargets = array();
|
||||
|
|
@ -319,7 +317,7 @@ class adminAdminController extends admin
|
|||
|
||||
if(!count($deleteTargets))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -329,8 +327,6 @@ class adminAdminController extends admin
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -496,7 +492,7 @@ class adminAdminController extends admin
|
|||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, 'fail_to_delete');
|
||||
return $this->setError('fail_to_delete');
|
||||
}
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
|
@ -520,7 +516,7 @@ class adminAdminController extends admin
|
|||
Rhymix\Framework\Config::set('use_sso', $vars->use_sso === 'Y');
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -540,19 +536,19 @@ class adminAdminController extends admin
|
|||
// Validate the mail sender's information.
|
||||
if (!$vars->mail_default_name)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_advanced_mailer_sender_name_is_empty');
|
||||
return $this->setError('msg_advanced_mailer_sender_name_is_empty');
|
||||
}
|
||||
if (!$vars->mail_default_from)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_advanced_mailer_sender_email_is_empty');
|
||||
return $this->setError('msg_advanced_mailer_sender_email_is_empty');
|
||||
}
|
||||
if (!Mail::isVaildMailAddress($vars->mail_default_from))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_advanced_mailer_sender_email_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_sender_email_is_invalid');
|
||||
}
|
||||
if ($vars->mail_default_reply_to && !Mail::isVaildMailAddress($vars->mail_default_reply_to))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_advanced_mailer_reply_to_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_reply_to_is_invalid');
|
||||
}
|
||||
|
||||
// Validate the mail driver.
|
||||
|
|
@ -560,7 +556,7 @@ class adminAdminController extends admin
|
|||
$mail_driver = $vars->mail_driver;
|
||||
if (!array_key_exists($mail_driver, $mail_drivers))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_advanced_mailer_sending_method_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_sending_method_is_invalid');
|
||||
}
|
||||
|
||||
// Validate the mail driver settings.
|
||||
|
|
@ -570,7 +566,7 @@ class adminAdminController extends admin
|
|||
$conf_value = $vars->{'mail_' . $mail_driver . '_' . $conf_name} ?: null;
|
||||
if (!$conf_value)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_advanced_mailer_smtp_host_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_smtp_host_is_invalid');
|
||||
}
|
||||
$mail_driver_config[$conf_name] = $conf_value;
|
||||
}
|
||||
|
|
@ -580,7 +576,7 @@ class adminAdminController extends admin
|
|||
$sms_driver = $vars->sms_driver;
|
||||
if (!array_key_exists($sms_driver, $sms_drivers))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_advanced_mailer_sending_method_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_sending_method_is_invalid');
|
||||
}
|
||||
|
||||
// Validate the SMS driver settings.
|
||||
|
|
@ -590,7 +586,7 @@ class adminAdminController extends admin
|
|||
$conf_value = $vars->{'sms_' . $sms_driver . '_' . $conf_name} ?: null;
|
||||
if (!$conf_value)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_advanced_mailer_smtp_host_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_smtp_host_is_invalid');
|
||||
}
|
||||
$sms_driver_config[$conf_name] = $conf_value;
|
||||
}
|
||||
|
|
@ -629,7 +625,7 @@ class adminAdminController extends admin
|
|||
Rhymix\Framework\Config::set("sms.allow_split.lms", toBool($vars->allow_split_lms));
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -684,7 +680,7 @@ class adminAdminController extends admin
|
|||
return $item !== '';
|
||||
}));
|
||||
if (!Rhymix\Framework\Filters\IpFilter::validateRanges($allowed_ip)) {
|
||||
return new BaseObject(-1, 'msg_invalid_ip');
|
||||
return $this->setError('msg_invalid_ip');
|
||||
}
|
||||
|
||||
$denied_ip = array_map('trim', preg_split('/[\r\n]/', $vars->admin_denied_ip));
|
||||
|
|
@ -692,13 +688,13 @@ class adminAdminController extends admin
|
|||
return $item !== '';
|
||||
}));
|
||||
if (!Rhymix\Framework\Filters\IpFilter::validateRanges($denied_ip)) {
|
||||
return new BaseObject(-1, 'msg_invalid_ip');
|
||||
return $this->setError('msg_invalid_ip');
|
||||
}
|
||||
|
||||
$oMemberAdminModel = getAdminModel('member');
|
||||
if (!$oMemberAdminModel->getMemberAdminIPCheck($allowed_ip, $denied_ip))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_current_ip_will_be_denied');
|
||||
return $this->setError('msg_current_ip_will_be_denied');
|
||||
}
|
||||
|
||||
Rhymix\Framework\Config::set('admin.allow', array_values($allowed_ip));
|
||||
|
|
@ -707,7 +703,7 @@ class adminAdminController extends admin
|
|||
// Save
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -746,7 +742,7 @@ class adminAdminController extends admin
|
|||
}
|
||||
if (!Rhymix\Framework\Cache::getDriverInstance($vars->object_cache_type, $cache_servers))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cache_handler_not_supported');
|
||||
return $this->setError('msg_cache_handler_not_supported');
|
||||
}
|
||||
Rhymix\Framework\Config::set('cache', array(
|
||||
'type' => $vars->object_cache_type,
|
||||
|
|
@ -801,7 +797,7 @@ class adminAdminController extends admin
|
|||
// Save
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -839,15 +835,15 @@ class adminAdminController extends admin
|
|||
), $log_filename);
|
||||
if (file_exists(RX_BASEDIR . $log_filename_today) && !is_writable(RX_BASEDIR . $log_filename_today))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_debug_log_filename_not_writable');
|
||||
return $this->setError('msg_debug_log_filename_not_writable');
|
||||
}
|
||||
if (!file_exists(dirname(RX_BASEDIR . $log_filename)) && !FileHandler::makeDir(dirname(RX_BASEDIR . $log_filename)))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_debug_log_filename_not_writable');
|
||||
return $this->setError('msg_debug_log_filename_not_writable');
|
||||
}
|
||||
if (!is_writable(dirname(RX_BASEDIR . $log_filename)))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_debug_log_filename_not_writable');
|
||||
return $this->setError('msg_debug_log_filename_not_writable');
|
||||
}
|
||||
Rhymix\Framework\Config::set('debug.log_filename', $log_filename);
|
||||
|
||||
|
|
@ -857,14 +853,14 @@ class adminAdminController extends admin
|
|||
return $item !== '';
|
||||
}));
|
||||
if (!Rhymix\Framework\Filters\IpFilter::validateRanges($allowed_ip)) {
|
||||
return new BaseObject(-1, 'msg_invalid_ip');
|
||||
return $this->setError('msg_invalid_ip');
|
||||
}
|
||||
Rhymix\Framework\Config::set('debug.allow', array_values($allowed_ip));
|
||||
|
||||
// Save
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -896,7 +892,7 @@ class adminAdminController extends admin
|
|||
// Save
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -917,7 +913,7 @@ class adminAdminController extends admin
|
|||
|
||||
if (!Rhymix\Framework\Filters\IpFilter::validateRanges($allowed_ip))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_ip');
|
||||
return $this->setError('msg_invalid_ip');
|
||||
}
|
||||
|
||||
Rhymix\Framework\Config::set('lock.locked', $vars->sitelock_locked === 'Y');
|
||||
|
|
@ -926,7 +922,7 @@ class adminAdminController extends admin
|
|||
Rhymix\Framework\Config::set('lock.allow', array_values($allowed_ip));
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -947,7 +943,7 @@ class adminAdminController extends admin
|
|||
$domain_info = getModel('module')->getSiteInfo($domain_srl);
|
||||
if ($domain_info->domain_srl != $domain_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_domain_not_found');
|
||||
return $this->setError('msg_domain_not_found');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -956,7 +952,7 @@ class adminAdminController extends admin
|
|||
$vars->subtitle = utf8_trim($vars->subtitle);
|
||||
if ($vars->title === '')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_site_title_is_empty');
|
||||
return $this->setError('msg_site_title_is_empty');
|
||||
}
|
||||
|
||||
// Validate the domain.
|
||||
|
|
@ -974,12 +970,12 @@ class adminAdminController extends admin
|
|||
}
|
||||
if (!$vars->domain)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_domain');
|
||||
return $this->setError('msg_invalid_domain');
|
||||
}
|
||||
$existing_domain = getModel('module')->getSiteInfoByDomain($vars->domain);
|
||||
if ($existing_domain && $existing_domain->domain == $vars->domain && (!$domain_info || $existing_domain->domain_srl != $domain_info->domain_srl))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_domain_already_exists');
|
||||
return $this->setError('msg_domain_already_exists');
|
||||
}
|
||||
|
||||
// Validate the ports.
|
||||
|
|
@ -993,11 +989,11 @@ class adminAdminController extends admin
|
|||
}
|
||||
if ($vars->http_port !== 0 && ($vars->http_port < 1 || $vars->http_port > 65535 || $vars->http_port == 443))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_http_port');
|
||||
return $this->setError('msg_invalid_http_port');
|
||||
}
|
||||
if ($vars->https_port !== 0 && ($vars->https_port < 1 || $vars->https_port > 65535 || $vars->https_port == 80))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_https_port');
|
||||
return $this->setError('msg_invalid_https_port');
|
||||
}
|
||||
|
||||
// Validate the security setting.
|
||||
|
|
@ -1011,7 +1007,7 @@ class adminAdminController extends admin
|
|||
$module_info = getModel('module')->getModuleInfoByModuleSrl(intval($vars->index_module_srl));
|
||||
if (!$module_info || $module_info->module_srl != $vars->index_module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_index_module_srl');
|
||||
return $this->setError('msg_invalid_index_module_srl');
|
||||
}
|
||||
|
||||
// Validate the index document setting.
|
||||
|
|
@ -1020,11 +1016,11 @@ class adminAdminController extends admin
|
|||
$oDocument = getModel('document')->getDocument($vars->index_document_srl);
|
||||
if (!$oDocument || !$oDocument->isExists())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_index_document_srl');
|
||||
return $this->setError('msg_invalid_index_document_srl');
|
||||
}
|
||||
if (intval($oDocument->get('module_srl')) !== intval($vars->index_module_srl))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_index_document_srl_module_srl');
|
||||
return $this->setError('msg_invalid_index_document_srl_module_srl');
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1036,14 +1032,14 @@ class adminAdminController extends admin
|
|||
$enabled_lang = Rhymix\Framework\Config::get('locale.enabled_lang');
|
||||
if (!in_array($vars->default_lang, $enabled_lang))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_lang_is_not_enabled');
|
||||
return $this->setError('msg_lang_is_not_enabled');
|
||||
}
|
||||
|
||||
// Validate the default time zone.
|
||||
$timezone_list = Rhymix\Framework\DateTime::getTimezoneList();
|
||||
if (!isset($timezone_list[$vars->default_timezone]))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_timezone');
|
||||
return $this->setError('msg_invalid_timezone');
|
||||
}
|
||||
|
||||
// Clean up the header and footer scripts.
|
||||
|
|
@ -1166,16 +1162,16 @@ class adminAdminController extends admin
|
|||
$domain_srl = strval(Context::get('domain_srl'));
|
||||
if ($domain_srl === '')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_domain_not_found');
|
||||
return $this->setError('msg_domain_not_found');
|
||||
}
|
||||
$domain_info = getModel('module')->getSiteInfo($domain_srl);
|
||||
if ($domain_info->domain_srl != $domain_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_domain_not_found');
|
||||
return $this->setError('msg_domain_not_found');
|
||||
}
|
||||
if ($domain_info->is_default_domain === 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cannot_delete_default_domain');
|
||||
return $this->setError('msg_cannot_delete_default_domain');
|
||||
}
|
||||
|
||||
// Delete the domain.
|
||||
|
|
@ -1208,19 +1204,19 @@ class adminAdminController extends admin
|
|||
{
|
||||
if (!($conn = @ftp_connect($vars->ftp_host, $vars->ftp_port, 3)))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_not_connected');
|
||||
return $this->setError('msg_ftp_not_connected');
|
||||
}
|
||||
if (!@ftp_login($conn, $vars->ftp_user, $vars->ftp_pass))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
if (!@ftp_pasv($conn, $vars->ftp_pasv === 'Y'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_cannot_set_passive_mode');
|
||||
return $this->setError('msg_ftp_cannot_set_passive_mode');
|
||||
}
|
||||
if (!@ftp_chdir($conn, $vars->ftp_path))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_path');
|
||||
return $this->setError('msg_ftp_invalid_path');
|
||||
}
|
||||
ftp_close($conn);
|
||||
}
|
||||
|
|
@ -1228,23 +1224,23 @@ class adminAdminController extends admin
|
|||
{
|
||||
if (!function_exists('ssh2_connect'))
|
||||
{
|
||||
return new BaseObject(-1, 'disable_sftp_support');
|
||||
return $this->setError('disable_sftp_support');
|
||||
}
|
||||
if (!($conn = ssh2_connect($vars->ftp_host, $vars->ftp_port)))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_not_connected');
|
||||
return $this->setError('msg_ftp_not_connected');
|
||||
}
|
||||
if (!@ssh2_auth_password($conn, $vars->ftp_user, $vars->ftp_pass))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
if (!@($sftp = ssh2_sftp($conn)))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_sftp_error');
|
||||
return $this->setError('msg_ftp_sftp_error');
|
||||
}
|
||||
if (!@ssh2_sftp_stat($sftp, $vars->ftp_path . 'common/defaults/config.php'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_path');
|
||||
return $this->setError('msg_ftp_invalid_path');
|
||||
}
|
||||
unset($sftp, $conn);
|
||||
}
|
||||
|
|
@ -1259,7 +1255,7 @@ class adminAdminController extends admin
|
|||
Rhymix\Framework\Config::set('ftp.sftp', $vars->ftp_sftp === 'Y');
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
@ -1280,7 +1276,7 @@ class adminAdminController extends admin
|
|||
Rhymix\Framework\Config::set('ftp.sftp', false);
|
||||
if (!Rhymix\Framework\Config::save())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_failed_to_save_config');
|
||||
return $this->setError('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
$this->setMessage('success_deleted');
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class adminAdminModel extends admin
|
|||
$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
$sftp = ssh2_sftp($connection);
|
||||
|
||||
|
|
@ -112,14 +112,14 @@ class adminAdminModel extends admin
|
|||
$connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!$connection)
|
||||
{
|
||||
return new BaseObject(-1, sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
return $this->setError('msg_ftp_not_connected', 'host');
|
||||
}
|
||||
|
||||
$login_result = @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password);
|
||||
if(!$login_result)
|
||||
{
|
||||
ftp_close($connection);
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
// create temp file
|
||||
|
|
@ -199,7 +199,7 @@ class adminAdminModel extends admin
|
|||
{
|
||||
if(!function_exists('ssh2_sftp'))
|
||||
{
|
||||
return new BaseObject(-1, 'disable_sftp_support');
|
||||
return $this->setError('disable_sftp_support');
|
||||
}
|
||||
return $this->getSFTPPath();
|
||||
}
|
||||
|
|
@ -286,7 +286,7 @@ class adminAdminModel extends admin
|
|||
$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
$sftp = ssh2_sftp($connection);
|
||||
|
|
@ -294,7 +294,7 @@ class adminAdminModel extends admin
|
|||
$dh = @opendir($curpwd);
|
||||
if(!$dh)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_path');
|
||||
return $this->setError('msg_ftp_invalid_path');
|
||||
}
|
||||
$list = array();
|
||||
while(($file = readdir($dh)) !== FALSE)
|
||||
|
|
@ -325,7 +325,7 @@ class adminAdminModel extends admin
|
|||
$ftp_info = Context::getRequestVars();
|
||||
if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
$this->pwd = $ftp_info->ftp_root_path;
|
||||
|
|
@ -344,7 +344,7 @@ class adminAdminModel extends admin
|
|||
{
|
||||
if(!function_exists('ssh2_sftp'))
|
||||
{
|
||||
return new BaseObject(-1, 'disable_sftp_support');
|
||||
return $this->setError('disable_sftp_support');
|
||||
}
|
||||
return $this->getSFTPList();
|
||||
}
|
||||
|
|
@ -359,7 +359,7 @@ class adminAdminModel extends admin
|
|||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
}
|
||||
$list = array();
|
||||
|
|
@ -380,7 +380,7 @@ class adminAdminModel extends admin
|
|||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_no_directory');
|
||||
return $this->setError('msg_ftp_no_directory');
|
||||
}
|
||||
$this->add('list', $list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -662,7 +662,7 @@ class adminAdminView extends admin
|
|||
$domain_info = getModel('module')->getSiteInfo($domain_srl);
|
||||
if ($domain_info->domain_srl != $domain_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_domain_not_found');
|
||||
return $this->setError('msg_domain_not_found');
|
||||
}
|
||||
}
|
||||
Context::set('domain_info', $domain_info);
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ class admin extends ModuleObject
|
|||
|
||||
/**
|
||||
* Install admin module
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -44,7 +44,7 @@ class admin extends ModuleObject
|
|||
|
||||
/**
|
||||
* Update module
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
|
|
@ -68,7 +68,6 @@ class admin extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ class adminlogging extends ModuleObject
|
|||
|
||||
/**
|
||||
* Install adminlogging module
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -32,11 +32,11 @@ class adminlogging extends ModuleObject
|
|||
|
||||
/**
|
||||
* Update module
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
if ($method !== 'default' && !isset($sending_methods[$method]))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_advanced_mailer_sending_method_is_invalid');
|
||||
return $this->setError('msg_advanced_mailer_sending_method_is_invalid');
|
||||
}
|
||||
if ($method !== 'default')
|
||||
{
|
||||
|
|
@ -69,9 +69,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
if (!Rhymix\Framework\Config::get("mail.$method.$conf_name"))
|
||||
{
|
||||
return new BaseObject(-1, sprintf(
|
||||
Context::getLang('msg_advanced_mailer_sending_method_is_not_configured'),
|
||||
Context::getLang('cmd_advanced_mailer_sending_method_' . $method)));
|
||||
return $this->setError('msg_advanced_mailer_sending_method_is_not_configured', lang('cmd_advanced_mailer_sending_method_' . $method));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -157,11 +155,11 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$clear_before_days = intval(Context::get('clear_before_days'));
|
||||
if (!in_array($status, array('success', 'error')))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if ($clear_before_days < 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
|
|
@ -188,11 +186,11 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$clear_before_days = intval(Context::get('clear_before_days'));
|
||||
if (!in_array($status, array('success', 'error')))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if ($clear_before_days < 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
$total_count = $count->data->count;
|
||||
$total_page = max(1, ceil($total_count / 20));
|
||||
|
||||
$output = new BaseObject();
|
||||
$output = new stdClass;
|
||||
$output->total_count = $total_count;
|
||||
$output->total_page = $total_page;
|
||||
$output->page = $page;
|
||||
|
|
|
|||
|
|
@ -208,7 +208,6 @@ class Advanced_Mailer extends ModuleObject
|
|||
public function moduleInstall()
|
||||
{
|
||||
$this->registerTriggers();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -242,7 +241,6 @@ class Advanced_Mailer extends ModuleObject
|
|||
public function moduleUpdate()
|
||||
{
|
||||
$this->registerTriggers();
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
public function recompileCache()
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class autoinstallAdminController extends autoinstall
|
|||
$this->checkInstalled();
|
||||
|
||||
$oAdminController = getAdminController('admin');
|
||||
$output = $oAdminController->cleanFavorite();
|
||||
$oAdminController->cleanFavorite();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ class autoinstallAdminModel extends autoinstall
|
|||
$packageSrl = Context::get('package_srl');
|
||||
if(!$packageSrl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$package = $this->getInstallInfo($packageSrl);
|
||||
|
|
|
|||
|
|
@ -156,8 +156,6 @@ class autoinstall extends ModuleObject
|
|||
{
|
||||
$oDB->addColumn('autoinstall_packages', 'have_instance', 'char', '1', 'N', TRUE);
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ class boardAdminController extends board {
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if($module_info->mid != $mid)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_info->hide_category = Context::get('hide_category') == 'Y' ? 'Y' : 'N';
|
||||
|
|
|
|||
|
|
@ -75,8 +75,6 @@ class board extends ModuleObject
|
|||
$oModuleController->updateSite($site_args);
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -113,8 +111,6 @@ class board extends ModuleObject
|
|||
{
|
||||
$oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after');
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
function moduleUninstall()
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class boardController extends board
|
|||
// check grant
|
||||
if(!$this->grant->write_document)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// setup variables
|
||||
|
|
@ -35,7 +35,7 @@ class boardController extends board
|
|||
// Return error if content is empty.
|
||||
if (is_empty_html_content($obj->content))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_empty_content');
|
||||
return $this->setError('msg_empty_content');
|
||||
}
|
||||
|
||||
// unset document style if not manager
|
||||
|
|
@ -100,14 +100,14 @@ class boardController extends board
|
|||
{
|
||||
if(!$oDocument->isGranted())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Protect admin document
|
||||
$member_info = getModel('member')->getMemberInfoByMemberSrl($oDocument->get('member_srl'));
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_admin_document_no_modify');
|
||||
return $this->setError('msg_admin_document_no_modify');
|
||||
}
|
||||
|
||||
// if document status is temp
|
||||
|
|
@ -131,7 +131,7 @@ class boardController extends board
|
|||
{
|
||||
if($oDocument->get('comment_count') > 0 && !$this->grant->manager)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_protect_update_content');
|
||||
return $this->setError('msg_protect_update_content');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ class boardController extends board
|
|||
{
|
||||
if($oDocument->get('regdate') < date('YmdHis', strtotime('-' . $this->module_info->protect_document_regdate . ' day')))
|
||||
{
|
||||
return new BaseObject(-1, sprintf(lang('msg_protect_regdate_document'), $this->module_info->protect_document_regdate));
|
||||
return $this->setError(sprintf(lang('msg_protect_regdate_document'), $this->module_info->protect_document_regdate));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -228,7 +228,7 @@ class boardController extends board
|
|||
$logged_info = Context::get('logged_info');
|
||||
if(!$update_id)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_no_update_id');
|
||||
return $this->setError('msg_no_update_id');
|
||||
}
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
|
|
@ -240,13 +240,13 @@ class boardController extends board
|
|||
$Exists_log = $oDocumentModel->getUpdateLogAdminisExists($update_log->document_srl);
|
||||
if($Exists_log === true)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_admin_update_log');
|
||||
return $this->setError('msg_admin_update_log');
|
||||
}
|
||||
}
|
||||
|
||||
if(!$update_log)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_no_update_log');
|
||||
return $this->setError('msg_no_update_log');
|
||||
}
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($update_log->document_srl);
|
||||
|
|
@ -275,7 +275,7 @@ class boardController extends board
|
|||
// if the document is not existed
|
||||
if(!$document_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_document');
|
||||
return $this->setError('msg_invalid_document');
|
||||
}
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
|
@ -285,7 +285,7 @@ class boardController extends board
|
|||
{
|
||||
if($oDocument->get('comment_count') > 0 && $this->grant->manager == false)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_protect_delete_content');
|
||||
return $this->setError('msg_protect_delete_content');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ class boardController extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_document');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new BaseObject(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
// generate document module controller object
|
||||
|
|
@ -349,7 +349,7 @@ class boardController extends board
|
|||
// check grant
|
||||
if(!$this->grant->write_comment)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
|
@ -378,7 +378,7 @@ class boardController extends board
|
|||
$oDocument = $oDocumentModel->getDocument($obj->document_srl);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return new BaseObject(-1,'msg_not_founded');
|
||||
return $this->setError('msg_not_founded');
|
||||
}
|
||||
|
||||
// For anonymous use, remove writer's information and notifying information
|
||||
|
|
@ -416,7 +416,7 @@ class boardController extends board
|
|||
$childs = $oCommentModel->getChildComments($obj->comment_srl);
|
||||
if(count($childs) > 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_board_update_protect_comment');
|
||||
return $this->setError('msg_board_update_protect_comment');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -426,7 +426,7 @@ class boardController extends board
|
|||
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_admin_comment_no_modify');
|
||||
return $this->setError('msg_admin_comment_no_modify');
|
||||
}
|
||||
|
||||
// INSERT if comment_srl does not exist.
|
||||
|
|
@ -441,7 +441,7 @@ class boardController extends board
|
|||
$parent_comment = $oCommentModel->getComment($obj->parent_srl);
|
||||
if(!$parent_comment->comment_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if($parent_comment->isSecret() && $this->module_info->secret === 'Y')
|
||||
{
|
||||
|
|
@ -470,13 +470,13 @@ class boardController extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_comment');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new BaseObject(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
// check the grant
|
||||
if(!$comment->isGranted())
|
||||
{
|
||||
return new BaseObject(-1,'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
$obj->parent_srl = $comment->parent_srl;
|
||||
$output = $oCommentController->updateComment($obj, $this->grant->manager);
|
||||
|
|
@ -510,7 +510,7 @@ class boardController extends board
|
|||
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
|
|
@ -520,7 +520,7 @@ class boardController extends board
|
|||
$childs = $oCommentModel->getChildComments($comment_srl);
|
||||
if(count($childs) > 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_board_delete_protect_comment');
|
||||
return $this->setError('msg_board_delete_protect_comment');
|
||||
}
|
||||
}
|
||||
$comment = $oCommentModel->getComment($comment_srl, $this->grant->manager);
|
||||
|
|
@ -530,7 +530,7 @@ class boardController extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_comment');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new BaseObject(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
// generate comment controller object
|
||||
|
|
@ -642,13 +642,13 @@ class boardController extends board
|
|||
$oComment = $oCommentModel->getComment($comment_srl);
|
||||
if(!$oComment->isExists())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// compare the comment password and the user input password
|
||||
if(!$oMemberModel->isValidPassword($oComment->get('password'),$password))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_password');
|
||||
return $this->setError('msg_invalid_password');
|
||||
}
|
||||
|
||||
$oComment->setGrantForSession();
|
||||
|
|
@ -658,13 +658,13 @@ class boardController extends board
|
|||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// compare the document password and the user input password
|
||||
if(!$oMemberModel->isValidPassword($oDocument->get('password'),$password))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_password');
|
||||
return $this->setError('msg_invalid_password');
|
||||
}
|
||||
|
||||
$oDocument->setGrantForSession();
|
||||
|
|
@ -681,7 +681,7 @@ class boardController extends board
|
|||
|
||||
if(!$member_srl || !$mid)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -693,7 +693,7 @@ class boardController extends board
|
|||
|
||||
if($cur_module_info->module != 'board')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// get the member information
|
||||
|
|
@ -707,15 +707,13 @@ class boardController extends board
|
|||
|
||||
if(!$member_info->user_id)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
//search
|
||||
$url = getUrl('','mid',$mid,'search_target','nick_name','search_keyword',$member_info->nick_name);
|
||||
$oMemberController = getController('member');
|
||||
$oMemberController->addMemberPopupMenu($url, 'cmd_view_own_document', '');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -657,18 +657,18 @@ class boardView extends board
|
|||
$document_srl = Context::get('document_srl');
|
||||
if(!$document_srl)
|
||||
{
|
||||
return new BaseObject(-1, "msg_invalid_request");
|
||||
return $this->setError("msg_invalid_request");
|
||||
}
|
||||
|
||||
if($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read))
|
||||
{
|
||||
return new BaseObject(-1, "msg_not_permitted");
|
||||
return $this->setError("msg_not_permitted");
|
||||
}
|
||||
|
||||
$oDocument = getModel('document')->getDocument($document_srl);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return new BaseObject(-1, "msg_invalid_request");
|
||||
return $this->setError("msg_invalid_request");
|
||||
}
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
|
|
@ -765,20 +765,20 @@ class boardView extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_document');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new BaseObject(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
if($this->module_info->protect_content == "Y" || $this->module_info->protect_update_content == 'Y')
|
||||
{
|
||||
if($oDocument->get('comment_count') > 0 && $this->grant->manager == false)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_protect_update_content');
|
||||
return $this->setError('msg_protect_update_content');
|
||||
}
|
||||
}
|
||||
}
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_admin_document_no_modify');
|
||||
return $this->setError('msg_admin_document_no_modify');
|
||||
}
|
||||
|
||||
// if the document is not granted, then back to the password input form
|
||||
|
|
@ -892,7 +892,7 @@ class boardView extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_document');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new BaseObject(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -900,7 +900,7 @@ class boardView extends board
|
|||
{
|
||||
if($oDocument->get('comment_count')>0 && $this->grant->manager == false)
|
||||
{
|
||||
return new BaseObject(-1,'msg_protect_delete_content');
|
||||
return $this->setError('msg_protect_delete_content');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -977,7 +977,7 @@ class boardView extends board
|
|||
// if the parent comment is not existed
|
||||
if(!$parent_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// get the comment
|
||||
|
|
@ -1039,7 +1039,7 @@ class boardView extends board
|
|||
// if the comment is not existed
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// get comment information
|
||||
|
|
@ -1054,7 +1054,7 @@ class boardView extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_comment');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new BaseObject(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
if($this->module_info->protect_update_comment === 'Y' && $this->grant->manager == false)
|
||||
|
|
@ -1062,13 +1062,13 @@ class boardView extends board
|
|||
$childs = $oCommentModel->getChildComments($comment_srl);
|
||||
if(count($childs) > 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_board_update_protect_comment');
|
||||
return $this->setError('msg_board_update_protect_comment');
|
||||
}
|
||||
}
|
||||
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_admin_comment_no_modify');
|
||||
return $this->setError('msg_admin_comment_no_modify');
|
||||
}
|
||||
|
||||
// if the comment is not exited, alert an error message
|
||||
|
|
@ -1122,7 +1122,7 @@ class boardView extends board
|
|||
{
|
||||
$format = lang('msg_protect_regdate_comment');
|
||||
$massage = sprintf($format, $this->module_info->protect_document_regdate);
|
||||
return new BaseObject(-1, $massage);
|
||||
return $this->setError($massage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1132,7 +1132,7 @@ class boardView extends board
|
|||
$childs = $oCommentModel->getChildComments($comment_srl);
|
||||
if(count($childs) > 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_board_delete_protect_comment');
|
||||
return $this->setError('msg_board_delete_protect_comment');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1212,7 +1212,7 @@ class boardView extends board
|
|||
|
||||
if($this->grant->update_view !== true)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$updatelog = $oDocumentModel->getDocumentUpdateLog($document_srl);
|
||||
|
|
@ -1232,7 +1232,7 @@ class boardView extends board
|
|||
|
||||
if($this->grant->update_view !== true)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$update_log = $oDocumentModel->getUpdateLog($update_id);
|
||||
|
|
@ -1268,7 +1268,7 @@ class boardView extends board
|
|||
{
|
||||
iF($this->grant->vote_log_view !== true)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
|
|
@ -1289,7 +1289,7 @@ class boardView extends board
|
|||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_target');
|
||||
return $this->setError('msg_not_target');
|
||||
}
|
||||
|
||||
$output = executeQueryArray($queryId, $args);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class commentAdminController extends comment
|
|||
$comment = $oCommentModel->getComment($comment_srl);
|
||||
if($comment->comment_srl != $comment_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
$document_srl = $comment->document_srl;
|
||||
if(!in_array($document_srl, $updated_documents_arr))
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ class comment extends ModuleObject
|
|||
$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -194,8 +192,6 @@ class comment extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex('comments', 'idx_parent_srl', array('parent_srl'));
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ class commentController extends comment
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
|
|
@ -43,14 +43,14 @@ class commentController extends comment
|
|||
$module_srl = $oComment->get('module_srl');
|
||||
if(!$module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
|
||||
if($comment_config->use_vote_up == 'N')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$point = 1;
|
||||
|
|
@ -61,16 +61,16 @@ class commentController extends comment
|
|||
|
||||
function procCommentVoteUpCancel()
|
||||
{
|
||||
if(!Context::get('logged_info')) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!Context::get('logged_info')) return $this->setError('msg_invalid_request');
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$comment_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
|
||||
if($oComment->get('voted_count') <= 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_comment_voted_cancel_not');
|
||||
return $this->setError('msg_comment_voted_cancel_not');
|
||||
}
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
|
||||
|
|
@ -90,13 +90,13 @@ class commentController extends comment
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
|
|
@ -104,14 +104,14 @@ class commentController extends comment
|
|||
$module_srl = $oComment->get('module_srl');
|
||||
if(!$module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
|
||||
if($comment_config->use_vote_down == 'N')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$point = -1;
|
||||
|
|
@ -122,16 +122,16 @@ class commentController extends comment
|
|||
|
||||
function procCommentVoteDownCancel()
|
||||
{
|
||||
if(!Context::get('logged_info')) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!Context::get('logged_info')) return $this->setError('msg_invalid_request');
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$comment_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
|
||||
if($oComment->get('blamed_count') >= 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_comment_blamed_cancel_not');
|
||||
return $this->setError('msg_comment_blamed_cancel_not');
|
||||
}
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
|
||||
|
|
@ -193,13 +193,13 @@ class commentController extends comment
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// if an user select message from options, message would be the option.
|
||||
|
|
@ -226,7 +226,7 @@ class commentController extends comment
|
|||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
return $this->deleteComments($document_srl, $obj);
|
||||
|
|
@ -241,7 +241,7 @@ class commentController extends comment
|
|||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$oCommentController = getAdminController('comment');
|
||||
|
|
@ -1622,13 +1622,13 @@ class commentController extends comment
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_grant = $oModuleModel->getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$module_srl[] = $srl;
|
||||
|
|
@ -1692,7 +1692,7 @@ class commentController extends comment
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$commentSrls = Context::get('comment_srls');
|
||||
|
|
|
|||
|
|
@ -976,7 +976,7 @@ class commentModel extends comment
|
|||
$comment_srl = Context::get('comment_srl');
|
||||
if(!$comment_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$point = Context::get('point');
|
||||
|
|
@ -990,7 +990,7 @@ class commentModel extends comment
|
|||
$module_srl = $oComment->get('module_srl');
|
||||
if(!$module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -1002,7 +1002,7 @@ class commentModel extends comment
|
|||
{
|
||||
if($comment_config->use_vote_down != 'S')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args->below_point = 0;
|
||||
|
|
@ -1011,7 +1011,7 @@ class commentModel extends comment
|
|||
{
|
||||
if($comment_config->use_vote_up != 'S')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args->more_point = 0;
|
||||
|
|
|
|||
|
|
@ -82,12 +82,12 @@ class commentView extends comment
|
|||
$oComment = $oCommentModel->getComment($comment_srl);
|
||||
if(!$oComment->isExists())
|
||||
{
|
||||
return new BaseObject(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
// Check permissions
|
||||
if(!$oComment->isAccessible())
|
||||
{
|
||||
return new BaseObject(-1,'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Browser title settings
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ class communication extends ModuleObject
|
|||
|
||||
// Create a temporary file storage for one new private message notification
|
||||
FileHandler::makeDir('./files/member_extra_info/new_message_flags');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -96,8 +94,6 @@ class communication extends ModuleObject
|
|||
{
|
||||
FileHandler::makeDir('./files/member_extra_info/new_message_flags');
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class communicationController extends communication
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -54,7 +54,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -63,19 +63,19 @@ class communicationController extends communication
|
|||
$receiver_srl = Context::get('receiver_srl');
|
||||
if(!$receiver_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_exists_member');
|
||||
return $this->setError('msg_not_exists_member');
|
||||
}
|
||||
|
||||
$title = trim(Context::get('title'));
|
||||
if(!$title)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_title_is_null');
|
||||
return $this->setError('msg_title_is_null');
|
||||
}
|
||||
|
||||
$content = trim(Context::get('content'));
|
||||
if(!$content)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_content_is_null');
|
||||
return $this->setError('msg_content_is_null');
|
||||
}
|
||||
|
||||
$send_mail = Context::get('send_mail');
|
||||
|
|
@ -91,13 +91,13 @@ class communicationController extends communication
|
|||
|
||||
if(!$oCommunicationModel->checkGrant($config->grant_send))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
|
||||
if($receiver_member_info->member_srl != $receiver_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_exists_member');
|
||||
return $this->setError('msg_not_exists_member');
|
||||
}
|
||||
|
||||
// check whether to allow to receive the message(pass if a top-administrator)
|
||||
|
|
@ -107,12 +107,12 @@ class communicationController extends communication
|
|||
{
|
||||
if(!$oCommunicationModel->isFriend($receiver_member_info->member_srl))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_allow_message_to_friend');
|
||||
return $this->setError('msg_allow_message_to_friend');
|
||||
}
|
||||
}
|
||||
else if($receiver_member_info->allow_message == 'N')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_disallow_message');
|
||||
return $this->setError('msg_disallow_message');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -269,7 +269,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ class communicationController extends communication
|
|||
$message_srl = Context::get('message_srl');
|
||||
if(!$message_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// get the message
|
||||
|
|
@ -285,7 +285,7 @@ class communicationController extends communication
|
|||
$message = $oCommunicationModel->getSelectedMessage($message_srl);
|
||||
if(!$message || $message->message_type != 'R')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -309,7 +309,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -319,7 +319,7 @@ class communicationController extends communication
|
|||
$message_srl = Context::get('message_srl');
|
||||
if(!$message_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Get the message
|
||||
|
|
@ -327,7 +327,7 @@ class communicationController extends communication
|
|||
$message = $oCommunicationModel->getSelectedMessage($message_srl);
|
||||
if(!$message)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Check the grant
|
||||
|
|
@ -336,14 +336,14 @@ class communicationController extends communication
|
|||
case 'S':
|
||||
if($message->sender_srl != $member_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
if($message->receiver_srl != $member_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -369,7 +369,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -378,7 +378,7 @@ class communicationController extends communication
|
|||
// check variables
|
||||
if(!Context::get('message_srl_list'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
$message_srl_list = Context::get('message_srl_list');
|
||||
|
|
@ -389,13 +389,13 @@ class communicationController extends communication
|
|||
|
||||
if(!count($message_srl_list))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
$message_type = Context::get('message_type');
|
||||
if(!$message_type || !in_array($message_type, array('R', 'S', 'T')))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$message_count = count($message_srl_list);
|
||||
|
|
@ -412,7 +412,7 @@ class communicationController extends communication
|
|||
}
|
||||
if(!count($target))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
// Delete
|
||||
|
|
@ -450,7 +450,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -458,11 +458,11 @@ class communicationController extends communication
|
|||
$target_srl = (int) trim(Context::get('target_srl'));
|
||||
if(!$target_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if($target_srl == $logged_info->member_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_no_self_friend');
|
||||
return $this->setError('msg_no_self_friend');
|
||||
}
|
||||
|
||||
// Check duplicate friend
|
||||
|
|
@ -472,7 +472,7 @@ class communicationController extends communication
|
|||
$output = executeQuery('communication.isAddedFriend', $args);
|
||||
if($output->data->count)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_already_friend');
|
||||
return $this->setError('msg_already_friend');
|
||||
}
|
||||
|
||||
// Variable
|
||||
|
|
@ -512,7 +512,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -521,7 +521,7 @@ class communicationController extends communication
|
|||
$friend_srl_list = Context::get('friend_srl_list');
|
||||
if(!$friend_srl_list)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
if(!is_array($friend_srl_list))
|
||||
|
|
@ -531,7 +531,7 @@ class communicationController extends communication
|
|||
|
||||
if(!count($friend_srl_list))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
$friend_count = count($friend_srl_list);
|
||||
|
|
@ -549,7 +549,7 @@ class communicationController extends communication
|
|||
|
||||
if(!count($target))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
// Variables
|
||||
|
|
@ -579,7 +579,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -595,7 +595,7 @@ class communicationController extends communication
|
|||
|
||||
if(!count($friend_srl_list))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
$friend_count = count($friend_srl_list);
|
||||
|
|
@ -614,7 +614,7 @@ class communicationController extends communication
|
|||
|
||||
if(!count($target))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cart_is_null');
|
||||
return $this->setError('msg_cart_is_null');
|
||||
}
|
||||
|
||||
// Delete
|
||||
|
|
@ -642,7 +642,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -656,7 +656,7 @@ class communicationController extends communication
|
|||
|
||||
if(!$args->title)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// modify if friend_group_srl exists.
|
||||
|
|
@ -718,7 +718,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -732,7 +732,7 @@ class communicationController extends communication
|
|||
|
||||
if(!$args->title)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$output = executeQuery('communication.renameFriendGroup', $args);
|
||||
|
|
@ -753,7 +753,7 @@ class communicationController extends communication
|
|||
// Check login information
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -831,7 +831,7 @@ class communicationController extends communication
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$oCommunicationModel = getModel('communication');
|
||||
|
|
@ -839,11 +839,11 @@ class communicationController extends communication
|
|||
|
||||
if($config->enable_message == 'N' && $config->enable_friend == 'N')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
if(!$oCommunicationModel->checkGrant($config->grant_send))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$mid = Context::get('cur_mid');
|
||||
|
|
@ -874,7 +874,7 @@ class communicationController extends communication
|
|||
$target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
|
||||
if(!$target_member_info->member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Add a menu for sending message
|
||||
|
|
|
|||
|
|
@ -52,13 +52,13 @@ class communicationView extends communication
|
|||
{
|
||||
if($this->config->enable_message == 'N')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -86,28 +86,28 @@ class communicationView extends communication
|
|||
case 'R':
|
||||
if($message->receiver_srl != $logged_info->member_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
if($message->sender_srl != $logged_info->member_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
if($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
if($message->receiver_srl != $logged_info->member_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ class counter extends ModuleObject
|
|||
|
||||
// add a row for today's status
|
||||
//$oCounterController->insertTodayStatus();
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -67,8 +65,6 @@ class counter extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex('counter_log', 'idx_site_counter_log', array('site_srl', 'ipaddress'), FALSE);
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ class documentAdminController extends document
|
|||
$eid = Context::get('eid');
|
||||
$obj = new stdClass();
|
||||
|
||||
if(!$module_srl || !$name || !$eid) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_srl || !$name || !$eid) return $this->setError('msg_invalid_request');
|
||||
// set the max value if idx is not specified
|
||||
if(!$var_idx)
|
||||
{
|
||||
|
|
@ -573,7 +573,7 @@ class documentAdminController extends document
|
|||
$output = executeQuery('document.isExistsExtraKey', $obj);
|
||||
if(!$output->toBool() || $output->data->count)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_extra_name_exists');
|
||||
return $this->setError('msg_extra_name_exists');
|
||||
}
|
||||
|
||||
// insert or update
|
||||
|
|
@ -595,7 +595,7 @@ class documentAdminController extends document
|
|||
{
|
||||
$module_srl = Context::get('module_srl');
|
||||
$var_idx = Context::get('var_idx');
|
||||
if(!$module_srl || !$var_idx) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_srl || !$var_idx) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentController = getController('document');
|
||||
$output = $oDocumentController->deleteDocumentExtraKeys($module_srl, $var_idx);
|
||||
|
|
@ -614,26 +614,26 @@ class documentAdminController extends document
|
|||
$module_srl = Context::get('module_srl');
|
||||
$var_idx = Context::get('var_idx');
|
||||
|
||||
if(!$type || !$module_srl || !$var_idx) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$type || !$module_srl || !$var_idx) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$module_info->module_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_info->module_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$extra_keys = $oDocumentModel->getExtraKeys($module_srl);
|
||||
if(!$extra_keys[$var_idx]) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$extra_keys[$var_idx]) return $this->setError('msg_invalid_request');
|
||||
|
||||
if($type == 'up') $new_idx = $var_idx-1;
|
||||
else $new_idx = $var_idx+1;
|
||||
if($new_idx<1) return new BaseObject(-1,'msg_invalid_request');
|
||||
if($new_idx<1) return $this->setError('msg_invalid_request');
|
||||
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_srl;
|
||||
$args->var_idx = $new_idx;
|
||||
$output = executeQuery('document.getDocumentExtraKeys', $args);
|
||||
if (!$output->toBool()) return $output;
|
||||
if (!$output->data) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if (!$output->data) return $this->setError('msg_invalid_request');
|
||||
unset($args);
|
||||
|
||||
// update immediately if there is no idx to change
|
||||
|
|
@ -737,7 +737,7 @@ class documentAdminController extends document
|
|||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($oDocument->get('member_srl'));
|
||||
if($member_info->is_admin == 'Y' && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_admin_document_no_move_to_trash');
|
||||
return $this->setError('msg_admin_document_no_move_to_trash');
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -882,7 +882,7 @@ class documentAdminController extends document
|
|||
|
||||
//DB restore
|
||||
$output = $oDocumentController->insertDocument($originObject, false, true, false);
|
||||
if(!$output->toBool()) return new BaseObject(-1, $output->getMessage());
|
||||
if(!$output->toBool()) return $this->setError($output->getMessage());
|
||||
|
||||
//FILE restore
|
||||
$oDocument = $oDocumentModel->getDocument($originObject->document_srl);
|
||||
|
|
|
|||
|
|
@ -47,8 +47,6 @@ class document extends ModuleObject
|
|||
|
||||
// 2009. 01. 29 Added a trigger for additional setup
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -341,8 +339,6 @@ class document extends ModuleObject
|
|||
$oDB->addColumn('document_update_log', 'is_admin', 'varchar', 1);
|
||||
$oDB->addIndex('document_update_log', 'idx_is_admin', array('is_admin'));
|
||||
}
|
||||
|
||||
return new BaseObject(0,'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -28,21 +28,21 @@ class documentController extends document
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
}
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$document_config = $oModuleModel->getModulePartConfig('document',$module_srl);
|
||||
if($document_config->use_vote_up=='N') return new BaseObject(-1, 'msg_invalid_request');
|
||||
if($document_config->use_vote_up=='N') return $this->setError('msg_invalid_request');
|
||||
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCount($document_srl, $point);
|
||||
|
|
@ -60,18 +60,18 @@ class documentController extends document
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
}
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
if($oDocument->get('voted_count') <= 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_document_voted_cancel_not');
|
||||
return $this->setError('msg_document_voted_cancel_not');
|
||||
}
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCountCancel($document_srl, $oDocument, $point);
|
||||
|
|
@ -114,21 +114,21 @@ class documentController extends document
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
}
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$document_config = $oModuleModel->getModulePartConfig('document',$module_srl);
|
||||
if($document_config->use_vote_down=='N') return new BaseObject(-1, 'msg_invalid_request');
|
||||
if($document_config->use_vote_down=='N') return $this->setError('msg_invalid_request');
|
||||
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCount($document_srl, $point);
|
||||
|
|
@ -146,18 +146,18 @@ class documentController extends document
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
}
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
if($oDocument->get('blamed_count') >= 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_document_voted_cancel_not');
|
||||
return $this->setError('msg_document_voted_cancel_not');
|
||||
}
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCountCancel($document_srl, $oDocument, $point);
|
||||
|
|
@ -229,13 +229,13 @@ class documentController extends document
|
|||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$document_srl = intval(Context::get('target_srl'));
|
||||
if(!$document_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// if an user select message from options, message would be the option.
|
||||
|
|
@ -302,7 +302,7 @@ class documentController extends document
|
|||
function triggerDeleteModuleDocuments(&$obj)
|
||||
{
|
||||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl) return new BaseObject();
|
||||
if(!$module_srl) return;
|
||||
// Delete the document
|
||||
$oDocumentAdminController = getAdminController('document');
|
||||
$output = $oDocumentAdminController->deleteModuleDocument($module_srl);
|
||||
|
|
@ -319,8 +319,6 @@ class documentController extends document
|
|||
|
||||
// remove histories
|
||||
$this->deleteDocumentHistory(null, null, $module_srl);
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -490,7 +488,7 @@ class documentController extends document
|
|||
if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content);
|
||||
|
||||
// An error appears if both log-in info and user name don't exist.
|
||||
if(!$logged_info->member_srl && !$obj->nick_name) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$logged_info->member_srl && !$obj->nick_name) return new BaseObject(-1, 'msg_invalid_request');
|
||||
|
||||
// Fix encoding of non-BMP UTF-8 characters.
|
||||
$obj->title = utf8_mbencode($obj->title);
|
||||
|
|
@ -581,7 +579,7 @@ class documentController extends document
|
|||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
if(!$source_obj->document_srl || !$obj->document_srl) return new BaseObject(-1,'msg_invalied_request');
|
||||
if(!$source_obj->document_srl || !$obj->document_srl) return new BaseObject(-1, 'msg_invalied_request');
|
||||
|
||||
// Default Status
|
||||
if($obj->status)
|
||||
|
|
@ -1245,7 +1243,7 @@ class documentController extends document
|
|||
*/
|
||||
function insertDocumentExtraKey($module_srl, $var_idx, $var_name, $var_type, $var_is_required = 'N', $var_search = 'N', $var_default = '', $var_desc = '', $eid)
|
||||
{
|
||||
if(!$module_srl || !$var_idx || !$var_name || !$var_type || !$eid) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_srl || !$var_idx || !$var_name || !$var_type || !$eid) return new BaseObject(-1, 'msg_invalid_request');
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->module_srl = $module_srl;
|
||||
|
|
@ -1282,7 +1280,7 @@ class documentController extends document
|
|||
*/
|
||||
function deleteDocumentExtraKeys($module_srl, $var_idx = null)
|
||||
{
|
||||
if(!$module_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
$obj = new stdClass();
|
||||
$obj->module_srl = $module_srl;
|
||||
if(!is_null($var_idx)) $obj->var_idx = $var_idx;
|
||||
|
|
@ -1342,7 +1340,7 @@ class documentController extends document
|
|||
*/
|
||||
function insertDocumentExtraVar($module_srl, $document_srl, $var_idx, $value, $eid = null, $lang_code = '')
|
||||
{
|
||||
if(!$module_srl || !$document_srl || !$var_idx || !isset($value)) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_srl || !$document_srl || !$var_idx || !isset($value)) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$lang_code) $lang_code = Context::getLangType();
|
||||
|
||||
$obj = new stdClass;
|
||||
|
|
@ -1843,9 +1841,9 @@ class documentController extends document
|
|||
$prev_category = $val;
|
||||
}
|
||||
// Return if the previous category doesn't exist
|
||||
if(!$prev_category) return new BaseObject(-1,lang('msg_category_not_moved'));
|
||||
if(!$prev_category) return new BaseObject(-1, 'msg_category_not_moved');
|
||||
// Return if the selected category is the top level
|
||||
if($category_srl_list[0]==$category_srl) return new BaseObject(-1,lang('msg_category_not_moved'));
|
||||
if($category_srl_list[0]==$category_srl) return new BaseObject(-1, 'msg_category_not_moved');
|
||||
// Information of the selected category
|
||||
$cur_args = new stdClass;
|
||||
$cur_args->category_srl = $category_srl;
|
||||
|
|
@ -1889,7 +1887,7 @@ class documentController extends document
|
|||
}
|
||||
|
||||
$next_category_srl = $category_srl_list[$i+1];
|
||||
if(!$category_list[$next_category_srl]) return new BaseObject(-1,lang('msg_category_not_moved'));
|
||||
if(!$category_list[$next_category_srl]) return new BaseObject(-1, 'msg_category_not_moved');
|
||||
$next_category = $category_list[$next_category_srl];
|
||||
// Information of the selected category
|
||||
$cur_args = new stdClass;
|
||||
|
|
@ -1969,7 +1967,7 @@ class documentController extends document
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl, $columnList);
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
|
||||
|
||||
if($args->expand !="Y") $args->expand = "N";
|
||||
if(!is_array($args->group_srls)) $args->group_srls = str_replace('|@|',',',$args->group_srls);
|
||||
|
|
@ -2039,7 +2037,7 @@ class documentController extends document
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($source_category->module_srl, $columnList);
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
|
||||
|
||||
// First child of the parent_category_srl
|
||||
$source_args = new stdClass;
|
||||
|
|
@ -2100,7 +2098,7 @@ class documentController extends document
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl, $columnList);
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
// Get original information
|
||||
|
|
@ -2141,7 +2139,7 @@ class documentController extends document
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
|
||||
|
||||
$xml_file = $this->makeCategoryFile($module_srl);
|
||||
// Set return value
|
||||
|
|
@ -2466,7 +2464,7 @@ class documentController extends document
|
|||
*/
|
||||
function procDocumentAddCart()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
|
||||
// Get document_srl
|
||||
$srls = explode(',',Context::get('srls'));
|
||||
|
|
@ -2540,7 +2538,7 @@ class documentController extends document
|
|||
function procDocumentManageCheckedDocument()
|
||||
{
|
||||
@set_time_limit(0);
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// Get request parameters.
|
||||
|
|
@ -2596,13 +2594,13 @@ class documentController extends document
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_grant = $oModuleModel->getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2612,22 +2610,22 @@ class documentController extends document
|
|||
|
||||
if($type == 'move')
|
||||
{
|
||||
if(!$target_module_srl) return new BaseObject(-1, 'fail_to_move');
|
||||
if(!$target_module_srl) return $this->setError('fail_to_move');
|
||||
|
||||
$oDocumentAdminController = getAdminController('document');
|
||||
$output = $oDocumentAdminController->moveDocumentModule($document_srl_list, $target_module_srl, $target_category_srl);
|
||||
if(!$output->toBool()) return new BaseObject(-1, 'fail_to_move');
|
||||
if(!$output->toBool()) return $this->setError('fail_to_move');
|
||||
|
||||
$msg_code = 'success_moved';
|
||||
|
||||
}
|
||||
else if($type == 'copy')
|
||||
{
|
||||
if(!$target_module_srl) return new BaseObject(-1, 'fail_to_move');
|
||||
if(!$target_module_srl) return $this->setError('fail_to_move');
|
||||
|
||||
$oDocumentAdminController = getAdminController('document');
|
||||
$output = $oDocumentAdminController->copyDocumentModule($document_srl_list, $target_module_srl, $target_category_srl);
|
||||
if(!$output->toBool()) return new BaseObject(-1, 'fail_to_move');
|
||||
if(!$output->toBool()) return $this->setError('fail_to_move');
|
||||
|
||||
$msg_code = 'success_copied';
|
||||
}
|
||||
|
|
@ -2638,7 +2636,7 @@ class documentController extends document
|
|||
foreach ($document_srl_list as $document_srl)
|
||||
{
|
||||
$output = $this->deleteDocument($document_srl, true);
|
||||
if(!$output->toBool()) return new BaseObject(-1, 'fail_to_delete');
|
||||
if(!$output->toBool()) return $this->setError('fail_to_delete');
|
||||
}
|
||||
$oDB->commit();
|
||||
$msg_code = 'success_deleted';
|
||||
|
|
@ -2654,7 +2652,7 @@ class documentController extends document
|
|||
{
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $this->moveDocumentToTrash($args);
|
||||
if(!$output || !$output->toBool()) return new BaseObject(-1, 'fail_to_trash');
|
||||
if(!$output || !$output->toBool()) return $this->setError('fail_to_trash');
|
||||
}
|
||||
$oDB->commit();
|
||||
$msg_code = 'success_trashed';
|
||||
|
|
@ -2712,13 +2710,13 @@ class documentController extends document
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_grant = $oModuleModel->getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$module_srl[] = $srl;
|
||||
|
|
@ -2757,7 +2755,7 @@ class documentController extends document
|
|||
{
|
||||
if(!$this->module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$obj = Context::getRequestVars();
|
||||
|
|
@ -2780,12 +2778,12 @@ class documentController extends document
|
|||
{
|
||||
if(!$oDocument->isGranted())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
if($oDocument->get('status') != $this->getConfigStatus('temp'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$output = $this->updateDocument($oDocument, $obj);
|
||||
|
|
@ -2817,7 +2815,7 @@ class documentController extends document
|
|||
*/
|
||||
function procDocumentGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$documentSrls = Context::get('document_srls');
|
||||
if($documentSrls) $documentSrlList = explode(',', $documentSrls);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class documentModel extends document
|
|||
{
|
||||
if(!is_array($documentSrls) || count($documentSrls) == 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -508,7 +508,7 @@ class documentModel extends document
|
|||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false, $columnList);
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
$member_srl = $oDocument->get('member_srl');
|
||||
if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$document_config = $oModuleModel->getModulePartConfig('document',$module_srl);
|
||||
|
|
@ -915,7 +915,7 @@ class documentModel extends document
|
|||
*/
|
||||
function getDocumentCategories()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$module_srl = Context::get('module_srl');
|
||||
$categories= $this->getCategoryList($module_srl);
|
||||
$lang = Context::get('lang');
|
||||
|
|
@ -1010,13 +1010,13 @@ class documentModel extends document
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
// Check permissions
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return $this->setError('msg_not_permitted');
|
||||
|
||||
$category_srl = Context::get('category_srl');
|
||||
$category_info = $this->getCategory($category_srl);
|
||||
if(!$category_info)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$this->add('category_info', $category_info);
|
||||
|
|
@ -1198,7 +1198,7 @@ class documentModel extends document
|
|||
{
|
||||
$args = new stdClass;
|
||||
$document_srl = Context::get('document_srl');
|
||||
if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$point = Context::get('point');
|
||||
if($point != -1) $point = 1;
|
||||
|
|
@ -1207,18 +1207,18 @@ class documentModel extends document
|
|||
$columnList = array('document_srl', 'module_srl');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false, $columnList);
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$document_config = $oModuleModel->getModulePartConfig('document',$module_srl);
|
||||
if($point == -1)
|
||||
{
|
||||
if($document_config->use_vote_down!='S') return new BaseObject(-1, 'msg_invalid_request');
|
||||
if($document_config->use_vote_down!='S') return $this->setError('msg_invalid_request');
|
||||
$args->below_point = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($document_config->use_vote_up!='S') return new BaseObject(-1, 'msg_invalid_request');
|
||||
if($document_config->use_vote_up!='S') return $this->setError('msg_invalid_request');
|
||||
$args->more_point = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ class documentView extends document
|
|||
$oDocumentModel = getModel('document');
|
||||
// Creates an object for displaying the selected document
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
|
||||
if(!$oDocument->isExists()) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$oDocument->isExists()) return $this->setError('msg_invalid_request');
|
||||
// Check permissions
|
||||
if(!$oDocument->isAccessible()) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!$oDocument->isAccessible()) return $this->setError('msg_not_permitted');
|
||||
// Information setting module
|
||||
//Context::set('module_info', $module_info); //module_info not use in UI
|
||||
// Browser title settings
|
||||
|
|
@ -58,7 +58,7 @@ class documentView extends document
|
|||
{
|
||||
if(!checkCSRF())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$content = Context::get('content');
|
||||
|
|
@ -87,7 +87,7 @@ class documentView extends document
|
|||
*/
|
||||
function dispDocumentManageDocument()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
// Taken from a list of selected sessions
|
||||
$flag_list = $_SESSION['document_management'];
|
||||
if(count($flag_list))
|
||||
|
|
@ -215,12 +215,12 @@ class documentView extends document
|
|||
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager, FALSE);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return new BaseObject(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
// Check permissions
|
||||
if(!$oDocument->isAccessible())
|
||||
{
|
||||
return new BaseObject(-1,'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Browser title settings
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ class editorAdminController extends editor
|
|||
// Check if the component exists
|
||||
if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
|
||||
else $output = executeQuery('editor.isSiteComponentInserted', $args);
|
||||
if($output->data->count) return new BaseObject(-1, 'msg_component_is_not_founded');
|
||||
if($output->data->count) return $this->setError('msg_component_is_not_founded');
|
||||
// Inert a component
|
||||
$args->list_order = getNextSequence();
|
||||
if(!$site_srl) $output = executeQuery('editor.insertComponent', $args);
|
||||
|
|
|
|||
|
|
@ -83,8 +83,6 @@ class editor extends ModuleObject
|
|||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
|
||||
// 2009. 04. 14 Add a trigger from compiled codes of the editor component
|
||||
$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -151,8 +149,6 @@ class editor extends ModuleObject
|
|||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -47,18 +47,18 @@ class editorController extends editor
|
|||
{
|
||||
$component = Context::get('component');
|
||||
$method = Context::get('method');
|
||||
if(!$component) return new BaseObject(-1, sprintf(lang('msg_component_is_not_founded'), $component));
|
||||
if(!$component) return $this->setError('msg_component_is_not_founded', $component);
|
||||
|
||||
$oEditorModel = getModel('editor');
|
||||
$oComponent = &$oEditorModel->getComponentObject($component);
|
||||
if(!$oComponent->toBool()) return $oComponent;
|
||||
|
||||
if(!method_exists($oComponent, $method)) return new BaseObject(-1, sprintf(lang('msg_component_is_not_founded'), $component));
|
||||
if(!method_exists($oComponent, $method)) return $this->setError('msg_component_is_not_founded', $component);
|
||||
|
||||
//$output = call_user_method($method, $oComponent);
|
||||
//$output = call_user_func(array($oComponent, $method));
|
||||
if(method_exists($oComponent, $method)) $output = $oComponent->{$method}();
|
||||
else return new BaseObject(-1,sprintf('%s method is not exists', $method));
|
||||
else return $this->setError('%s method is not exists', $method);
|
||||
|
||||
if($output instanceof Object && !$output->toBool()) return $output;
|
||||
|
||||
|
|
@ -93,13 +93,13 @@ class editorController extends editor
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_grant = $oModuleModel->getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$module_srl[] = $srl;
|
||||
|
|
@ -171,7 +171,7 @@ class editorController extends editor
|
|||
*/
|
||||
function triggerEditorComponentCompile(&$content)
|
||||
{
|
||||
if(Context::getResponseMethod()!='HTML') return new BaseObject();
|
||||
if(Context::getResponseMethod() !== 'HTML') return;
|
||||
|
||||
$module_info = Context::get('module_info');
|
||||
$module_srl = $module_info->module_srl;
|
||||
|
|
@ -253,7 +253,6 @@ class editorController extends editor
|
|||
}
|
||||
|
||||
$content = $this->transComponent($content);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -350,7 +349,6 @@ class editorController extends editor
|
|||
function triggerDeleteSavedDoc(&$obj)
|
||||
{
|
||||
$this->deleteSavedDoc(false);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -466,11 +466,11 @@ class editorModel extends editor
|
|||
// Create an object of the component and execute
|
||||
$class_path = sprintf('%scomponents/%s/', $this->module_path, $component);
|
||||
$class_file = sprintf('%s%s.class.php', $class_path, $component);
|
||||
if(!file_exists($class_file)) return new BaseObject(-1, sprintf(lang('msg_component_is_not_founded'), $component));
|
||||
if(!file_exists($class_file)) return $this->setError('msg_component_is_not_founded', $component);
|
||||
// Create an object after loading the class file
|
||||
require_once($class_file);
|
||||
$oComponent = new $component($editor_sequence, $class_path);
|
||||
if(!$oComponent) return new BaseObject(-1, sprintf(lang('msg_component_is_not_founded'), $component));
|
||||
if(!$oComponent) return $this->setError('msg_component_is_not_founded', $component);
|
||||
// Add configuration information
|
||||
$component_info = $this->getComponent($component, $site_srl);
|
||||
$oComponent->setInfo($component_info);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class fileAdminController extends file
|
|||
{
|
||||
if ($config->allowed_filesize > 2047 || $config->allowed_attach_size > 2047)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_32bit_max_2047mb');
|
||||
return $this->setError('msg_32bit_max_2047mb');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ class fileAdminController extends file
|
|||
{
|
||||
if ($file_config->allowed_filesize > 2047 || $file_config->allowed_attach_size > 2047)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_32bit_max_2047mb');
|
||||
return $this->setError('msg_32bit_max_2047mb');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ class file extends ModuleObject
|
|||
$oModuleController->insertTrigger('module.deleteModule', 'file', 'controller', 'triggerDeleteModuleFiles', 'after');
|
||||
// 2007. 10. 19 Call a trigger to set up the file permissions before displaying
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'file', 'view', 'triggerDispFileAdditionSetup', 'before');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -142,8 +140,6 @@ class file extends ModuleObject
|
|||
}
|
||||
|
||||
if(!$oDB->isColumnExists('files', 'cover_image')) $oDB->addColumn('files', 'cover_image', 'char', '1', 'N');
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class fileController extends file
|
|||
// Exit a session if there is neither upload permission nor information
|
||||
if(!$_SESSION['upload_info'][$editor_sequence]->enabled)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Get upload_target_srl
|
||||
|
|
@ -63,7 +63,7 @@ class fileController extends file
|
|||
$total_size = intval($matches[3]);
|
||||
if ($chunk_start < 0 || $chunk_size < 0 || $total_size < 0 || $chunk_start + $chunk_size > $total_size || $chunk_size != $file_info['size'])
|
||||
{
|
||||
return new BaseObject(-1, 'msg_upload_invalid_chunk');
|
||||
return $this->setError('msg_upload_invalid_chunk');
|
||||
}
|
||||
$this->add('chunk_current_size', $chunk_size);
|
||||
$this->add('chunk_uploaded_size', $chunk_start);
|
||||
|
|
@ -76,13 +76,13 @@ class fileController extends file
|
|||
{
|
||||
Rhymix\Framework\Storage::delete($temp_filename);
|
||||
$this->add('chunk_status', 11);
|
||||
return new BaseObject(-1, 'msg_upload_invalid_chunk');
|
||||
return $this->setError('msg_upload_invalid_chunk');
|
||||
}
|
||||
if ($chunk_start != 0 && (!Rhymix\Framework\Storage::isFile($temp_filename) || Rhymix\Framework\Storage::getSize($temp_filename) != $chunk_start))
|
||||
{
|
||||
Rhymix\Framework\Storage::delete($temp_filename);
|
||||
$this->add('chunk_status', 12);
|
||||
return new BaseObject(-1, 'msg_upload_invalid_chunk');
|
||||
return $this->setError('msg_upload_invalid_chunk');
|
||||
}
|
||||
|
||||
// Check size limit
|
||||
|
|
@ -95,13 +95,13 @@ class fileController extends file
|
|||
if ($total_size > $allowed_filesize)
|
||||
{
|
||||
$this->add('chunk_status', 21);
|
||||
return new BaseObject(-1, 'msg_exceeds_limit_size');
|
||||
return $this->setError('msg_exceeds_limit_size');
|
||||
}
|
||||
$output = executeQuery('file.getAttachedFileSize', (object)array('upload_target_srl' => $upload_target_srl));
|
||||
if (intval($output->data->attached_size) + $total_size > $allowed_attach_size)
|
||||
{
|
||||
$this->add('chunk_status', 22);
|
||||
return new BaseObject(-1, 'msg_exceeds_limit_size');
|
||||
return $this->setError('msg_exceeds_limit_size');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -119,14 +119,14 @@ class fileController extends file
|
|||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Rhymix\Framework\Storage::delete($temp_filename);
|
||||
$this->add('chunk_status', 40);
|
||||
return new BaseObject(-1, 'msg_upload_invalid_chunk');
|
||||
return $this->setError('msg_upload_invalid_chunk');
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -207,14 +207,14 @@ class fileController extends file
|
|||
|
||||
if(!$file_srl || !$width)
|
||||
{
|
||||
return new BaseObject(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oFileModel = getModel('file');
|
||||
$fileInfo = $oFileModel->getFile($file_srl);
|
||||
if(!$fileInfo || $fileInfo->direct_download != 'Y')
|
||||
{
|
||||
return new BaseObject(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$source_src = $fileInfo->uploaded_filename;
|
||||
|
|
@ -230,7 +230,7 @@ class fileController extends file
|
|||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$this->add('resized_info',$output);
|
||||
|
|
@ -271,7 +271,7 @@ class fileController extends file
|
|||
{
|
||||
$oFileModel = getModel('file');
|
||||
|
||||
if(isset($this->grant->access) && $this->grant->access !== true) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if(isset($this->grant->access) && $this->grant->access !== true) return $this->setError('msg_not_permitted');
|
||||
|
||||
$file_srl = Context::get('file_srl');
|
||||
$sid = Context::get('sid');
|
||||
|
|
@ -554,11 +554,11 @@ class fileController extends file
|
|||
*/
|
||||
function procFileGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !== 'Y' && !getModel('module')->isSiteAdmin($logged_info))
|
||||
{
|
||||
return new BaseObject(-1,'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$fileSrls = Context::get('file_srls');
|
||||
|
|
@ -598,12 +598,12 @@ class fileController extends file
|
|||
function triggerCheckAttached(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new BaseObject();
|
||||
if(!$document_srl) return;
|
||||
|
||||
// Get numbers of attachments
|
||||
$oFileModel = getModel('file');
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($document_srl);
|
||||
|
||||
return new BaseObject();
|
||||
// TODO: WTF are we doing with uploaded_count anyway?
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -615,12 +615,10 @@ class fileController extends file
|
|||
function triggerAttachFiles(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new BaseObject();
|
||||
if(!$document_srl) return;
|
||||
|
||||
$output = $this->setFilesValid($document_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -632,7 +630,7 @@ class fileController extends file
|
|||
function triggerDeleteAttached(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new BaseObject();
|
||||
if(!$document_srl) return;
|
||||
|
||||
$output = $this->deleteFiles($document_srl);
|
||||
return $output;
|
||||
|
|
@ -647,12 +645,10 @@ class fileController extends file
|
|||
function triggerCommentCheckAttached(&$obj)
|
||||
{
|
||||
$comment_srl = $obj->comment_srl;
|
||||
if(!$comment_srl) return new BaseObject();
|
||||
if(!$comment_srl) return;
|
||||
// Get numbers of attachments
|
||||
$oFileModel = getModel('file');
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($comment_srl);
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -665,12 +661,10 @@ class fileController extends file
|
|||
{
|
||||
$comment_srl = $obj->comment_srl;
|
||||
$uploaded_count = $obj->uploaded_count;
|
||||
if(!$comment_srl || !$uploaded_count) return new BaseObject();
|
||||
if(!$comment_srl || !$uploaded_count) return;
|
||||
|
||||
$output = $this->setFilesValid($comment_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -682,9 +676,9 @@ class fileController extends file
|
|||
function triggerCommentDeleteAttached(&$obj)
|
||||
{
|
||||
$comment_srl = $obj->comment_srl;
|
||||
if(!$comment_srl) return new BaseObject();
|
||||
if(!$comment_srl) return;
|
||||
|
||||
if($obj->isMoveToTrash) return new BaseObject();
|
||||
if($obj->isMoveToTrash) return;
|
||||
|
||||
$output = $this->deleteFiles($comment_srl);
|
||||
return $output;
|
||||
|
|
@ -699,7 +693,7 @@ class fileController extends file
|
|||
function triggerDeleteModuleFiles(&$obj)
|
||||
{
|
||||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl) return new BaseObject();
|
||||
if(!$module_srl) return;
|
||||
|
||||
$oFileController = getAdminController('file');
|
||||
return $oFileController->deleteModuleFiles($module_srl);
|
||||
|
|
@ -817,13 +811,13 @@ class fileController extends file
|
|||
$allowed_filesize = $config->allowed_filesize * 1024 * 1024;
|
||||
$allowed_attach_size = $config->allowed_attach_size * 1024 * 1024;
|
||||
// An error appears if file size exceeds a limit
|
||||
if($allowed_filesize < filesize($file_info['tmp_name'])) return new BaseObject(-1, 'msg_exceeds_limit_size');
|
||||
if($allowed_filesize < filesize($file_info['tmp_name'])) return $this->setError('msg_exceeds_limit_size');
|
||||
// Get total file size of all attachements (from DB)
|
||||
$size_args = new stdClass;
|
||||
$size_args->upload_target_srl = $upload_target_srl;
|
||||
$output = executeQuery('file.getAttachedFileSize', $size_args);
|
||||
$attached_size = (int)$output->data->attached_size + filesize($file_info['tmp_name']);
|
||||
if($attached_size > $allowed_attach_size) return new BaseObject(-1, 'msg_exceeds_limit_size');
|
||||
if($attached_size > $allowed_attach_size) return $this->setError('msg_exceeds_limit_size');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -860,7 +854,7 @@ class fileController extends file
|
|||
// Create a directory
|
||||
if(!Rhymix\Framework\Storage::isDirectory($path) && !Rhymix\Framework\Storage::createDirectory($path))
|
||||
{
|
||||
return new BaseObject(-1,'msg_not_permitted_create');
|
||||
return $this->setError('msg_not_permitted_create');
|
||||
}
|
||||
|
||||
// Move the file
|
||||
|
|
@ -872,7 +866,7 @@ class fileController extends file
|
|||
@copy($file_info['tmp_name'], $filename);
|
||||
if(!file_exists($filename))
|
||||
{
|
||||
return new BaseObject(-1,'msg_file_upload_error');
|
||||
return $this->setError('msg_file_upload_error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -882,7 +876,7 @@ class fileController extends file
|
|||
{
|
||||
if (!Rhymix\Framework\Storage::move($file_info['tmp_name'], $filename))
|
||||
{
|
||||
return new BaseObject(-1,'msg_file_upload_error');
|
||||
return $this->setError('msg_file_upload_error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -892,7 +886,7 @@ class fileController extends file
|
|||
{
|
||||
if(!@move_uploaded_file($file_info['tmp_name'], $filename))
|
||||
{
|
||||
return new BaseObject(-1,'msg_file_upload_error');
|
||||
return $this->setError('msg_file_upload_error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1107,16 +1101,16 @@ class fileController extends file
|
|||
$vars = Context::getRequestVars();
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
if(!$vars->editor_sequence) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$vars->editor_sequence) return $this->setError('msg_invalid_request');
|
||||
|
||||
$upload_target_srl = $_SESSION['upload_info'][$vars->editor_sequence]->upload_target_srl;
|
||||
|
||||
$oFileModel = getModel('file');
|
||||
$file_info = $oFileModel->getFile($vars->file_srl);
|
||||
|
||||
if(!$file_info) return new BaseObject(-1, 'msg_not_founded');
|
||||
if(!$file_info) return $this->setError('msg_not_founded');
|
||||
|
||||
if(!$this->manager && !$file_info->member_srl === $logged_info->member_srl) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if(!$this->manager && !$file_info->member_srl === $logged_info->member_srl) return $this->setError('msg_not_permitted');
|
||||
|
||||
$args = new stdClass();
|
||||
$args->file_srl = $vars->file_srl;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class fileModel extends file
|
|||
$oComment = $oCommentModel->getComment($upload_target_srl);
|
||||
if($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($oComment->get('document_srl'));
|
||||
|
|
@ -54,7 +54,7 @@ class fileModel extends file
|
|||
// document 권한 확인
|
||||
if($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// 모듈 권한 확인
|
||||
|
|
@ -63,7 +63,7 @@ class fileModel extends file
|
|||
$grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')), $logged_info);
|
||||
if(!$grant->access)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class fileView extends file
|
|||
* It only receives file configurations
|
||||
*
|
||||
* @param string $obj The html string of page of addition setup of module
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function triggerDispFileAdditionSetup(&$obj)
|
||||
{
|
||||
|
|
@ -31,7 +31,7 @@ class fileView extends file
|
|||
// Get information of the current module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new BaseObject();
|
||||
if(!$current_module_srl) return;
|
||||
}
|
||||
// Get file configurations of the module
|
||||
$oFileModel = getModel('file');
|
||||
|
|
@ -46,8 +46,6 @@ class fileView extends file
|
|||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'file_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
}
|
||||
/* End of file file.view.php */
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class extract
|
|||
// If local file
|
||||
if(strncasecmp('http://', $this->filename, 7) !== 0)
|
||||
{
|
||||
if(!file_exists($this->filename)) return new BaseObject(-1,'msg_no_xml_file');
|
||||
if(!file_exists($this->filename)) return $this->setError('msg_no_xml_file');
|
||||
$this->fd = fopen($this->filename,"r");
|
||||
// If remote file
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ class extract
|
|||
if(!$url_info['path']) $url_info['path'] = '/';
|
||||
|
||||
$this->fd = @fsockopen($url_info['host'], $url_info['port']);
|
||||
if(!$this->fd) return new BaseObject(-1,'msg_no_xml_file');
|
||||
if(!$this->fd) return $this->setError('msg_no_xml_file');
|
||||
// If the file name contains Korean, do urlencode(iconv required)
|
||||
$path = $url_info['path'];
|
||||
if(preg_match('/[\xEA-\xED][\x80-\xFF]{2}/', $path)&&function_exists('iconv'))
|
||||
|
|
@ -157,7 +157,7 @@ class extract
|
|||
$buff .= $str = fgets($this->fd, 1024);
|
||||
if(!trim($str)) break;
|
||||
}
|
||||
if(preg_match('/404 Not Found/i',$buff)) return new BaseObject(-1,'msg_no_xml_file');
|
||||
if(preg_match('/404 Not Found/i',$buff)) return $this->setError('msg_no_xml_file');
|
||||
}
|
||||
|
||||
if($this->startTag)
|
||||
|
|
|
|||
|
|
@ -292,12 +292,12 @@ class importerAdminController extends importer
|
|||
$this->unit_count = Context::get('unit_count');
|
||||
// Check if an index file exists
|
||||
$index_file = './files/cache/importer/'.$key.'/index';
|
||||
if(!file_exists($index_file)) return new BaseObject(-1, 'msg_invalid_xml_file');
|
||||
if(!file_exists($index_file)) return $this->setError('msg_invalid_xml_file');
|
||||
|
||||
switch($type)
|
||||
{
|
||||
case 'ttxml' :
|
||||
if(!$target_module) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$target_module) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$columnList = array('module_srl', 'module');
|
||||
|
|
@ -317,7 +317,7 @@ class importerAdminController extends importer
|
|||
break;
|
||||
case 'module' :
|
||||
// Check if the target module exists
|
||||
if(!$target_module) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$target_module) return $this->setError('msg_invalid_request');
|
||||
$cur = $this->importModule($key, $cur, $index_file, $target_module);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ class importer extends ModuleObject
|
|||
{
|
||||
/**
|
||||
* Implement if additional tasks are necessary when installing
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -30,11 +30,11 @@ class importer extends ModuleObject
|
|||
|
||||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
* @return void
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -43,6 +43,7 @@ class importer extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
/* End of file importer.class.php */
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class installAdminController extends install
|
|||
function procInstallAdminInstall()
|
||||
{
|
||||
$module_name = Context::get('module_name');
|
||||
if(!$module_name) return new BaseObject(-1, 'invalid_request');
|
||||
if(!$module_name) return $this->setError('invalid_request');
|
||||
|
||||
$oInstallController = getController('install');
|
||||
$oInstallController->installModule($module_name, './modules/'.$module_name);
|
||||
|
|
@ -35,13 +35,16 @@ class installAdminController extends install
|
|||
{
|
||||
@set_time_limit(0);
|
||||
$module_name = Context::get('module_name');
|
||||
if(!$module_name) return new BaseObject(-1, 'invalid_request');
|
||||
if(!$module_name) return $this->setError('invalid_request');
|
||||
|
||||
$oModule = getModule($module_name, 'class');
|
||||
if($oModule) $output = $oModule->moduleUpdate();
|
||||
else $output = new BaseObject(-1, 'invalid_request');
|
||||
|
||||
return $output;
|
||||
if(!$oModule) return $this->setError('invalid_request');
|
||||
|
||||
$output = $oModule->moduleUpdate();
|
||||
if($output instanceof BaseObject && !$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
function procInstallAdminRemoveFTPInfo()
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class install extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +28,7 @@ class install extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class installController extends install
|
|||
{
|
||||
if ($oDB->isTableExists($table_name))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_table_already_exists');
|
||||
return $this->setError('msg_table_already_exists');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ class installController extends install
|
|||
// Check if it is already installed
|
||||
if (Context::isInstalled())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_already_installed');
|
||||
return $this->setError('msg_already_installed');
|
||||
}
|
||||
|
||||
// Get install parameters.
|
||||
|
|
@ -227,7 +227,7 @@ class installController extends install
|
|||
catch(Exception $e)
|
||||
{
|
||||
$oDB->rollback();
|
||||
return new BaseObject(-1, $e->getMessage());
|
||||
return $this->setError($e->getMessage());
|
||||
}
|
||||
|
||||
// Execute the install script.
|
||||
|
|
@ -411,7 +411,7 @@ class installController extends install
|
|||
else
|
||||
{
|
||||
FileHandler::removeFile($this->flagLicenseAgreement);
|
||||
return new BaseObject(-1, 'msg_must_accept_license_agreement');
|
||||
return $this->setError('msg_must_accept_license_agreement');
|
||||
}
|
||||
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ class installModel extends install
|
|||
$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
return new BaseObject(-1,'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
$sftp = ssh2_sftp($connection);
|
||||
$curpwd = "ssh2.sftp://$sftp".$this->pwd;
|
||||
$dh = @opendir($curpwd);
|
||||
if(!$dh) return new BaseObject(-1, 'msg_ftp_invalid_path');
|
||||
if(!$dh) return $this->setError('msg_ftp_invalid_path');
|
||||
|
||||
$list = array();
|
||||
while(($file = readdir($dh)) !== false)
|
||||
|
|
@ -37,7 +37,7 @@ class installModel extends install
|
|||
{
|
||||
if(!($ftp_info = Context::getRequestVars()) || !$ftp_info->ftp_user || !$ftp_info->ftp_password)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
$this->pwd = $ftp_info->ftp_root_path;
|
||||
if(!$ftp_info->ftp_host)
|
||||
|
|
@ -54,11 +54,11 @@ class installModel extends install
|
|||
if(function_exists('ftp_connect'))
|
||||
{
|
||||
$connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
|
||||
if(!$connection) return new BaseObject(-1, sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
if(!$connection) return $this->setError(sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
if(! @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
ftp_close($connection);
|
||||
return new BaseObject(-1,'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
if($ftp_info->ftp_pasv != "N")
|
||||
|
|
@ -82,7 +82,7 @@ class installModel extends install
|
|||
else
|
||||
{
|
||||
$oFtp->ftp_quit();
|
||||
return new BaseObject(-1,'msg_ftp_invalid_auth_info');
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ class installView extends install
|
|||
else
|
||||
{
|
||||
$this->setRedirectUrl(RX_BASEURL);
|
||||
return new BaseObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ class integration_search extends ModuleObject
|
|||
// Registered in action forward
|
||||
$oModuleController = getController('module');
|
||||
$oModuleController->insertActionForward('integration_search', 'view', 'IS');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -67,8 +65,6 @@ class integration_search extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class integration_searchView extends integration_search
|
|||
}
|
||||
|
||||
// Check permissions
|
||||
if(!$this->grant->access) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!$this->grant->access) return $this->setError('msg_not_permitted');
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('integration_search');
|
||||
if(!$config) $config = new stdClass;
|
||||
|
|
|
|||
|
|
@ -26,12 +26,7 @@ class krzip extends ModuleObject
|
|||
|
||||
function moduleInstall()
|
||||
{
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
function moduleUninstall()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
function checkUpdate()
|
||||
|
|
@ -41,7 +36,7 @@ class krzip extends ModuleObject
|
|||
|
||||
function moduleUpdate()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class krzipModel extends krzip
|
|||
$module_config = $this->getConfig();
|
||||
if($module_config->api_handler != 1)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if(!isset($query))
|
||||
{
|
||||
|
|
@ -185,11 +185,11 @@ class krzipModel extends krzip
|
|||
}
|
||||
}
|
||||
|
||||
return new BaseObject(-1, $err_msg);
|
||||
return $this->setError($err_msg);
|
||||
}
|
||||
if(!$result->post)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_krzip_riddling_wrong');
|
||||
return $this->setError('msg_krzip_riddling_wrong');
|
||||
}
|
||||
|
||||
$item_list = $result->post->itemlist->item;
|
||||
|
|
@ -199,7 +199,7 @@ class krzipModel extends krzip
|
|||
}
|
||||
if(!$item_list)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_krzip_no_result');
|
||||
return $this->setError('msg_krzip_no_result');
|
||||
}
|
||||
|
||||
$addr_list = array();
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class layoutAdminController extends layout
|
|||
$output = executeQuery('menu.getMenuItemByUrl', $tmpArgs);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return new BaseObject(-1, 'fail_to_update');
|
||||
return $this->setError('fail_to_update');
|
||||
}
|
||||
|
||||
$menu_srl = $output->data->menu_srl;
|
||||
|
|
@ -313,7 +313,7 @@ class layoutAdminController extends layout
|
|||
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return new BaseObject(-1, $output->message);
|
||||
return $this->setError($output->message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -356,7 +356,7 @@ class layoutAdminController extends layout
|
|||
|
||||
if(!$layout_srl || !$code || !$is_post)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oLayoutModel = getModel('layout');
|
||||
|
|
@ -377,7 +377,7 @@ class layoutAdminController extends layout
|
|||
function procLayoutAdminCodeReset()
|
||||
{
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
if(!$layout_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$layout_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
// delete user layout file
|
||||
$oLayoutModel = getModel('layout');
|
||||
|
|
@ -480,13 +480,13 @@ class layoutAdminController extends layout
|
|||
$oModuleModel = getModel('module');
|
||||
|
||||
$mid = Context::get('mid');
|
||||
if(!$mid) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$mid) return $this->setError('msg_invalid_request');
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$columnList = array('layout_srl');
|
||||
$module_info = $oModuleModel->getModuleInfoByMid($mid, $site_module_info->site_srl, $columnList);
|
||||
$layout_srl = $module_info->layout_srl;
|
||||
if(!$layout_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$layout_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oLayoutModel = getModel('layout');
|
||||
|
||||
|
|
|
|||
|
|
@ -295,11 +295,11 @@ class layoutAdminView extends layout
|
|||
$layout_srl = Context::get('layout_srl');
|
||||
$code = Context::get('code');
|
||||
$code_css = Context::get('code_css');
|
||||
if(!$layout_srl || !$code) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$layout_srl || !$code) return $this->setError('msg_invalid_request');
|
||||
// Get the layout information
|
||||
$oLayoutModel = getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
if(!$layout_info) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$layout_info) return $this->setError('msg_invalid_request');
|
||||
// Separately handle the layout if its type is faceoff
|
||||
if($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
|
||||
// Apply CSS directly
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ class layout extends ModuleObject
|
|||
{
|
||||
// Create a directory to be used in the layout
|
||||
FileHandler::makeDir('./files/cache/layout');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -104,7 +102,6 @@ class layout extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -318,8 +318,7 @@ class layoutView extends layout
|
|||
{
|
||||
if(!checkCSRF())
|
||||
{
|
||||
$this->stop('msg_invalid_request');
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// admin check
|
||||
|
|
@ -331,11 +330,11 @@ class layoutView extends layout
|
|||
$code = Context::get('code');
|
||||
|
||||
$code_css = Context::get('code_css');
|
||||
if(!$layout_srl || !$code) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$layout_srl || !$code) return $this->setError('msg_invalid_request');
|
||||
// Get the layout information
|
||||
$oLayoutModel = getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
if(!$layout_info) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$layout_info) return $this->setError('msg_invalid_request');
|
||||
// Separately handle the layout if its type is faceoff
|
||||
if($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
|
||||
// Apply CSS directly
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class memberAdminController extends member
|
|||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin != 'Y' || !checkCSRF())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date');
|
||||
|
|
@ -729,7 +729,7 @@ class memberAdminController extends member
|
|||
// Check ID duplicated
|
||||
if (Context::isReservedWord($args->column_name))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_column_id_not_available');
|
||||
return $this->setError('msg_column_id_not_available');
|
||||
}
|
||||
$oMemberModel = getModel('member');
|
||||
$config = $oMemberModel->getMemberConfig();
|
||||
|
|
@ -738,7 +738,7 @@ class memberAdminController extends member
|
|||
if($item->name == $args->column_name)
|
||||
{
|
||||
if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
|
||||
return new BaseObject(-1,'msg_column_id_not_available');
|
||||
return $this->setError('msg_column_id_not_available');
|
||||
}
|
||||
}
|
||||
// Fix if member_join_form_srl exists. Add if not exists.
|
||||
|
|
@ -949,7 +949,7 @@ class memberAdminController extends member
|
|||
function procMemberAdminDeleteMembers()
|
||||
{
|
||||
$target_member_srls = Context::get('target_member_srls');
|
||||
if(!$target_member_srls) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$target_member_srls) return $this->setError('msg_invalid_request');
|
||||
$member_srls = explode(',', $target_member_srls);
|
||||
$oMemberController = getController('member');
|
||||
|
||||
|
|
@ -973,7 +973,7 @@ class memberAdminController extends member
|
|||
function procMemberAdminUpdateMembersGroup()
|
||||
{
|
||||
$member_srl = Context::get('member_srl');
|
||||
if(!$member_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$member_srl) return $this->setError('msg_invalid_request');
|
||||
$member_srls = explode(',',$member_srl);
|
||||
|
||||
$group_srl = Context::get('group_srls');
|
||||
|
|
@ -1246,7 +1246,7 @@ class memberAdminController extends member
|
|||
function updateGroup($args)
|
||||
{
|
||||
if(!$args->site_srl) $args->site_srl = 0;
|
||||
if(!$args->group_srl) return new BaseObject(-1, 'lang->msg_not_founded');
|
||||
if(!$args->group_srl) return $this->setError('lang->msg_not_founded');
|
||||
|
||||
// Call trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('member.updateGroup', 'before', $args);
|
||||
|
|
@ -1290,8 +1290,8 @@ class memberAdminController extends member
|
|||
$columnList = array('group_srl', 'is_default');
|
||||
$group_info = $oMemberModel->getGroup($group_srl, $columnList);
|
||||
|
||||
if(!$group_info) return new BaseObject(-1, 'lang->msg_not_founded');
|
||||
if($group_info->is_default == 'Y') return new BaseObject(-1, 'msg_not_delete_default');
|
||||
if(!$group_info) return $this->setError('lang->msg_not_founded');
|
||||
if($group_info->is_default == 'Y') return $this->setError('msg_not_delete_default');
|
||||
|
||||
// Call trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('member.deleteGroup', 'before', $group_info);
|
||||
|
|
|
|||
|
|
@ -164,8 +164,6 @@ class member extends ModuleObject {
|
|||
// 2013. 11. 22 add menu when popup document menu called
|
||||
$oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
|
||||
$oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -414,8 +412,6 @@ class member extends ModuleObject {
|
|||
$oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
|
||||
if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'))
|
||||
$oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after');
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class memberController extends member
|
|||
if(!$user_id && !$password && Context::getRequestMethod() == 'GET')
|
||||
{
|
||||
$this->setRedirectUrl(getNotEncodedUrl(''));
|
||||
return new BaseObject(-1, 'null_user_id');
|
||||
return $this->setError('null_user_id');
|
||||
}
|
||||
|
||||
// Variables
|
||||
|
|
@ -42,8 +42,8 @@ class memberController extends member
|
|||
|
||||
if(!$keep_signed) $keep_signed = Context::get('keep_signed');
|
||||
// Return an error when id and password doesn't exist
|
||||
if(!$user_id) return new BaseObject(-1,'null_user_id');
|
||||
if(!$password) return new BaseObject(-1,'null_password');
|
||||
if(!$user_id) return $this->setError('null_user_id');
|
||||
if(!$password) return $this->setError('null_password');
|
||||
|
||||
$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
|
||||
if (!$output->toBool()) return $output;
|
||||
|
|
@ -123,7 +123,7 @@ class memberController extends member
|
|||
$document_srl = (int) (Context::get('document_srl') ?: Context::get('target_srl'));
|
||||
if(!$document_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
|
|
@ -132,7 +132,7 @@ class memberController extends member
|
|||
// Check document
|
||||
if($oDocument->isSecret() && !$oDocument->isGranted())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_is_secret');
|
||||
return $this->setError('msg_is_secret');
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -144,19 +144,19 @@ class memberController extends member
|
|||
// Check access to module of the document
|
||||
if(!$grant->access)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Check grant to module of the document
|
||||
if(isset($grant->list) && isset($grant->view) && (!$grant->list || !$grant->view))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Check consultation option
|
||||
if(isset($grant->consultation_read) && $module_info->consultation == 'Y' && !$grant->consultation_read && !$oDocument->isGranted())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
// Find default scrap folder
|
||||
|
|
@ -188,7 +188,7 @@ class memberController extends member
|
|||
$output = executeQuery('member.getScrapDocument', $args);
|
||||
if($output->data->count)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_alreay_scrapped');
|
||||
return $this->setError('msg_alreay_scrapped');
|
||||
}
|
||||
|
||||
// Insert
|
||||
|
|
@ -207,11 +207,11 @@ class memberController extends member
|
|||
function procMemberDeleteScrap()
|
||||
{
|
||||
// Check login information
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$document_srl = (int)Context::get('document_srl');
|
||||
if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
// Variables
|
||||
$args = new stdClass;
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
|
|
@ -227,14 +227,14 @@ class memberController extends member
|
|||
function procMemberMoveScrapFolder()
|
||||
{
|
||||
// Check login information
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$document_srl = (int)Context::get('document_srl');
|
||||
$folder_srl = (int)Context::get('folder_srl');
|
||||
if(!$document_srl || !$folder_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Check that the target folder exists and belongs to member
|
||||
|
|
@ -244,7 +244,7 @@ class memberController extends member
|
|||
$output = executeQueryArray('member.getScrapFolderList', $args);
|
||||
if(!count($output->data))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Move
|
||||
|
|
@ -263,7 +263,7 @@ class memberController extends member
|
|||
function procMemberInsertScrapFolder()
|
||||
{
|
||||
// Check login information
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// Get new folder name
|
||||
|
|
@ -271,7 +271,7 @@ class memberController extends member
|
|||
$folder_name = escape(trim(utf8_normalize_spaces($folder_name)));
|
||||
if(!$folder_name)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Check existing folder with same name
|
||||
|
|
@ -281,7 +281,7 @@ class memberController extends member
|
|||
$output = executeQueryArray('member.getScrapFolderList', $args);
|
||||
if(count($output->data) || $folder_name === lang('default_folder'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_folder_alreay_exists');
|
||||
return $this->setError('msg_folder_alreay_exists');
|
||||
}
|
||||
|
||||
// Create folder
|
||||
|
|
@ -302,7 +302,7 @@ class memberController extends member
|
|||
function procMemberRenameScrapFolder()
|
||||
{
|
||||
// Check login information
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// Get new folder name
|
||||
|
|
@ -311,7 +311,7 @@ class memberController extends member
|
|||
$folder_name = escape(trim(utf8_normalize_spaces($folder_name)));
|
||||
if(!$folder_srl || !$folder_name)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Check that the original folder exists and belongs to member
|
||||
|
|
@ -321,11 +321,11 @@ class memberController extends member
|
|||
$output = executeQueryArray('member.getScrapFolderList', $args);
|
||||
if(!count($output->data))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if(array_first($output->data)->name === '/DEFAULT/')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_folder_is_default');
|
||||
return $this->setError('msg_folder_is_default');
|
||||
}
|
||||
|
||||
// Check existing folder with same name
|
||||
|
|
@ -336,7 +336,7 @@ class memberController extends member
|
|||
$output = executeQueryArray('member.getScrapFolderList', $args);
|
||||
if(count($output->data) || $folder_name === lang('default_folder'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_folder_alreay_exists');
|
||||
return $this->setError('msg_folder_alreay_exists');
|
||||
}
|
||||
|
||||
// Rename folder
|
||||
|
|
@ -354,14 +354,14 @@ class memberController extends member
|
|||
function procMemberDeleteScrapFolder()
|
||||
{
|
||||
// Check login information
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// Get folder_srl to delete
|
||||
$folder_srl = intval(Context::get('folder_srl'));
|
||||
if(!$folder_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Check that the folder exists and belongs to member
|
||||
|
|
@ -371,11 +371,11 @@ class memberController extends member
|
|||
$output = executeQueryArray('member.getScrapFolderList', $args);
|
||||
if(!count($output->data))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if(array_first($output->data)->name === '/DEFAULT/')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_folder_is_default');
|
||||
return $this->setError('msg_folder_is_default');
|
||||
}
|
||||
|
||||
// Check that the folder is empty
|
||||
|
|
@ -385,7 +385,7 @@ class memberController extends member
|
|||
$output = executeQueryArray('member.getScrapDocumentList', $args);
|
||||
if(count($output->data))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_folder_not_empty');
|
||||
return $this->setError('msg_folder_not_empty');
|
||||
}
|
||||
|
||||
// Delete folder
|
||||
|
|
@ -437,22 +437,22 @@ class memberController extends member
|
|||
function procMemberDeleteSavedDocument()
|
||||
{
|
||||
// Check login information
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$document_srl = (int)Context::get('document_srl');
|
||||
if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$document_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if ($oDocument->get('member_srl') != $logged_info->member_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
$configStatusList = $oDocumentModel->getStatusList();
|
||||
if ($oDocument->get('status') != $configStatusList['temp'])
|
||||
{
|
||||
return new BaseObject(-1,'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Variables
|
||||
|
|
@ -466,14 +466,14 @@ class memberController extends member
|
|||
function procMemberDeleteAutologin()
|
||||
{
|
||||
// Check login information
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$autologin_id = intval(Context::get('autologin_id'));
|
||||
$autologin_key = Context::get('autologin_key');
|
||||
if (!$autologin_id || !$autologin_key)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args = new stdClass;
|
||||
|
|
@ -590,7 +590,7 @@ class memberController extends member
|
|||
{
|
||||
if($agreement->type === 'required' && $accept_agreement !== 'Y' && $accept_agreement[$i] !== 'Y')
|
||||
{
|
||||
return $this->stop('msg_accept_agreement');
|
||||
return $this->setError('msg_accept_agreement');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -645,7 +645,7 @@ class memberController extends member
|
|||
if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
|
||||
{
|
||||
$message = lang('about_password_strength');
|
||||
return new BaseObject(-1, $message[$config->password_strength]);
|
||||
return $this->setError($message[$config->password_strength]);
|
||||
}
|
||||
|
||||
// Remove some unnecessary variables from all the vars
|
||||
|
|
@ -804,7 +804,7 @@ class memberController extends member
|
|||
// Verify the current password
|
||||
if(!$oMemberModel->isValidPassword($member_info->password, $password))
|
||||
{
|
||||
return new BaseObject(-1, 'invalid_password');
|
||||
return $this->setError('invalid_password');
|
||||
}
|
||||
|
||||
$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
|
||||
|
|
@ -982,10 +982,10 @@ class memberController extends member
|
|||
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
|
||||
// Verify the cuttent password
|
||||
if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password');
|
||||
if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return $this->setError('invalid_password');
|
||||
|
||||
// Check if a new password is as same as the previous password
|
||||
if($current_password == $password) return new BaseObject(-1, 'invalid_new_password');
|
||||
if($current_password == $password) return $this->setError('invalid_new_password');
|
||||
|
||||
// Execute insert or update depending on the value of member_srl
|
||||
$args = new stdClass;
|
||||
|
|
@ -1028,7 +1028,7 @@ class memberController extends member
|
|||
$columnList = array('member_srl', 'password');
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
|
||||
// Verify the cuttent password
|
||||
if(!$oMemberModel->isValidPassword($member_info->password, $password)) return new BaseObject(-1, 'invalid_password');
|
||||
if(!$oMemberModel->isValidPassword($member_info->password, $password)) return $this->setError('invalid_password');
|
||||
|
||||
$output = $this->deleteMember($member_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -1317,14 +1317,14 @@ class memberController extends member
|
|||
function procMemberFindAccount()
|
||||
{
|
||||
$email_address = Context::get('email_address');
|
||||
if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$email_address) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
// Check if a member having the same email address exists
|
||||
$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
|
||||
if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
|
||||
if(!$member_srl) return $this->setError('msg_email_not_exists');
|
||||
|
||||
// Get information of the member
|
||||
$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
|
||||
|
|
@ -1336,7 +1336,7 @@ class memberController extends member
|
|||
$chk_args = new stdClass;
|
||||
$chk_args->member_srl = $member_info->member_srl;
|
||||
$output = executeQuery('member.chkAuthMail', $chk_args);
|
||||
if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
|
||||
if($output->toBool() && $output->data->count != '0') return $this->setError('msg_user_not_confirmed');
|
||||
}
|
||||
|
||||
// Insert data into the authentication DB
|
||||
|
|
@ -1417,7 +1417,7 @@ class memberController extends member
|
|||
*/
|
||||
function procMemberFindAccountByQuestion()
|
||||
{
|
||||
return new BaseObject(-1, 'msg_question_not_allowed');
|
||||
return $this->setError('msg_question_not_allowed');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1510,14 +1510,14 @@ class memberController extends member
|
|||
{
|
||||
// Get an email_address
|
||||
$email_address = Context::get('email_address');
|
||||
if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$email_address) return $this->setError('msg_invalid_request');
|
||||
// Log test by using email_address
|
||||
$oMemberModel = getModel('member');
|
||||
|
||||
$args = new stdClass;
|
||||
$args->email_address = $email_address;
|
||||
$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
|
||||
if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
|
||||
if(!$memberSrl) return $this->setError('msg_not_exists_member');
|
||||
|
||||
$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
|
||||
|
|
@ -1531,12 +1531,12 @@ class memberController extends member
|
|||
$chk_args = new stdClass;
|
||||
$chk_args->member_srl = $member_info->member_srl;
|
||||
$output = executeQuery('member.chkAuthMail', $chk_args);
|
||||
if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
|
||||
if($output->toBool() && $output->data->count == '0') return $this->setError('msg_invalid_request');
|
||||
|
||||
$auth_args = new stdClass;
|
||||
$auth_args->member_srl = $member_info->member_srl;
|
||||
$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
|
||||
if(!$output->data || !$output->data[0]->auth_key) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$output->data || !$output->data[0]->auth_key) return $this->setError('msg_invalid_request');
|
||||
$auth_info = $output->data[0];
|
||||
|
||||
// Update the regdate of authmail entry
|
||||
|
|
@ -1614,7 +1614,7 @@ class memberController extends member
|
|||
$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
|
||||
if($member_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_exists_email_address');
|
||||
return $this->setError('msg_exists_email_address');
|
||||
}
|
||||
|
||||
// remove all key by member_srl
|
||||
|
|
@ -1729,7 +1729,7 @@ class memberController extends member
|
|||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
$columnList = array('site_srl', 'group_srl', 'title');
|
||||
|
|
@ -1748,7 +1748,7 @@ class memberController extends member
|
|||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return $this->setError('msg_invalid_request');
|
||||
|
||||
$args = new stdClass;
|
||||
$args->site_srl= $site_module_info->site_srl;
|
||||
|
|
@ -2026,7 +2026,7 @@ class memberController extends member
|
|||
elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).lang('unit_hour');
|
||||
else $term = intval($term/86400).lang('unit_day');
|
||||
|
||||
return new BaseObject(-1, sprintf(lang('excess_ip_access_count'),$term));
|
||||
return new BaseObject(-1, 'excess_ip_access_count', $term);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2349,27 +2349,27 @@ class memberController extends member
|
|||
// Check if ID is prohibited
|
||||
if($logged_info->is_admin !== 'Y' && $oMemberModel->isDeniedID($args->user_id))
|
||||
{
|
||||
return new BaseObject(-1,'denied_user_id');
|
||||
return new BaseObject(-1, 'denied_user_id');
|
||||
}
|
||||
|
||||
// Check if ID is duplicate
|
||||
$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
|
||||
if($member_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_exists_user_id');
|
||||
return new BaseObject(-1, 'msg_exists_user_id');
|
||||
}
|
||||
|
||||
// Check if nickname is prohibited
|
||||
if($logged_info->is_admin !== 'Y' && $oMemberModel->isDeniedNickName($args->nick_name))
|
||||
{
|
||||
return new BaseObject(-1,'denied_nick_name');
|
||||
return new BaseObject(-1, 'denied_nick_name');
|
||||
}
|
||||
|
||||
// Check if nickname is duplicate
|
||||
$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
|
||||
if($member_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_exists_nick_name');
|
||||
return new BaseObject(-1, 'msg_exists_nick_name');
|
||||
}
|
||||
|
||||
// Check managed Email Host
|
||||
|
|
@ -2392,7 +2392,7 @@ class memberController extends member
|
|||
$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
|
||||
if($member_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_exists_email_address');
|
||||
return new BaseObject(-1, 'msg_exists_email_address');
|
||||
}
|
||||
|
||||
// Insert data into the DB
|
||||
|
|
@ -2600,7 +2600,7 @@ class memberController extends member
|
|||
$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
|
||||
if($member_srl && $args->member_srl != $member_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_exists_email_address');
|
||||
return new BaseObject(-1, 'msg_exists_email_address');
|
||||
}
|
||||
$args->email_address = $orgMemberInfo->email_address;
|
||||
}
|
||||
|
|
@ -2609,7 +2609,7 @@ class memberController extends member
|
|||
$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
|
||||
if($member_srl && $args->member_srl != $member_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_exists_user_id');
|
||||
return new BaseObject(-1, 'msg_exists_user_id');
|
||||
}
|
||||
|
||||
$args->user_id = $orgMemberInfo->user_id;
|
||||
|
|
@ -2618,7 +2618,7 @@ class memberController extends member
|
|||
// Check if ID is prohibited
|
||||
if($logged_info->is_admin !== 'Y' && $args->user_id && $oMemberModel->isDeniedID($args->user_id))
|
||||
{
|
||||
return new BaseObject(-1,'denied_user_id');
|
||||
return new BaseObject(-1, 'denied_user_id');
|
||||
}
|
||||
|
||||
// Check if ID is duplicate
|
||||
|
|
@ -2627,7 +2627,7 @@ class memberController extends member
|
|||
$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
|
||||
if($member_srl && $args->member_srl != $member_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_exists_user_id');
|
||||
return new BaseObject(-1, 'msg_exists_user_id');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2641,7 +2641,7 @@ class memberController extends member
|
|||
$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
|
||||
if($member_srl && $args->member_srl != $member_srl)
|
||||
{
|
||||
return new BaseObject(-1,'msg_exists_nick_name');
|
||||
return new BaseObject(-1, 'msg_exists_nick_name');
|
||||
}
|
||||
|
||||
list($args->email_id, $args->email_host) = explode('@', $args->email_address);
|
||||
|
|
@ -2886,12 +2886,12 @@ class memberController extends member
|
|||
|
||||
function procMemberModifyEmailAddress()
|
||||
{
|
||||
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_logged');
|
||||
|
||||
$member_info = Context::get('logged_info');
|
||||
$newEmail = Context::get('email_address');
|
||||
|
||||
if(!$newEmail) return $this->stop('msg_invalid_request');
|
||||
if(!$newEmail) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
// Check managed Email Host
|
||||
|
|
@ -2907,16 +2907,16 @@ class memberController extends member
|
|||
$hosts[] = $host->email_host;
|
||||
}
|
||||
$message = sprintf($managed_email_host[$emailhost_check],implode(', ',$hosts),'id@'.implode(', id@',$hosts));
|
||||
return new BaseObject(-1, $message);
|
||||
return $this->setError($message);
|
||||
}
|
||||
|
||||
// Check if the e-mail address is already registered
|
||||
$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
|
||||
if($member_srl) return new BaseObject(-1,'msg_exists_email_address');
|
||||
if($member_srl) return $this->setError('msg_exists_email_address');
|
||||
|
||||
if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
|
||||
{
|
||||
return $this->stop('msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
unset($_SESSION['rechecked_password_step']);
|
||||
|
||||
|
|
@ -3018,7 +3018,7 @@ class memberController extends member
|
|||
**/
|
||||
function triggerGetDocumentMenu(&$menu_list)
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject();
|
||||
if(!Context::get('is_logged')) return;
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$document_srl = Context::get('target_srl');
|
||||
|
|
@ -3029,14 +3029,12 @@ class memberController extends member
|
|||
$member_srl = $oDocument->get('member_srl');
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
|
||||
if(!$member_srl) return new BaseObject();
|
||||
if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
|
||||
if(!$member_srl) return;
|
||||
if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return;
|
||||
|
||||
$oDocumentController = getController('document');
|
||||
$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3048,7 +3046,7 @@ class memberController extends member
|
|||
**/
|
||||
function triggerGetCommentMenu(&$menu_list)
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject();
|
||||
if(!Context::get('is_logged')) return;
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$comment_srl = Context::get('target_srl');
|
||||
|
|
@ -3059,14 +3057,12 @@ class memberController extends member
|
|||
$module_srl = $oComment->get('module_srl');
|
||||
$member_srl = $oComment->get('member_srl');
|
||||
|
||||
if(!$member_srl) return new BaseObject();
|
||||
if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
|
||||
if(!$member_srl) return;
|
||||
if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return;
|
||||
|
||||
$oCommentController = getController('comment');
|
||||
$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
|
||||
$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3076,7 +3072,7 @@ class memberController extends member
|
|||
**/
|
||||
function procMemberSpammerManage()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$member_srl = Context::get('member_srl');
|
||||
|
|
@ -3093,7 +3089,7 @@ class memberController extends member
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
$grant = $oModuleModel->getGrant($module_info, $logged_info);
|
||||
|
||||
if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return $this->setError('msg_not_permitted');
|
||||
|
||||
$proc_msg = "";
|
||||
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ class memberView extends member
|
|||
// A message appears if the user is not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_logged');
|
||||
return $this->setError('msg_not_logged');
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -432,7 +432,7 @@ class memberView extends member
|
|||
$folder_srl = (int)Context::get('folder_srl');
|
||||
if($folder_srl && !array_filter($folders, function($folder) use($folder_srl) { return $folder->folder_srl == $folder_srl; }))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
if(!$folder_srl && count($folders))
|
||||
{
|
||||
|
|
@ -740,7 +740,7 @@ class memberView extends member
|
|||
**/
|
||||
function dispMemberSpammer()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
|
||||
$member_srl = Context::get('member_srl');
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
|
@ -751,7 +751,7 @@ class memberView extends member
|
|||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
|
||||
|
||||
if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!$grant->manager) return $this->setError('msg_not_permitted');
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
|
||||
|
|
@ -783,7 +783,7 @@ class memberView extends member
|
|||
{
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class menuAdminController extends menu
|
|||
{
|
||||
if(!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
foreach($moduleInfos as $moduleInfo)
|
||||
|
|
@ -252,7 +252,7 @@ class menuAdminController extends menu
|
|||
|
||||
$oAdmin = getClass('admin');
|
||||
if($menuInfo->title == $oAdmin->getAdminMenuName())
|
||||
return new BaseObject(-1, 'msg_adminmenu_cannot_delete');
|
||||
return $this->setError('msg_adminmenu_cannot_delete');
|
||||
|
||||
// get menu properies with child menu
|
||||
$phpFile = sprintf("./files/cache/menu/%s.php", $menu_srl);
|
||||
|
|
@ -283,13 +283,13 @@ class menuAdminController extends menu
|
|||
|
||||
if($isStartmenuInclude)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cannot_delete_homemenu');
|
||||
return $this->setError('msg_cannot_delete_homemenu');
|
||||
}
|
||||
|
||||
$output = $this->deleteMenu($menu_srl);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return new BaseObject(-1, $output->message);
|
||||
return $this->setError($output->message);
|
||||
}
|
||||
|
||||
$this->setMessage('success_deleted', 'info');
|
||||
|
|
@ -389,13 +389,13 @@ class menuAdminController extends menu
|
|||
|
||||
if(!$request->parent_srl || !$request->menu_name)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$this->_setMenuSrl($request->parent_srl, $request->menu_srl);
|
||||
if(!$request->menu_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
if($request->is_shortcut == 'Y')
|
||||
|
|
@ -475,7 +475,7 @@ class menuAdminController extends menu
|
|||
$itemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
|
||||
if(!$itemInfo->menu_item_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
unset($itemInfo->normal_btn, $itemInfo->hover_btn, $itemInfo->active_btn);
|
||||
|
||||
|
|
@ -540,7 +540,7 @@ class menuAdminController extends menu
|
|||
|
||||
if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// when menu copy, module already copied
|
||||
|
|
@ -549,7 +549,7 @@ class menuAdminController extends menu
|
|||
$result = $this->_insertModule($request, $args);
|
||||
if(!$result->toBool())
|
||||
{
|
||||
return new BaseObject(-1, $result->message);
|
||||
return $this->setError($result->message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -560,7 +560,7 @@ class menuAdminController extends menu
|
|||
|
||||
if(!$request->module_id)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args->url = $request->module_id;
|
||||
|
|
@ -625,7 +625,7 @@ class menuAdminController extends menu
|
|||
$output = $oModuleModel->getModuleInfoByMid($request->module_id);
|
||||
if($output->module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_module_name_exists');
|
||||
return $this->setError('msg_module_name_exists');
|
||||
}
|
||||
|
||||
$oModuleController = getController('module');
|
||||
|
|
@ -644,7 +644,7 @@ class menuAdminController extends menu
|
|||
|
||||
if(!$request->menu_item_srl || !$request->menu_name)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// variables set
|
||||
|
|
@ -671,7 +671,7 @@ class menuAdminController extends menu
|
|||
$newItemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
|
||||
if(!$newItemInfo->menu_item_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$args->url = $newItemInfo->url;
|
||||
|
|
@ -691,7 +691,7 @@ class menuAdminController extends menu
|
|||
$output = $oModuleModel->getModuleInfoByMid($request->module_id);
|
||||
if($output->module_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_module_name_exists');
|
||||
return $this->setError('msg_module_name_exists');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -699,7 +699,7 @@ class menuAdminController extends menu
|
|||
$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url);
|
||||
if(!$moduleInfo)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$moduleInfo->mid = $request->module_id;
|
||||
|
|
@ -892,7 +892,7 @@ class menuAdminController extends menu
|
|||
$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
|
||||
if($isStartmenuInclude)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_cannot_delete_homemenu');
|
||||
return $this->setError('msg_cannot_delete_homemenu');
|
||||
}
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
|
|
@ -990,7 +990,7 @@ class menuAdminController extends menu
|
|||
$output = $this->_deleteMenuItem($oDB, $menuInfo, $node);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return new BaseObject(-1, $output->message);
|
||||
return $this->setError($output->message);
|
||||
}
|
||||
|
||||
if(is_array($node['list']))
|
||||
|
|
@ -1013,7 +1013,7 @@ class menuAdminController extends menu
|
|||
$source_srl = Context::get('source_srl'); // Same hierarchy's menu item serial number
|
||||
$target_srl = Context::get('target_srl'); // Self menu item serial number
|
||||
|
||||
if(!$mode || !$parent_srl || !$target_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$mode || !$parent_srl || !$target_srl) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oMenuAdminModel = getAdminModel('menu');
|
||||
|
||||
|
|
@ -1023,7 +1023,7 @@ class menuAdminController extends menu
|
|||
$targetMenuItemInfo = $oMenuAdminModel->getMenuItemInfo($target_srl);
|
||||
if(!$originalItemInfo->menu_item_srl || (!$targetMenuInfo->menu_srl && !$targetMenuItemInfo->menu_item_srl))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_empty_menu_item');
|
||||
return $this->setError('msg_empty_menu_item');
|
||||
}
|
||||
|
||||
// get menu properies with child menu
|
||||
|
|
@ -1407,7 +1407,7 @@ class menuAdminController extends menu
|
|||
$oMenuAdminModel = getAdminModel('menu');
|
||||
|
||||
$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
|
||||
if($target_item->menu_item_srl != $target_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if($target_item->menu_item_srl != $target_srl) return $this->setError('msg_invalid_request');
|
||||
// Move the menu location(change the order menu appears)
|
||||
if($mode == 'move')
|
||||
{
|
||||
|
|
@ -1418,7 +1418,7 @@ class menuAdminController extends menu
|
|||
if($source_srl)
|
||||
{
|
||||
$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
|
||||
if($source_item->menu_item_srl != $source_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if($source_item->menu_item_srl != $source_srl) return $this->setError('msg_invalid_request');
|
||||
$args->listorder = $source_item->listorder-1;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -614,7 +614,7 @@ class menuAdminModel extends menu
|
|||
$menuItemSrl = Context::get('menu_item_srl');
|
||||
if(!$menuItemSrl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$menuItemInfo = $this->getMenuItemInfo($menuItemSrl);
|
||||
|
|
@ -622,7 +622,7 @@ class menuAdminModel extends menu
|
|||
// if menu is shortcut
|
||||
if($menuItemInfo->is_shortcut == 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// get module info
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ class menu extends ModuleObject
|
|||
{
|
||||
// Create a directory to use menu
|
||||
FileHandler::makeDir('./files/cache/menu');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -182,8 +180,6 @@ class menu extends ModuleObject
|
|||
|
||||
$this->recompileCache();
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class message extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -57,7 +57,6 @@ class message extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class moduleAdminController extends module
|
|||
{
|
||||
$mid = trim($args->{"mid_".$i});
|
||||
if(!$mid) continue;
|
||||
if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new BaseObject(-1, 'msg_limit_mid');
|
||||
if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return $this->setError('msg_limit_mid');
|
||||
$browser_title = $args->{"browser_title_".$i};
|
||||
if(!$mid) continue;
|
||||
if($mid && !$browser_title) $browser_title = $mid;
|
||||
|
|
@ -282,7 +282,7 @@ class moduleAdminController extends module
|
|||
// Get information of the module
|
||||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
if(!$module_info) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_info) return $this->setError('msg_invalid_request');
|
||||
// Register Admin ID
|
||||
$oModuleController->deleteAdminId($module_srl);
|
||||
$admin_member = Context::get('admin_member');
|
||||
|
|
@ -509,10 +509,10 @@ class moduleAdminController extends module
|
|||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
if(!$vars->module_srls) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$vars->module_srls) return $this->setError('msg_invalid_request');
|
||||
|
||||
$module_srls = explode(',',$vars->module_srls);
|
||||
if(count($module_srls) < 1) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(count($module_srls) < 1) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController= getController('module');
|
||||
|
|
@ -564,10 +564,10 @@ class moduleAdminController extends module
|
|||
function procModuleAdminModuleGrantSetup()
|
||||
{
|
||||
$module_srls = Context::get('module_srls');
|
||||
if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_srls) return $this->setError('msg_invalid_request');
|
||||
|
||||
$modules = explode(',',$module_srls);
|
||||
if(count($modules) < 1) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(count($modules) < 1) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleController = getController('module');
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -676,7 +676,7 @@ class moduleAdminController extends module
|
|||
// if args->name is empty, random generate for user define language
|
||||
if(empty($args->name)) $args->name = 'userLang'.date('YmdHis').''.sprintf('%03d', mt_rand(0, 100));
|
||||
|
||||
if(!$args->name) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$args->name) return $this->setError('msg_invalid_request');
|
||||
// Check whether a language code exists
|
||||
$output = executeQueryArray('module.getLang', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -723,7 +723,7 @@ class moduleAdminController extends module
|
|||
$args->name = str_replace(' ','_',Context::get('name'));
|
||||
$args->lang_name = str_replace(' ','_',Context::get('lang_name'));
|
||||
if(!empty($args->lang_name)) $args->name = $args->lang_name;
|
||||
if(!$args->name) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$args->name) return $this->setError('msg_invalid_request');
|
||||
|
||||
$output = executeQuery('module.deleteLang', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -737,7 +737,7 @@ class moduleAdminController extends module
|
|||
|
||||
function procModuleAdminGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
|
||||
$oModuleController = getController('module');
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ class moduleAdminModel extends module
|
|||
|
||||
if($targetModule == '_SHORTCUT')
|
||||
{
|
||||
return new BaseObject(0);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -453,7 +453,7 @@ class moduleAdminModel extends module
|
|||
function getModuleAdminLangCode()
|
||||
{
|
||||
$name = Context::get('name');
|
||||
if(!$name) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$name) return $this->setError('msg_invalid_request');
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$this->add('name', $name);
|
||||
$output = $this->getLangCode($site_module_info->site_srl, '$user_lang->'.$name);
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ class moduleAdminView extends module
|
|||
$module_srls = Context::get('module_srls');
|
||||
|
||||
$modules = explode(',',$module_srls);
|
||||
if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!count($modules)) if(!$module_srls) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$columnList = array('module_srl', 'module');
|
||||
|
|
@ -201,7 +201,7 @@ class moduleAdminView extends module
|
|||
$module_srls = Context::get('module_srls');
|
||||
|
||||
$modules = explode(',',$module_srls);
|
||||
if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!count($modules)) if(!$module_srls) return $this->setError('msg_invalid_request');
|
||||
// pre-define variables because you can get contents from other module (call by reference)
|
||||
$content = '';
|
||||
// Call a trigger for additional settings
|
||||
|
|
@ -224,7 +224,7 @@ class moduleAdminView extends module
|
|||
$module_srls = Context::get('module_srls');
|
||||
|
||||
$modules = explode(',',$module_srls);
|
||||
if(!count($modules)) if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!count($modules)) if(!$module_srls) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$columnList = array('module_srl', 'module', 'site_srl');
|
||||
|
|
|
|||
|
|
@ -45,8 +45,6 @@ class module extends ModuleObject
|
|||
FileHandler::makeDir('./files/cache/module_info');
|
||||
FileHandler::makeDir('./files/cache/triggers');
|
||||
FileHandler::makeDir('./files/ruleset');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -393,8 +391,6 @@ class module extends ModuleObject
|
|||
{
|
||||
$oDB->modifyColumn('module_config', 'config', 'bigtext');
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ class moduleController extends module
|
|||
if(isSiteID($domain))
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
if($oModuleModel->isIDExists($domain, 0)) return new BaseObject(-1,'msg_already_registed_vid');
|
||||
if($oModuleModel->isIDExists($domain, 0)) return new BaseObject(-1, 'msg_already_registed_vid');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -299,8 +299,8 @@ class moduleController extends module
|
|||
if($site_info->domain != $args->domain)
|
||||
{
|
||||
$info = $oModuleModel->getSiteInfoByDomain($args->domain, $columnList);
|
||||
if($info->site_srl && $info->site_srl != $args->site_srl) return new BaseObject(-1,'msg_already_registed_domain');
|
||||
if(isSiteID($args->domain) && $oModuleModel->isIDExists($args->domain)) return new BaseObject(-1,'msg_already_registed_vid');
|
||||
if($info->site_srl && $info->site_srl != $args->site_srl) return new BaseObject(-1, 'msg_already_registed_domain');
|
||||
if(isSiteID($args->domain) && $oModuleModel->isIDExists($args->domain)) return new BaseObject(-1, 'msg_already_registed_vid');
|
||||
|
||||
if($args->domain && !isSiteID($args->domain))
|
||||
{
|
||||
|
|
@ -704,7 +704,7 @@ class moduleController extends module
|
|||
*/
|
||||
public function onlyDeleteModule($module_srl)
|
||||
{
|
||||
if(!$module_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
|
||||
// check start module
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -1078,7 +1078,7 @@ class moduleController extends module
|
|||
if ($ajax) Context::setRequestMethod('JSON');
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return $this->setError('msg_not_permitted');
|
||||
|
||||
$vars = Context::gets('addfile','filter');
|
||||
$attributeNames = Context::get('attribute_name');
|
||||
|
|
@ -1107,7 +1107,7 @@ class moduleController extends module
|
|||
$filter = array_map('trim', explode(',',$vars->filter));
|
||||
if (!in_array($ext, $filter))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_error_occured');
|
||||
return $this->setError('msg_error_occured');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1122,10 +1122,10 @@ class moduleController extends module
|
|||
// insert
|
||||
else
|
||||
{
|
||||
if(!Context::isUploaded()) return new BaseObject(-1, 'msg_error_occured');
|
||||
if(!Context::isUploaded()) return $this->setError('msg_error_occured');
|
||||
$addfile = Context::get('addfile');
|
||||
if(!is_uploaded_file($addfile['tmp_name'])) return new BaseObject(-1, 'msg_error_occured');
|
||||
if($vars->addfile['error'] != 0) return new BaseObject(-1, 'msg_error_occured');
|
||||
if(!is_uploaded_file($addfile['tmp_name'])) return $this->setError('msg_error_occured');
|
||||
if($vars->addfile['error'] != 0) return $this->setError('msg_error_occured');
|
||||
$output = $this->insertModuleFileBox($vars);
|
||||
}
|
||||
|
||||
|
|
@ -1224,10 +1224,10 @@ class moduleController extends module
|
|||
function procModuleFileBoxDelete()
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return $this->setError('msg_not_permitted');
|
||||
|
||||
$module_filebox_srl = Context::get('module_filebox_srl');
|
||||
if(!$module_filebox_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$module_filebox_srl) return $this->setError('msg_invalid_request');
|
||||
$vars = new stdClass();
|
||||
$vars->module_filebox_srl = $module_filebox_srl;
|
||||
$output = $this->deleteModuleFileBox($vars);
|
||||
|
|
|
|||
|
|
@ -2344,7 +2344,7 @@ class moduleModel extends module
|
|||
function getFileBoxListHtml()
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return $this->setError('msg_not_permitted');
|
||||
$link = parse_url($_SERVER["HTTP_REFERER"]);
|
||||
$link_params = explode('&',$link['query']);
|
||||
foreach ($link_params as $param)
|
||||
|
|
|
|||
|
|
@ -123,15 +123,15 @@ class moduleView extends module
|
|||
function dispModuleFileBox()
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return $this->setError('msg_not_permitted');
|
||||
|
||||
$input_name = Context::get('input');
|
||||
if(!preg_match('/^[a-z0-9_]+$/i', $input_name))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
if(!$input_name) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if(!$input_name) return $this->setError('msg_not_permitted');
|
||||
|
||||
$addscript = sprintf('<script>//<![CDATA[
|
||||
var selected_filebox_input_name = "%s";
|
||||
|
|
@ -154,7 +154,7 @@ class moduleView extends module
|
|||
function dispModuleFileBoxAdd()
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return $this->setError('msg_not_permitted');
|
||||
|
||||
$filter = Context::get('filter');
|
||||
if($filter) Context::set('arrfilter',explode(',',$filter));
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class ncenterliteAdminController extends ncenterlite
|
|||
$output = $oModuleController->insertModuleConfig('ncenterlite', $config);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return new BaseObject(-1, 'ncenterlite_msg_setting_error');
|
||||
return $this->setError('ncenterlite_msg_setting_error');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class ncenterlite extends ModuleObject
|
|||
|
||||
function moduleInstall()
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
function checkUpdate()
|
||||
|
|
@ -246,8 +246,6 @@ class ncenterlite extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
function recompileCache()
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class ncenterliteController extends ncenterlite
|
|||
$config = $oNcenterliteModel->getConfig();
|
||||
if($config->user_notify_setting != 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_use_user_setting');
|
||||
return $this->setError('msg_not_use_user_setting');
|
||||
}
|
||||
|
||||
$member_srl = Context::get('member_srl');
|
||||
|
|
@ -21,7 +21,7 @@ class ncenterliteController extends ncenterlite
|
|||
|
||||
if($logged_info->member_srl != $member_srl && $logged_info->is_admin != 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'ncenterlite_stop_no_permission_other_user_settings');
|
||||
return $this->setError('ncenterlite_stop_no_permission_other_user_settings');
|
||||
}
|
||||
|
||||
$user_config = $oNcenterliteModel->getUserConfig($member_srl);
|
||||
|
|
@ -66,7 +66,7 @@ class ncenterliteController extends ncenterlite
|
|||
$member_srl = $obj->member_srl;
|
||||
if(!$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -80,14 +80,13 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$this->removeFlagFile($args->member_srl);
|
||||
}
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
function triggerAfterInsertDocument(&$obj)
|
||||
{
|
||||
if ($obj->disable_triggers[$this->module] === true)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -109,7 +108,7 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
if(!$mention_targets && !count($mention_targets) || !isset($config->use['mention']))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$this->insertMentionByTargets($mention_targets, $obj, $module_info, $is_anonymous);
|
||||
|
|
@ -144,8 +143,6 @@ class ncenterliteController extends ncenterlite
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
function triggerAfterInsertComment($obj)
|
||||
|
|
@ -215,7 +212,7 @@ class ncenterliteController extends ncenterlite
|
|||
|
||||
if(!isset($config->use['comment']))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// 대댓글
|
||||
|
|
@ -230,13 +227,13 @@ class ncenterliteController extends ncenterlite
|
|||
$parent_member_config = $comment_member_config->data;
|
||||
if($parent_member_config->comment_notify != 'Y')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($admin_list) && in_array(abs($member_srl), $admin_list) && isset($config->use['admin_content']) && $obj->admin_comment_notify == true)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!in_array(abs($member_srl), $notify_member_srls) && (!Context::get('is_logged') || ($member_srl != 0 && abs($member_srl) != $logged_info->member_srl)))
|
||||
|
|
@ -270,7 +267,7 @@ class ncenterliteController extends ncenterlite
|
|||
|
||||
if(is_array($admin_list) && in_array(abs($member_srl), $admin_list) && isset($config->use['admin_content']) && $obj->admin_comment_notify == true)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
if($config->user_notify_setting == 'Y')
|
||||
|
|
@ -279,7 +276,7 @@ class ncenterliteController extends ncenterlite
|
|||
$document_comment_member_config = $comment_member_config->data;
|
||||
if($document_comment_member_config->comment_notify != 'Y')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -303,8 +300,6 @@ class ncenterliteController extends ncenterlite
|
|||
$this->_insertNotify($args, $is_anonymous);
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
function triggerAfterSendMessage($obj)
|
||||
|
|
@ -315,12 +310,12 @@ class ncenterliteController extends ncenterlite
|
|||
|
||||
if($communication_config->enable_message != 'Y')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!isset($config->use['message']))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
if($config->user_notify_setting == 'Y')
|
||||
|
|
@ -329,7 +324,7 @@ class ncenterliteController extends ncenterlite
|
|||
$message_member_config = $messages_member_config->data;
|
||||
if($message_member_config->message_notify != 'Y')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -357,12 +352,12 @@ class ncenterliteController extends ncenterlite
|
|||
$config = $oNcenterliteModel->getConfig();
|
||||
if(!isset($config->use['vote']))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
if($obj->point < 0)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -436,7 +431,7 @@ class ncenterliteController extends ncenterlite
|
|||
$config = $oNcenterliteModel->getConfig();
|
||||
if(empty($config->use))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$notify_list = $oNcenterliteModel->getNotifyMemberSrlByCommentSrl($obj->comment_srl);
|
||||
|
|
@ -461,8 +456,6 @@ class ncenterliteController extends ncenterlite
|
|||
$this->removeFlagFile($member_srl);
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
function triggerAfterDeleteDocument(&$obj)
|
||||
|
|
@ -471,7 +464,7 @@ class ncenterliteController extends ncenterlite
|
|||
$config = $oNcenterliteModel->getConfig();
|
||||
if(empty($config->use))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -481,7 +474,6 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
function triggerAfterMoveToTrash(&$obj)
|
||||
|
|
@ -502,7 +494,7 @@ class ncenterliteController extends ncenterlite
|
|||
|
||||
if(empty($config->use))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -516,7 +508,6 @@ class ncenterliteController extends ncenterlite
|
|||
$this->removeFlagFile($member_srl);
|
||||
}
|
||||
}
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
function triggerAfterModuleHandlerProc(&$oModule)
|
||||
|
|
@ -535,7 +526,7 @@ class ncenterliteController extends ncenterlite
|
|||
// if the array is empty, lets return.
|
||||
if(empty($config->use))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
$this->_hide_ncenterlite = false;
|
||||
if($oModule->module == 'beluxe' && Context::get('is_modal'))
|
||||
|
|
@ -709,8 +700,6 @@ class ncenterliteController extends ncenterlite
|
|||
$this->removeFlagFile($args->member_srl);
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
function triggerBeforeDisplay(&$output_display)
|
||||
|
|
@ -719,30 +708,30 @@ class ncenterliteController extends ncenterlite
|
|||
// 팝업창이면 중지
|
||||
if(Context::get('ncenterlite_is_popup'))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// 자신의 알림목록을 보고 있을 경우엔 알림센터창을 띄우지 않는다.
|
||||
if($act == 'dispNcenterliteNotifyList')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
if(Context::isLocked())
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// HTML 모드가 아니면 중지 + act에 admin이 포함되어 있으면 중지
|
||||
if(Context::getResponseMethod() != 'HTML' || strpos(strtolower(Context::get('act')), 'admin') !== false)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// 로그인 상태가 아니면 중지
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$module_info = Context::get('module_info');
|
||||
|
|
@ -751,7 +740,7 @@ class ncenterliteController extends ncenterlite
|
|||
// admin 모듈이면 중지
|
||||
if($module_info->module == 'admin')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$oNcenterliteModel = getModel('ncenterlite');
|
||||
|
|
@ -760,18 +749,18 @@ class ncenterliteController extends ncenterlite
|
|||
// if the array is empty, dose not output the notification.
|
||||
if(empty($config->use))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
if($config->display_use == 'mobile' && !Mobile::isFromMobilePhone() || $config->display_use == 'pc' && Mobile::isFromMobilePhone() || $config->display_use == 'none')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// 노티바 제외 페이지이면 중지
|
||||
if(in_array($module_info->module_srl, $config->hide_module_srls))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
Context::set('ncenterlite_config', $config);
|
||||
|
|
@ -785,7 +774,7 @@ class ncenterliteController extends ncenterlite
|
|||
// 알림 메시지가 없어도 항상 표시하게 하려면 이 줄을 제거 또는 주석 처리하세요.
|
||||
if(!$_output->data)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$_latest_notify_id = array_slice($_output->data, 0, 1);
|
||||
|
|
@ -794,7 +783,7 @@ class ncenterliteController extends ncenterlite
|
|||
|
||||
if($_COOKIE['_ncenterlite_hide_id'] && $_COOKIE['_ncenterlite_hide_id'] == $_latest_notify_id)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
setcookie('_ncenterlite_hide_id', '', 0, '/');
|
||||
|
||||
|
|
@ -847,7 +836,7 @@ class ncenterliteController extends ncenterlite
|
|||
$logged_info = Context::get('logged_info');
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
$target_srl = Context::get('target_srl');
|
||||
|
||||
|
|
@ -865,8 +854,6 @@ class ncenterliteController extends ncenterlite
|
|||
{
|
||||
$oMemberController->addMemberMenu('dispNcenterliteUserConfig', 'ncenterlite_my_settings');
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
function _addFile()
|
||||
|
|
@ -965,7 +952,7 @@ class ncenterliteController extends ncenterlite
|
|||
$logged_info = Context::get('logged_info');
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$output = $this->updateNotifyReadAll($logged_info->member_srl);
|
||||
|
|
@ -979,7 +966,7 @@ class ncenterliteController extends ncenterlite
|
|||
$notify = Context::get('notify');
|
||||
if(!$logged_info || !$url || !$notify)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$output = $this->updateNotifyRead($notify, $logged_info->member_srl);
|
||||
|
|
|
|||
|
|
@ -45,13 +45,13 @@ class ncenterliteView extends ncenterlite
|
|||
$config = $oNcenterliteModel->getConfig();
|
||||
if($config->user_notify_setting != 'Y')
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_use_user_setting');
|
||||
return $this->setError('msg_not_use_user_setting');
|
||||
}
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
$member_srl = Context::get('member_srl');
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'ncenterlite_stop_login_required');
|
||||
if(!Context::get('is_logged')) return $this->setError('ncenterlite_stop_login_required');
|
||||
|
||||
if($logged_info->is_admin == 'Y')
|
||||
{
|
||||
|
|
@ -62,7 +62,7 @@ class ncenterliteView extends ncenterlite
|
|||
{
|
||||
if($member_srl != $logged_info->member_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'ncenterlite_stop_no_permission_other_user');
|
||||
return $this->setError('ncenterlite_stop_no_permission_other_user');
|
||||
}
|
||||
}
|
||||
$output = $oNcenterliteModel->getUserConfig($member_srl);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class pageAdminController extends page
|
|||
{
|
||||
$module_srl = Context::get('module_srl');
|
||||
$content = Context::get('content');
|
||||
if(!$module_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
$mcontent = Context::get('mcontent');
|
||||
$type = Context::get('type');
|
||||
// Guhaeom won information page
|
||||
|
|
@ -301,7 +301,7 @@ class pageAdminController extends page
|
|||
|
||||
if(!$grant->manager)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$obj = Context::getRequestVars();
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class pageAdminView extends page
|
|||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, sprintf('%s method is not exists', $method));
|
||||
return $this->setError(sprintf('%s method is not exists', $method));
|
||||
}
|
||||
|
||||
Context::set('module_info', $this->module_info);
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ class page extends ModuleObject
|
|||
{
|
||||
// page generated from the cache directory to use
|
||||
FileHandler::makeDir('./files/cache/page');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -76,7 +74,6 @@ class page extends ModuleObject
|
|||
$skin_args->is_skin_fix = "Y";
|
||||
$ouput = executeQuery('page.updateSkinFix', $skin_args);
|
||||
}
|
||||
return new BaseObject(0,'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class pageMobile extends pageView
|
|||
$page_type_name = strtolower($this->module_info->page_type);
|
||||
$method = '_get' . ucfirst($page_type_name) . 'Content';
|
||||
if (method_exists($this, $method)) $page_content = $this->{$method}();
|
||||
else return new BaseObject(-1, sprintf('%s method is not exists', $method));
|
||||
else return $this->setError('%s method is not exists', $method);
|
||||
|
||||
Context::set('module_info', $this->module_info);
|
||||
Context::set('page_content', $page_content);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class pageView extends page
|
|||
$page_type_name = strtolower($this->module_info->page_type);
|
||||
$method = '_get' . ucfirst($page_type_name) . 'Content';
|
||||
if(method_exists($this, $method)) $page_content = $this->{$method}();
|
||||
else return new BaseObject(-1, sprintf('%s method is not exists', $method));
|
||||
else return $this->setError('%s method is not exists', $method);
|
||||
|
||||
Context::set('module_info', $this->module_info);
|
||||
Context::set('page_content', $page_content);
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class pointAdminController extends point
|
|||
function procPointAdminInsertPointModuleConfig()
|
||||
{
|
||||
$module_srl = Context::get('target_module_srl');
|
||||
if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
// In case of batch configuration of several modules
|
||||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||
else $module_srl = array($module_srl);
|
||||
|
|
@ -341,7 +341,7 @@ class pointAdminController extends point
|
|||
$position = (int)Context::get('position');
|
||||
$total = (int)Context::get('total');
|
||||
|
||||
if(!file_exists('./files/cache/pointRecal.txt')) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!file_exists('./files/cache/pointRecal.txt')) return $this->setError('msg_invalid_request');
|
||||
|
||||
$idx = 0;
|
||||
$f = fopen("./files/cache/pointRecal.txt","r");
|
||||
|
|
@ -384,7 +384,7 @@ class pointAdminController extends point
|
|||
function procPointAdminReset()
|
||||
{
|
||||
$module_srl = Context::get('module_srls');
|
||||
if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
// In case of batch configuration of several modules
|
||||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||
else $module_srl = array($module_srl);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ class point extends ModuleObject
|
|||
$oModuleController->deleteTrigger($trigger[0], $this->module, $trigger[2], $trigger[3], $trigger[1]);
|
||||
}
|
||||
}
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -158,7 +157,7 @@ class point extends ModuleObject
|
|||
FileHandler::makeDir('./files/member_extra_info/point');
|
||||
|
||||
// Register triggers.
|
||||
return $this->registerTriggers();
|
||||
$this->registerTriggers();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,20 +22,18 @@ class pointController extends point
|
|||
$member_srl = $obj->member_srl;
|
||||
if (!$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$config = $this->getConfig();
|
||||
$point = intval($config->signup_point);
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$cur_point = getModel('point')->getPoint($member_srl, true);
|
||||
$this->setPoint($member_srl, $cur_point + $point, 'signup');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -46,26 +44,24 @@ class pointController extends point
|
|||
$member_srl = $obj->member_srl;
|
||||
if (!$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Points are given only once a day.
|
||||
if (substr($obj->last_login, 0, 8) === date('Ymd'))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$config = $this->getConfig();
|
||||
$point = intval($config->login_point);
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$cur_point = getModel('point')->getPoint($member_srl, true);
|
||||
$this->setPoint($member_srl, $cur_point + $point);
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -82,8 +78,6 @@ class pointController extends point
|
|||
unset($config->point_group[$group_srl]);
|
||||
getController('module')->insertModuleConfig('point', $config);
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -95,17 +89,17 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// The fix to disable giving points for saving the document temporarily
|
||||
if ($module_srl == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
if ($obj->status === getModel('document')->getConfigStatus('temp'))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -124,7 +118,6 @@ class pointController extends point
|
|||
|
||||
// Increase the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -140,7 +133,7 @@ class pointController extends point
|
|||
$member_srl = abs($oDocument->get('member_srl'));
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Only give points if the document is being updated from TEMP to another status such as PUBLIC.
|
||||
|
|
@ -153,7 +146,7 @@ class pointController extends point
|
|||
$cur_point += $attached_files_point * ($obj->uploaded_count - $oDocument->get('uploaded_count'));
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
}
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -172,7 +165,6 @@ class pointController extends point
|
|||
|
||||
// Increase the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -180,7 +172,7 @@ class pointController extends point
|
|||
*/
|
||||
public function triggerBeforeDeleteDocument($obj)
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -192,17 +184,17 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// The fix to disable giving points for saving the document temporarily
|
||||
if ($module_srl == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
if ($obj->status === getModel('document')->getConfigStatus('temp'))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -217,7 +209,6 @@ class pointController extends point
|
|||
|
||||
// Increase the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -229,21 +220,21 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Abort if the comment and the document have the same author.
|
||||
$oDocument = getModel('document')->getDocument($obj->document_srl);
|
||||
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Abort if the document is older than a configured limit.
|
||||
$config = $this->getConfig();
|
||||
if ($config->no_point_date > 0 && ztime($oDocument->get('regdate')) < time() - ($config->no_point_date * 86400))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -262,7 +253,6 @@ class pointController extends point
|
|||
|
||||
// Increase the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -270,7 +260,7 @@ class pointController extends point
|
|||
*/
|
||||
public function triggerUpdateComment($obj)
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -282,21 +272,21 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Abort if the comment and the document have the same author.
|
||||
$oDocument = getModel('document')->getDocument($obj->document_srl);
|
||||
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Abort if the document is older than a configured limit.
|
||||
$config = $this->getConfig();
|
||||
if ($config->no_point_date > 0 && ztime($oDocument->get('regdate')) < ztime($obj->regdate) - ($config->no_point_date * 86400))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -308,7 +298,6 @@ class pointController extends point
|
|||
|
||||
// Increase the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -317,7 +306,7 @@ class pointController extends point
|
|||
*/
|
||||
public function triggerInsertFile($obj)
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -330,7 +319,7 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if (!$module_srl || !$member_srl || $obj->isvalid !== 'Y')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -342,7 +331,6 @@ class pointController extends point
|
|||
|
||||
// Update the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -356,13 +344,13 @@ class pointController extends point
|
|||
|
||||
if ($member_srl && abs($obj->member_srl) == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$point = $this->_getModulePointConfig($module_srl, 'download_file');
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get current points.
|
||||
|
|
@ -376,7 +364,6 @@ class pointController extends point
|
|||
}
|
||||
|
||||
// Points will be adjusted after downloading (triggerDownloadFile).
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -390,19 +377,17 @@ class pointController extends point
|
|||
|
||||
if (!$member_srl || abs($obj->member_srl) == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$point = $this->_getModulePointConfig($module_srl, 'download_file');
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$cur_point = getModel('point')->getPoint($member_srl, true);
|
||||
$this->setPoint($member_srl, $cur_point + $point);
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -417,13 +402,13 @@ class pointController extends point
|
|||
$target_member_srl = abs($obj->get('member_srl'));
|
||||
if ($member_srl && $target_member_srl == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$point = $this->_getModulePointConfig($module_srl, 'read_document');
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// If the current member has already read this document, do not adjust points again.
|
||||
|
|
@ -435,7 +420,7 @@ class pointController extends point
|
|||
$output = executeQuery('document.getDocumentReadedLogInfo', $args);
|
||||
if ($output->data->count)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -465,8 +450,6 @@ class pointController extends point
|
|||
$output = executeQuery('document.insertDocumentReadedLog', $args);
|
||||
$this->setPoint($member_srl, $cur_point + $point);
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -480,11 +463,11 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if ($logged_member_srl && $logged_member_srl == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
elseif (!$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get current points.
|
||||
|
|
@ -503,7 +486,7 @@ class pointController extends point
|
|||
$point = $this->_getModulePointConfig($module_srl, $config_key);
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($obj->cancel) && $obj->cancel)
|
||||
|
|
@ -512,8 +495,6 @@ class pointController extends point
|
|||
}
|
||||
|
||||
$this->setPoint($member_srl, $cur_point + $point);
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class pointView extends point
|
|||
{
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new BaseObject();
|
||||
if(!$current_module_srl) return;
|
||||
}
|
||||
// Get the configuration information
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -60,8 +60,6 @@ class pointView extends point
|
|||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'point_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
}
|
||||
/* End of file point.view.php */
|
||||
|
|
|
|||
|
|
@ -61,7 +61,10 @@ class pollAdminModel extends poll
|
|||
{
|
||||
$this->add('document_srl', $oDocument->get('document_srl'));
|
||||
}
|
||||
else return new BaseObject(-1, 'msg_not_founded');
|
||||
else
|
||||
{
|
||||
$this->setError('msg_not_founded');
|
||||
}
|
||||
}
|
||||
}
|
||||
/* End of file poll.admin.model.php */
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ class poll extends ModuleObject
|
|||
$oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after');
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after');
|
||||
$oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -104,8 +102,6 @@ class poll extends ModuleObject
|
|||
{
|
||||
$oDB->addColumn('poll_item', 'add_user_srl', 'number', 11, 0);
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class pollController extends poll
|
|||
}
|
||||
}
|
||||
|
||||
if(!count($args->poll)) return new BaseObject(-1, 'cmd_null_item');
|
||||
if(!count($args->poll)) return $this->setError('cmd_null_item');
|
||||
|
||||
$args->stop_date = $stop_date;
|
||||
|
||||
|
|
@ -178,12 +178,12 @@ class pollController extends poll
|
|||
$poll_index_srl = (int) Context::get('index_srl');
|
||||
$poll_item_title = Context::get('title');
|
||||
|
||||
if($poll_item_title=='') return new BaseObject(-1,"msg_item_title_cannot_empty");
|
||||
if($poll_item_title=='') return $this->setError("msg_item_title_cannot_empty");
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info) return new BaseObject(-1,"msg_cannot_add_item");
|
||||
if(!$logged_info) return $this->setError("msg_cannot_add_item");
|
||||
|
||||
if(!$poll_srl || !$poll_index_srl) return new BaseObject(-1,"msg_invalid_request");
|
||||
if(!$poll_srl || !$poll_index_srl) return $this->setError("msg_invalid_request");
|
||||
|
||||
$args = new stdClass();
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
|
@ -191,10 +191,10 @@ class pollController extends poll
|
|||
// Get the information related to the survey
|
||||
$columnList = array('poll_type');
|
||||
$output = executeQuery('poll.getPoll', $args, $columnList);
|
||||
if(!$output->data) return new BaseObject(-1,"poll_no_poll_or_deleted_poll");
|
||||
if(!$output->data) return $this->setError("poll_no_poll_or_deleted_poll");
|
||||
$type = $output->data->poll_type;
|
||||
|
||||
if(!$this->isAbletoAddItem($type)) return new BaseObject(-1,"msg_cannot_add_item");
|
||||
if(!$this->isAbletoAddItem($type)) return $this->setError("msg_cannot_add_item");
|
||||
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
|
|
@ -227,9 +227,9 @@ class pollController extends poll
|
|||
$poll_item_srl = Context::get('item_srl');
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info) return new BaseObject(-1,"msg_cannot_delete_item");
|
||||
if(!$logged_info) return $this->setError("msg_cannot_delete_item");
|
||||
|
||||
if(!$poll_srl || !$poll_index_srl || !$poll_item_srl) return new BaseObject(-1,"msg_invalid_request");
|
||||
if(!$poll_srl || !$poll_index_srl || !$poll_item_srl) return $this->setError("msg_invalid_request");
|
||||
|
||||
$args = new stdClass();
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
|
@ -245,11 +245,11 @@ class pollController extends poll
|
|||
// Get the information related to the survey
|
||||
$columnList = array('member_srl');
|
||||
$output = executeQuery('poll.getPoll', $args, $columnList);
|
||||
if(!$output->data) return new BaseObject(-1,"poll_no_poll_or_deleted_poll");
|
||||
if(!$output->data) return $this->setError("poll_no_poll_or_deleted_poll");
|
||||
$poll_member_srl = $output->data->member_srl;
|
||||
|
||||
if($add_user_srl!=$logged_info->member_srl && $poll_member_srl!=$logged_info->member_srl) return new BaseObject(-1,"msg_cannot_delete_item");
|
||||
if($poll_count>0) return new BaseObject(-1,"msg_cannot_delete_item_poll_exist");
|
||||
if($add_user_srl!=$logged_info->member_srl && $poll_member_srl!=$logged_info->member_srl) return $this->setError("msg_cannot_delete_item");
|
||||
if($poll_count>0) return $this->setError("msg_cannot_delete_item_poll_exist");
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
|
@ -280,9 +280,9 @@ class pollController extends poll
|
|||
// Get the information related to the survey
|
||||
$columnList = array('poll_count', 'stop_date','poll_type');
|
||||
$output = executeQuery('poll.getPoll', $args, $columnList);
|
||||
if(!$output->data) return new BaseObject(-1,"poll_no_poll_or_deleted_poll");
|
||||
if(!$output->data) return $this->setError("poll_no_poll_or_deleted_poll");
|
||||
|
||||
if($output->data->stop_date < date("Ymd")) return new BaseObject(-1,"msg_cannot_vote");
|
||||
if($output->data->stop_date < date("Ymd")) return $this->setError("msg_cannot_vote");
|
||||
|
||||
$columnList = array('checkcount');
|
||||
$output = executeQuery('poll.getPollTitle', $args, $columnList);
|
||||
|
|
@ -290,7 +290,7 @@ class pollController extends poll
|
|||
|
||||
$poll_srl_indexes = Context::get('poll_srl_indexes');
|
||||
$tmp_item_srls = explode(',',$poll_srl_indexes);
|
||||
//if(count($tmp_item_srls)-1>(int)$output->data->checkcount) return new BaseObject(-1,"msg_exceed_max_select");
|
||||
//if(count($tmp_item_srls)-1>(int)$output->data->checkcount) return $this->setError("msg_exceed_max_select");
|
||||
for($i=0;$i<count($tmp_item_srls);$i++)
|
||||
{
|
||||
$srl = (int)trim($tmp_item_srls[$i]);
|
||||
|
|
@ -299,10 +299,10 @@ class pollController extends poll
|
|||
}
|
||||
|
||||
// If there is no response item, display an error
|
||||
if(!count($item_srls)) return new BaseObject(-1, 'msg_check_poll_item');
|
||||
if(!count($item_srls)) return $this->setError('msg_check_poll_item');
|
||||
// Make sure is the poll has already been taken
|
||||
$oPollModel = getModel('poll');
|
||||
if($oPollModel->isPolled($poll_srl)) return new BaseObject(-1, 'msg_already_poll');
|
||||
if($oPollModel->isPolled($poll_srl)) return $this->setError('msg_already_poll');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
|
@ -382,7 +382,7 @@ class pollController extends poll
|
|||
*/
|
||||
function procPollGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$pollSrls = Context::get('poll_srls');
|
||||
if($pollSrls) $pollSrlList = explode(',', $pollSrls);
|
||||
|
||||
|
|
@ -419,7 +419,6 @@ class pollController extends poll
|
|||
function triggerInsertDocumentPoll(&$obj)
|
||||
{
|
||||
$this->syncPoll($obj->document_srl, $obj->content);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -428,7 +427,6 @@ class pollController extends poll
|
|||
function triggerInsertCommentPoll(&$obj)
|
||||
{
|
||||
$this->syncPoll($obj->comment_srl, $obj->content);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -437,7 +435,6 @@ class pollController extends poll
|
|||
function triggerUpdateDocumentPoll(&$obj)
|
||||
{
|
||||
$this->syncPoll($obj->document_srl, $obj->content);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -446,7 +443,6 @@ class pollController extends poll
|
|||
function triggerUpdateCommentPoll(&$obj)
|
||||
{
|
||||
$this->syncPoll($obj->comment_srl, $obj->content);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -455,15 +451,15 @@ class pollController extends poll
|
|||
function triggerDeleteDocumentPoll(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new BaseObject();
|
||||
if(!$document_srl) return;
|
||||
// Get the poll
|
||||
$args = new stdClass();
|
||||
$args->upload_target_srl = $document_srl;
|
||||
$output = executeQuery('poll.getPollByTargetSrl', $args);
|
||||
if(!$output->data) return new BaseObject();
|
||||
if(!$output->data) return;
|
||||
|
||||
$poll_srl = $output->data->poll_srl;
|
||||
if(!$poll_srl) return new BaseObject();
|
||||
if(!$poll_srl) return;
|
||||
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
|
|
@ -478,8 +474,6 @@ class pollController extends poll
|
|||
|
||||
$output = executeQuery('poll.deletePollLog', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -488,15 +482,15 @@ class pollController extends poll
|
|||
function triggerDeleteCommentPoll(&$obj)
|
||||
{
|
||||
$comment_srl = $obj->comment_srl;
|
||||
if(!$comment_srl) return new BaseObject();
|
||||
if(!$comment_srl) return;
|
||||
// Get the poll
|
||||
$args = new stdClass();
|
||||
$args->upload_target_srl = $comment_srl;
|
||||
$output = executeQuery('poll.getPollByTargetSrl', $args);
|
||||
if(!$output->data) return new BaseObject();
|
||||
if(!$output->data) return;
|
||||
|
||||
$poll_srl = $output->data->poll_srl;
|
||||
if(!$poll_srl) return new BaseObject();
|
||||
if(!$poll_srl) return;
|
||||
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
|
|
@ -511,8 +505,6 @@ class pollController extends poll
|
|||
|
||||
$output = executeQuery('poll.deletePollLog', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ class pollModel extends poll
|
|||
$args->poll_srl = intval($poll_srl);
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
if(!$args->poll_srl || $args->poll_srl === 0) return new BaseObject(-1,"poll_no_poll_srl");
|
||||
if(!$args->poll_srl || $args->poll_srl === 0) return $this->setError("poll_no_poll_srl");
|
||||
|
||||
// Get the information related to the survey
|
||||
$columnList = array('poll_count', 'stop_date','poll_type','member_srl');
|
||||
$output = executeQuery('poll.getPoll', $args, $columnList);
|
||||
$poll_member_srl = $output->data->member_srl;
|
||||
if(!$output->data) return new BaseObject(-1,"poll_no_poll_or_deleted_poll");
|
||||
if(!$output->data) return $this->setError("poll_no_poll_or_deleted_poll");
|
||||
|
||||
$poll = new stdClass;
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ class pollModel extends poll
|
|||
$poll_srl = Context::get('poll_srl');
|
||||
$poll_item = Context::get('poll_item');
|
||||
|
||||
if(!$poll_srl || $poll_srl=='') return new BaseObject(-1,"poll_no_poll_srl");
|
||||
if(!$poll_srl || $poll_srl=='') return $this->setError("poll_no_poll_srl");
|
||||
|
||||
$args->poll_srl = $poll_srl;
|
||||
$args->poll_item_srl = $poll_item;
|
||||
|
|
@ -104,7 +104,7 @@ class pollModel extends poll
|
|||
// Get the information related to the survey
|
||||
$columnList = array('poll_type');
|
||||
$output = executeQuery('poll.getPoll', $args, $columnList);
|
||||
if(!$output->data) return new BaseObject(-1,"poll_no_poll_or_deleted_poll");
|
||||
if(!$output->data) return $this->setError("poll_no_poll_or_deleted_poll");
|
||||
$type = $output->data->poll_type;
|
||||
|
||||
$poll = new stdClass();
|
||||
|
|
@ -176,7 +176,7 @@ class pollModel extends poll
|
|||
public function getPollstatus()
|
||||
{
|
||||
$poll_srl = Context::get('poll_srl');
|
||||
if(!$poll_srl || $poll_srl=='') return new BaseObject(-1,"poll_no_poll_srl");
|
||||
if(!$poll_srl || $poll_srl=='') return $this->setError("poll_no_poll_srl");
|
||||
|
||||
if($this->isPolled($poll_srl)) $is_polled = 1;
|
||||
else $is_polled = 0;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class rssAdminController extends rss
|
|||
|
||||
if(isset($msg['error']))
|
||||
{
|
||||
return new BaseObject(-1, $msg['error']);
|
||||
return $this->setError($msg['error']);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -98,7 +98,7 @@ class rssAdminController extends rss
|
|||
|
||||
if(!count($target_module_srls))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
foreach($target_module_srls as $module_srl)
|
||||
|
|
@ -144,7 +144,7 @@ class rssAdminController extends rss
|
|||
$config = getModel('rss')->getConfig();
|
||||
if(!$config->image)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
FileHandler::removeFile($config->image);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ class rss extends ModuleObject
|
|||
function moduleInstall()
|
||||
{
|
||||
$this->moduleUpdate();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -105,12 +104,11 @@ class rss extends ModuleObject
|
|||
$oModuleController->deleteTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
/* End of file rss.class.php */
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class rssController extends rss
|
|||
{
|
||||
if(!$current_module_srl = Context::get('current_module_info')->module_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$oRssModel = getModel('rss');
|
||||
|
|
@ -36,8 +36,6 @@ class rssController extends rss
|
|||
Context::set('rss_url', $oRssModel->getRssURL('rss', Context::get('mid')));
|
||||
Context::set('atom_url', $oRssModel->getRssURL('atom', Context::get('mid')));
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class rssView extends rss
|
|||
{
|
||||
if(!$current_module_srl = Context::get('current_module_info')->module_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -210,8 +210,6 @@ class rssView extends rss
|
|||
|
||||
// Add output after compile template
|
||||
$output .= TemplateHandler::getInstance()->compile($this->module_path . 'tpl', 'rss_module_config');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
}
|
||||
/* End of file rss.view.php */
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ class session extends ModuleObject
|
|||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ class spamfilterAdminController extends spamfilter
|
|||
|
||||
if (mb_strlen($word, 'UTF-8') < 2 || mb_strlen($word, 'UTF-8') > 40)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_word');
|
||||
return $this->setError('msg_invalid_word');
|
||||
}
|
||||
|
||||
$args = new stdClass;
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@ class spamfilter extends ModuleObject
|
|||
$oModuleController->insertTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before');
|
||||
// 2013-11-14 The trigger which try to perform spam filtering when new message are registered
|
||||
$oModuleController->insertTrigger('communication.sendMessage', 'spamfilter', 'controller', 'triggerSendMessage', 'before');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -104,8 +102,6 @@ class spamfilter extends ModuleObject
|
|||
{
|
||||
$oDB->addColumn('spamfilter_denied_ip','description','varchar', 250);
|
||||
}
|
||||
|
||||
return new BaseObject(0,'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class spamfilterController extends spamfilter
|
|||
*/
|
||||
function triggerInsertDocument(&$obj)
|
||||
{
|
||||
if($_SESSION['avoid_log']) return new BaseObject();
|
||||
if($_SESSION['avoid_log']) return;
|
||||
// Check the login status, login information, and permission
|
||||
$is_logged = Context::get('is_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -35,8 +35,8 @@ class spamfilterController extends spamfilter
|
|||
// In case logged in, check if it is an administrator
|
||||
if($is_logged)
|
||||
{
|
||||
if($logged_info->is_admin == 'Y') return new BaseObject();
|
||||
if($grant->manager) return new BaseObject();
|
||||
if($logged_info->is_admin == 'Y') return;
|
||||
if($grant->manager) return;
|
||||
}
|
||||
|
||||
$oFilterModel = getModel('spamfilter');
|
||||
|
|
@ -67,8 +67,6 @@ class spamfilterController extends spamfilter
|
|||
}
|
||||
// Save a log
|
||||
$this->insertLog();
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -76,7 +74,7 @@ class spamfilterController extends spamfilter
|
|||
*/
|
||||
function triggerInsertComment(&$obj)
|
||||
{
|
||||
if($_SESSION['avoid_log']) return new BaseObject();
|
||||
if($_SESSION['avoid_log']) return;
|
||||
// Check the login status, login information, and permission
|
||||
$is_logged = Context::get('is_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -84,8 +82,8 @@ class spamfilterController extends spamfilter
|
|||
// In case logged in, check if it is an administrator
|
||||
if($is_logged)
|
||||
{
|
||||
if($logged_info->is_admin == 'Y') return new BaseObject();
|
||||
if($grant->manager) return new BaseObject();
|
||||
if($logged_info->is_admin == 'Y') return;
|
||||
if($grant->manager) return;
|
||||
}
|
||||
|
||||
$oFilterModel = getModel('spamfilter');
|
||||
|
|
@ -113,8 +111,6 @@ class spamfilterController extends spamfilter
|
|||
unset($obj->__isupdate);
|
||||
// Save a log
|
||||
$this->insertLog();
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -122,7 +118,7 @@ class spamfilterController extends spamfilter
|
|||
*/
|
||||
function triggerInsertTrackback(&$obj)
|
||||
{
|
||||
if($_SESSION['avoid_log']) return new BaseObject();
|
||||
if($_SESSION['avoid_log']) return;
|
||||
|
||||
$oFilterModel = getModel('spamfilter');
|
||||
// Confirm if the trackbacks have been added more than once to your document
|
||||
|
|
@ -150,8 +146,6 @@ class spamfilterController extends spamfilter
|
|||
return new BaseObject(-1, 'msg_alert_trackback_denied');
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -211,10 +205,10 @@ class spamfilterController extends spamfilter
|
|||
*/
|
||||
function triggerSendMessage(&$obj)
|
||||
{
|
||||
if($_SESSION['avoid_log']) return new BaseObject();
|
||||
if($_SESSION['avoid_log']) return;
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y') return new BaseObject();
|
||||
if($logged_info->is_admin == 'Y') return;
|
||||
|
||||
$oFilterModel = getModel('spamfilter');
|
||||
// Check if the IP is prohibited
|
||||
|
|
@ -229,8 +223,6 @@ class spamfilterController extends spamfilter
|
|||
if(!$output->toBool()) return $output;
|
||||
// Save a log
|
||||
$this->insertLog();
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ class tag extends ModuleObject
|
|||
$oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after');
|
||||
// 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -78,8 +76,6 @@ class tag extends ModuleObject
|
|||
// tag in the index column of the table tag
|
||||
if(!$oDB->isIndexExists("tags","idx_tag"))
|
||||
$oDB->addIndex("tags","idx_tag", array("document_srl","tag"));
|
||||
|
||||
return new BaseObject(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class tagController extends tag
|
|||
*/
|
||||
function triggerArrangeTag(&$obj)
|
||||
{
|
||||
if(!$obj->tags) return new BaseObject();
|
||||
if(!$obj->tags) return;
|
||||
// tags by variable
|
||||
$arranged_tag_list = array();
|
||||
$tag_list = explode(',', $obj->tags);
|
||||
|
|
@ -39,7 +39,6 @@ class tagController extends tag
|
|||
{
|
||||
$obj->tags = implode(',', $arranged_tag_list);
|
||||
}
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -51,7 +50,7 @@ class tagController extends tag
|
|||
$module_srl = $obj->module_srl;
|
||||
$document_srl = $obj->document_srl;
|
||||
$tags = $obj->tags;
|
||||
if(!$document_srl) return new BaseObject();
|
||||
if(!$document_srl) return;
|
||||
// Remove all tags that article
|
||||
$output = $this->triggerDeleteTag($obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -68,8 +67,6 @@ class tagController extends tag
|
|||
$output = executeQuery('tag.insertTag', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -79,7 +76,7 @@ class tagController extends tag
|
|||
function triggerDeleteTag(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new BaseObject();
|
||||
if(!$document_srl) return;
|
||||
|
||||
$args = new stdClass();
|
||||
$args->document_srl = $document_srl;
|
||||
|
|
@ -92,7 +89,7 @@ class tagController extends tag
|
|||
function triggerDeleteModuleTags(&$obj)
|
||||
{
|
||||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl) return new BaseObject();
|
||||
if(!$module_srl) return;
|
||||
|
||||
$oTagController = getAdminController('tag');
|
||||
return $oTagController->deleteModuleTags($module_srl);
|
||||
|
|
|
|||
|
|
@ -59,9 +59,9 @@ class trashAdminController extends trash
|
|||
|
||||
//module relation data delete...
|
||||
$output = $this->_relationDataDelete($isAll, $is_type, $trashSrls);
|
||||
if(!$output->toBool()) return new BaseObject(-1, $output->message);
|
||||
if(!$output->toBool()) return $this->setError($output->message);
|
||||
|
||||
if(!$this->_emptyTrash($trashSrls)) return new BaseObject(-1, $lang->fail_empty);
|
||||
if(!$this->_emptyTrash($trashSrls)) return $this->setError($lang->fail_empty);
|
||||
|
||||
$this->setMessage('success_deleted', 'info');
|
||||
|
||||
|
|
@ -84,10 +84,9 @@ class trashAdminController extends trash
|
|||
$args = new stdClass();
|
||||
$args->originModule = $is_type;
|
||||
$output = $oTrashModel->getTrashAllList($args);
|
||||
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return new BaseObject(-1, $output->message);
|
||||
return $output;
|
||||
}
|
||||
|
||||
if(is_array($output->data))
|
||||
|
|
@ -105,7 +104,7 @@ class trashAdminController extends trash
|
|||
$output = $oTrashModel->getTrashList($args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return new BaseObject(-1, $output->message);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -115,20 +114,21 @@ class trashAdminController extends trash
|
|||
{
|
||||
//class file check
|
||||
$classPath = ModuleHandler::getModulePath($oTrashVO->getOriginModule());
|
||||
if(!is_dir(FileHandler::getRealPath($classPath))) return new BaseObject(-1, 'not exist restore module directory');
|
||||
if(!is_dir(FileHandler::getRealPath($classPath))) return $this->setError('not exist restore module directory');
|
||||
|
||||
$classFile = sprintf('%s%s.admin.controller.php', $classPath, $oTrashVO->getOriginModule());
|
||||
$classFile = FileHandler::getRealPath($classFile);
|
||||
if(!file_exists($classFile)) return new BaseObject(-1, 'not exist restore module class file');
|
||||
if(!file_exists($classFile)) return $this->setError('not exist restore module class file');
|
||||
|
||||
$oAdminController = getAdminController($oTrashVO->getOriginModule());
|
||||
if(!method_exists($oAdminController, 'emptyTrash')) return new BaseObject(-1, 'not exist restore method in module class file');
|
||||
if(!method_exists($oAdminController, 'emptyTrash')) return $this->setError('not exist restore method in module class file');
|
||||
|
||||
$output2 = $oAdminController->emptyTrash($oTrashVO->getSerializedObject());
|
||||
if(!$output2->toBool()) return new BaseObject(-1, $output2->message);
|
||||
if(!$output2->toBool()) return $output;
|
||||
}
|
||||
}
|
||||
return new BaseObject(0, lang('success_deleted'));
|
||||
|
||||
return new BaseObject(0, 'success_deleted');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -150,18 +150,18 @@ class trashAdminController extends trash
|
|||
{
|
||||
$oTrashModel = getModel('trash');
|
||||
$output = $oTrashModel->getTrash($value);
|
||||
if(!$output->toBool()) return new BaseObject(-1, $output->message);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
//class file check
|
||||
$classPath = ModuleHandler::getModulePath($output->data->getOriginModule());
|
||||
if(!is_dir(FileHandler::getRealPath($classPath))) return new BaseObject(-1, 'not exist restore module directory');
|
||||
if(!is_dir(FileHandler::getRealPath($classPath))) return $this->setError('not exist restore module directory');
|
||||
|
||||
$classFile = sprintf('%s%s.admin.controller.php', $classPath, $output->data->getOriginModule());
|
||||
$classFile = FileHandler::getRealPath($classFile);
|
||||
if(!file_exists($classFile)) return new BaseObject(-1, 'not exist restore module class file');
|
||||
if(!file_exists($classFile)) return $this->setError('not exist restore module class file');
|
||||
|
||||
$oAdminController = getAdminController($output->data->getOriginModule());
|
||||
if(!method_exists($oAdminController, 'restoreTrash')) return new BaseObject(-1, 'not exist restore method in module class file');
|
||||
if(!method_exists($oAdminController, 'restoreTrash')) return $this->setError('not exist restore method in module class file');
|
||||
|
||||
$originObject = unserialize($output->data->getSerializedObject());
|
||||
$output = $oAdminController->restoreTrash($originObject);
|
||||
|
|
@ -169,14 +169,14 @@ class trashAdminController extends trash
|
|||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return new BaseObject(-1, $output->message);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
// restore object delete in trash box
|
||||
if(!$this->_emptyTrash($trashSrlList)) {
|
||||
$oDB->rollback();
|
||||
return new BaseObject(-1, $lang->fail_empty);
|
||||
return $this->setError($lang->fail_empty);
|
||||
}
|
||||
$oDB->commit();
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ class trashAdminController extends trash
|
|||
*/
|
||||
function procTrashAdminGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$trashSrls = Context::get('trash_srls');
|
||||
if($trashSrls) $trashSrlList = explode(',', $trashSrls);
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class trashAdminView extends trash
|
|||
|
||||
$oTrashModel = getModel('trash');
|
||||
$output = $oTrashModel->getTrash($trash_srl);
|
||||
if(!$output->data->getTrashSrl()) return new BaseObject(-1, 'msg_invalid_request');
|
||||
if(!$output->data->getTrashSrl()) return $this->setError('msg_invalid_request');
|
||||
|
||||
$originObject = unserialize($output->data->getSerializedObject());
|
||||
if(is_array($originObject)) $originObject = (object)$originObject;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue