mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
Merge branch 'develop' of github.com:rhymix/rhymix into develop
This commit is contained in:
commit
ba94631921
292 changed files with 6254 additions and 6380 deletions
|
|
@ -143,7 +143,7 @@ class addonAdminController extends addonController
|
|||
$this->makeCacheFile($site_srl, 'mobile', 'site');
|
||||
Rhymix\Framework\Cache::clearGroup('addonConfig');
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_updated', 'info');
|
||||
if(Context::get('success_return_url'))
|
||||
{
|
||||
|
|
@ -245,7 +245,7 @@ class addonAdminController extends addonController
|
|||
{
|
||||
$args->is_used = $isUsed === 'Y' ? 'Y' : 'N';
|
||||
}
|
||||
|
||||
|
||||
if($gtype == 'global')
|
||||
{
|
||||
$output = executeQuery('addon.insertAddon', $args);
|
||||
|
|
@ -256,7 +256,7 @@ class addonAdminController extends addonController
|
|||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.insertSiteAddon', $args);
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any'));
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc'));
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile'));
|
||||
|
|
@ -293,7 +293,7 @@ class addonAdminController extends addonController
|
|||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any'));
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc'));
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile'));
|
||||
|
|
@ -329,7 +329,7 @@ class addonAdminController extends addonController
|
|||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any'));
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc'));
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile'));
|
||||
|
|
@ -338,4 +338,4 @@ class addonAdminController extends addonController
|
|||
|
||||
}
|
||||
/* End of file addon.admin.controller.php */
|
||||
/* Location: ./modules/addon/addon.admin.controller.php */
|
||||
/* Location: ./modules/addon/addon.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class addonAdminModel extends addon
|
|||
{
|
||||
// check blacklist
|
||||
$addonList[$key]->isBlacklisted = Context::isBlacklistedPlugin($addon->addon, 'addon');
|
||||
|
||||
|
||||
// get easyinstall remove url
|
||||
$packageSrl = $oAutoinstallModel->getPackageSrlByPath($addon->path);
|
||||
$addonList[$key]->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl);
|
||||
|
|
@ -109,7 +109,7 @@ class addonAdminModel extends addon
|
|||
$path = $this->getAddonPath($addon_name);
|
||||
// Wanted information on the add-on
|
||||
$info = $this->getAddonInfoXml($addon_name, $site_srl, $gtype);
|
||||
|
||||
|
||||
if(!$info) $info = new stdClass();
|
||||
|
||||
$info->addon = $addon_name;
|
||||
|
|
@ -331,16 +331,16 @@ class addonAdminModel extends addon
|
|||
$addon_info->title = $xml_obj->title->body;
|
||||
$addon_info->description = trim($xml_obj->author->description->body);
|
||||
$addon_info->version = $xml_obj->attrs->version;
|
||||
|
||||
|
||||
$date_obj = new stdClass();
|
||||
sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
|
||||
|
||||
$author_obj = new stdClass();
|
||||
$author_obj->name = $xml_obj->author->name->body;
|
||||
$author_obj->email_address = $xml_obj->author->attrs->email_address;
|
||||
$author_obj->homepage = $xml_obj->author->attrs->link;
|
||||
|
||||
|
||||
$addon_info->author = array();
|
||||
$addon_info->author[] = $author_obj;
|
||||
|
||||
|
|
@ -462,7 +462,7 @@ class addonAdminModel extends addon
|
|||
);
|
||||
$always_return_false_for_compatibility = array(
|
||||
);
|
||||
|
||||
|
||||
if(isset($always_return_true_for_compatibility[$addon]))
|
||||
{
|
||||
return true;
|
||||
|
|
@ -471,7 +471,7 @@ class addonAdminModel extends addon
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->addon = $addon;
|
||||
if($gtype == 'global')
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
class addonController extends addon
|
||||
{
|
||||
public $addon_file_called = false;
|
||||
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
|
|
@ -78,41 +78,41 @@ class addonController extends addon
|
|||
foreach($addon_list as $addon => $val)
|
||||
{
|
||||
if(Context::isBlacklistedPlugin($addon, 'addon')
|
||||
|| ($type == "pc" && $val->is_used != 'Y')
|
||||
|| ($type == "mobile" && $val->is_used_m != 'Y')
|
||||
|| ($type == "pc" && $val->is_used != 'Y')
|
||||
|| ($type == "mobile" && $val->is_used_m != 'Y')
|
||||
|| ($gtype == 'global' && $val->is_fixed != 'Y')
|
||||
|| !is_dir(RX_BASEDIR . 'addons/' . $addon))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$extra_vars = unserialize($val->extra_vars);
|
||||
if(!$extra_vars)
|
||||
{
|
||||
$extra_vars = new stdClass;
|
||||
}
|
||||
|
||||
|
||||
$mid_list = $extra_vars->mid_list ?? [];
|
||||
if(!is_array($mid_list))
|
||||
{
|
||||
$mid_list = array();
|
||||
}
|
||||
|
||||
|
||||
// Initialize
|
||||
$buff[] = '$before_time = microtime(true);';
|
||||
|
||||
|
||||
// Run method and mid list
|
||||
$run_method = ($extra_vars->xe_run_method ?? null) ?: 'run_selected';
|
||||
$buff[] = '$rm = \'' . $run_method . "';";
|
||||
$buff[] = '$ml = ' . var_export(array_fill_keys($mid_list, true), true) . ';';
|
||||
$buff[] = '$_m = Context::get(\'mid\');';
|
||||
|
||||
|
||||
// Addon filename
|
||||
$buff[] = sprintf('$addon_file = RX_BASEDIR . \'addons/%s/%s.addon.php\';', $addon, $addon);
|
||||
|
||||
|
||||
// Addon configuration
|
||||
$buff[] = '$addon_info = unserialize(' . var_export(serialize($extra_vars), true) . ');';
|
||||
|
||||
|
||||
// Decide whether to run in this mid
|
||||
if ($run_method === 'no_run_selected')
|
||||
{
|
||||
|
|
@ -126,7 +126,7 @@ class addonController extends addon
|
|||
{
|
||||
$buff[] = '$run = isset($ml[$_m]);';
|
||||
}
|
||||
|
||||
|
||||
// Write debug info
|
||||
$buff[] = 'if ($run && file_exists($addon_file)):';
|
||||
$buff[] = ' include($addon_file);';
|
||||
|
|
@ -142,7 +142,7 @@ class addonController extends addon
|
|||
$buff[] = 'endif;';
|
||||
$buff[] = '';
|
||||
}
|
||||
|
||||
|
||||
// Write file in new location
|
||||
$addon_file = RX_BASEDIR . 'files/cache/addons/' . $type . '.php';
|
||||
FileHandler::writeFile($addon_file, join(PHP_EOL, $buff));
|
||||
|
|
@ -176,7 +176,7 @@ class addonController extends addon
|
|||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'any'));
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'pc'));
|
||||
Rhymix\Framework\Cache::delete(sprintf('addonConfig:%s:%s', $addon, 'mobile'));
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class AddonModel extends Addon
|
|||
{
|
||||
/**
|
||||
* Get configuration for addon
|
||||
*
|
||||
*
|
||||
* @param string $addon_name
|
||||
* @param string $type
|
||||
* @return object|null
|
||||
|
|
@ -15,14 +15,14 @@ class AddonModel extends Addon
|
|||
{
|
||||
$type = 'any';
|
||||
}
|
||||
|
||||
|
||||
$cache_key = sprintf('addonConfig:%s:%s', $addon_name, $type);
|
||||
$config = Rhymix\Framework\Cache::get($cache_key);
|
||||
if ($config !== null)
|
||||
{
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->addon = $addon_name;
|
||||
$args->site_srl = 0;
|
||||
|
|
@ -31,7 +31,7 @@ class AddonModel extends Addon
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$result = array_first($output->data);
|
||||
if ($type === 'pc' && $result->is_used !== 'Y')
|
||||
{
|
||||
|
|
@ -45,7 +45,7 @@ class AddonModel extends Addon
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$config = unserialize($result->extra_vars);
|
||||
unset($config->xe_validator_id);
|
||||
if (!isset($config->mid_list))
|
||||
|
|
@ -54,7 +54,7 @@ class AddonModel extends Addon
|
|||
}
|
||||
$config->use_pc = $result->is_used;
|
||||
$config->use_mobile = $result->is_used_m;
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::set($cache_key, $config, 0, true);
|
||||
return $config;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* Preserved for backward compatibility
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
class AdminAdminController extends Admin
|
||||
|
|
@ -20,7 +20,7 @@ class AdminAdminController extends Admin
|
|||
|
||||
/**
|
||||
* Remove an icon.
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function procAdminRemoveIcons()
|
||||
|
|
@ -39,7 +39,7 @@ class AdminAdminController extends Admin
|
|||
|
||||
/**
|
||||
* Delete the admin logo.
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function procAdminDeleteLogo()
|
||||
|
|
@ -82,7 +82,7 @@ class AdminAdminController extends Admin
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
|
||||
}
|
||||
|
||||
|
||||
public function procAdminRemoveFTPInfo()
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* Preserved for backward compatibility
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
class AdminAdminModel extends Admin
|
||||
|
|
@ -200,6 +200,6 @@ class AdminAdminModel extends Admin
|
|||
|
||||
public static function getThemeInfo($theme_name, $layout_list = [])
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,24 +2,24 @@
|
|||
|
||||
/**
|
||||
* Preserved for backward compatibility
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
class AdminAdminView extends Admin
|
||||
{
|
||||
/**
|
||||
* Make the admin menu.
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function makeGnbUrl($module = 'admin')
|
||||
{
|
||||
Rhymix\Modules\Admin\Controllers\Base::getInstance()->loadAdminMenu($module);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display FTP Configuration(settings) page
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function dispAdminConfigFtp()
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class AdminMenu extends Base
|
|||
|
||||
Context::set('menu_srl', $output->menu_srl);
|
||||
Context::set('menu_title', $output->title);
|
||||
|
||||
|
||||
$this->setTemplateFile('admin_setup');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class Base extends \ModuleObject
|
|||
{
|
||||
/**
|
||||
* Initilization
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init()
|
||||
|
|
@ -39,16 +39,16 @@ class Base extends \ModuleObject
|
|||
// Load the admin menu.
|
||||
$this->loadAdminMenu();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check system configuration.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function checkSystemConfiguration()
|
||||
{
|
||||
$changed = false;
|
||||
|
||||
|
||||
// Check encryption keys.
|
||||
if (config('crypto.encryption_key') === null)
|
||||
{
|
||||
|
|
@ -70,17 +70,17 @@ class Base extends \ModuleObject
|
|||
config('file.folder_structure', 1);
|
||||
$changed = true;
|
||||
}
|
||||
|
||||
|
||||
// Save new configuration.
|
||||
if ($changed)
|
||||
{
|
||||
Config::save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load the admin menu.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function loadAdminMenu($module = 'admin')
|
||||
|
|
@ -113,7 +113,7 @@ class Base extends \ModuleObject
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// get current menu's srl(=parentSrl)
|
||||
$parentSrl = 0;
|
||||
foreach ((array)$menu->list as $parentKey => $parentMenu)
|
||||
|
|
@ -140,27 +140,27 @@ class Base extends \ModuleObject
|
|||
// Get list of favorite
|
||||
$output = FavoriteModel::getFavorites(true);
|
||||
Context::set('favorite_list', $output->get('favoriteList'));
|
||||
|
||||
|
||||
Context::set('subMenuTitle', $subMenuTitle);
|
||||
Context::set('gnbUrlList', $menu->list);
|
||||
Context::set('parentSrl', $parentSrl);
|
||||
Context::set('gnb_title_info', $gnbTitleInfo ?? null);
|
||||
Context::addBrowserTitle($subMenuTitle ? $subMenuTitle : 'Dashboard');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Alias for backward compatibility.
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public static function getAdminMenuName()
|
||||
{
|
||||
return AdminMenuModel::getAdminMenuName();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Alias for backward compatibility.
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public static function getAdminMenuLang()
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class Dashboard extends Base
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Retrieve the list of installed modules
|
||||
$this->checkEasyInstall();
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ class Dashboard extends Base
|
|||
//$oAutoinstallAdminModel = getAdminModel('autoinstall');
|
||||
//$needUpdateList = $oAutoinstallAdminModel->getNeedUpdateList();
|
||||
$needUpdateList = array();
|
||||
|
||||
|
||||
// Check counter addon
|
||||
$oAddonAdminModel = AddonAdminModel::getInstance();
|
||||
$counterAddonActivated = $oAddonAdminModel->isActivatedAddon('counter');
|
||||
|
|
@ -131,7 +131,7 @@ class Dashboard extends Base
|
|||
Context::set('latestMemberList', $output->data);
|
||||
unset($args, $output, $columnList);
|
||||
}
|
||||
|
||||
|
||||
// Check unnecessary files
|
||||
$cleanup_list = Maintenance\Cleanup::getInstance()->checkFiles();
|
||||
|
||||
|
|
@ -159,10 +159,10 @@ class Dashboard extends Base
|
|||
MemberController::getInstance()->procMemberLogout();
|
||||
header('Location: ' . getNotEncodedUrl(''));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check easy install.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function checkEasyInstall()
|
||||
|
|
@ -202,7 +202,7 @@ class Dashboard extends Base
|
|||
|
||||
/**
|
||||
* Update the easy install flag file.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _updateEasyInstallFlagFile()
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ class Design extends Base
|
|||
|
||||
/**
|
||||
* Subroutine for the above.
|
||||
*
|
||||
*
|
||||
* @param object $vars
|
||||
* @return void
|
||||
*/
|
||||
public function updateDefaultDesignInfo(object $vars): void
|
||||
{
|
||||
$vars->module_skin = json_decode($vars->module_skin);
|
||||
|
||||
|
||||
$siteDesignPath = \RX_BASEDIR . 'files/site_design/';
|
||||
if (!is_dir($siteDesignPath))
|
||||
{
|
||||
|
|
@ -77,7 +77,7 @@ class Design extends Base
|
|||
|
||||
/**
|
||||
* Subroutine for the above;
|
||||
*
|
||||
*
|
||||
* @param object $designInfo
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,17 +9,17 @@ class Install extends Base
|
|||
{
|
||||
/**
|
||||
* Install module
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function moduleInstall()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if update is necessary
|
||||
*
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkUpdate()
|
||||
|
|
@ -35,7 +35,7 @@ class Install extends Base
|
|||
|
||||
/**
|
||||
* Update module
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function moduleUpdate()
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class ServerEnv extends Base
|
|||
'widget' => array('content', 'counter_status', 'language_select', 'login_info', 'mcontent', 'pollWidget'),
|
||||
'widgetstyle' => array('simple'),
|
||||
);
|
||||
|
||||
|
||||
// Basic environment
|
||||
$info[] = '[Basic Information]';
|
||||
$info['rhymix_version'] = RX_VERSION;
|
||||
|
|
@ -48,7 +48,7 @@ class ServerEnv extends Base
|
|||
}
|
||||
$info['ssl'] = Context::get('site_module_info')->security ?: Context::getDbInfo()->use_ssl;
|
||||
$info[] = '';
|
||||
|
||||
|
||||
// System settings
|
||||
$info[] = '[System Settings]';
|
||||
$info['db.type'] = preg_replace('/^mysql.+/', 'mysql', config('db.master.type'));
|
||||
|
|
@ -82,7 +82,7 @@ class ServerEnv extends Base
|
|||
$info['view.minify_scripts'] = config('view.minify_scripts');
|
||||
$info['use_sso'] = config('use_sso') ? 'true' : 'false';
|
||||
$info[] = '';
|
||||
|
||||
|
||||
// PHP settings
|
||||
$ini_info = ini_get_all();
|
||||
$info[] = '[PHP Settings]';
|
||||
|
|
@ -104,7 +104,7 @@ class ServerEnv extends Base
|
|||
}
|
||||
natcasesort($info['extensions']);
|
||||
$info[] = '';
|
||||
|
||||
|
||||
// Modules
|
||||
$info[] = '[Modules]';
|
||||
$info['module'] = array();
|
||||
|
|
@ -126,7 +126,7 @@ class ServerEnv extends Base
|
|||
}
|
||||
natcasesort($info['module']);
|
||||
$info[] = '';
|
||||
|
||||
|
||||
// Addons
|
||||
$info[] = '[Addons]';
|
||||
$info['addon'] = array();
|
||||
|
|
@ -149,7 +149,7 @@ class ServerEnv extends Base
|
|||
}
|
||||
natcasesort($info['addon']);
|
||||
$info[] = '';
|
||||
|
||||
|
||||
// Layouts
|
||||
$info[] = '[Layouts]';
|
||||
$info['layout'] = array();
|
||||
|
|
@ -172,7 +172,7 @@ class ServerEnv extends Base
|
|||
}
|
||||
natcasesort($info['layout']);
|
||||
$info[] = '';
|
||||
|
||||
|
||||
// Widgets
|
||||
$info[] = '[Widgets]';
|
||||
$info['widget'] = array();
|
||||
|
|
@ -195,7 +195,7 @@ class ServerEnv extends Base
|
|||
}
|
||||
natcasesort($info['widget']);
|
||||
$info[] = '';
|
||||
|
||||
|
||||
// Widgetstyles
|
||||
$info[] = '[Widgetstyles]';
|
||||
$info['widgetstyle'] = array();
|
||||
|
|
@ -219,7 +219,7 @@ class ServerEnv extends Base
|
|||
natcasesort($info['widgetstyle']);
|
||||
$info[] = '';
|
||||
$str_info = '';
|
||||
|
||||
|
||||
// Convert to string.
|
||||
foreach ($info as $key => $value)
|
||||
{
|
||||
|
|
@ -227,7 +227,7 @@ class ServerEnv extends Base
|
|||
{
|
||||
$value = implode(', ', $value) ?: "no additional {$key}s";
|
||||
}
|
||||
|
||||
|
||||
if (is_int($key) || ctype_digit($key))
|
||||
{
|
||||
$str_info .= "$value\n";
|
||||
|
|
@ -241,7 +241,7 @@ class ServerEnv extends Base
|
|||
Context::set('str_info', $str_info);
|
||||
$this->setTemplateFile('server_env.html');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to test if URL rewriting is properly configured in the web server.
|
||||
*/
|
||||
|
|
@ -251,7 +251,7 @@ class ServerEnv extends Base
|
|||
Context::setResponseMethod('JSON');
|
||||
$this->add('result', $test * 42);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear APCU cache.
|
||||
*/
|
||||
|
|
@ -266,7 +266,7 @@ class ServerEnv extends Base
|
|||
return new BaseObject(-1, 'apcu_clear_cache_function_not_found');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear opcache.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class CacheReset extends Base
|
|||
$tmp_cache_list = FileHandler::readDir(\RX_BASEDIR . 'files', '/^(cache_[0-9]+)/');
|
||||
$tmp_cache_prefix = \RX_BASEDIR . 'files/';
|
||||
}
|
||||
|
||||
|
||||
if($tmp_cache_list)
|
||||
{
|
||||
foreach($tmp_cache_list as $tmp_dir)
|
||||
|
|
@ -91,7 +91,7 @@ class CacheReset extends Base
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// If possible, use system command to speed up recursive deletion
|
||||
if (function_exists('exec') && !preg_match('/(?<!_)exec/', ini_get('disable_functions')))
|
||||
{
|
||||
|
|
@ -104,7 +104,7 @@ class CacheReset extends Base
|
|||
@exec('rm -rf ' . escapeshellarg($tmp_dir));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If the directory still exists, delete using PHP.
|
||||
Storage::deleteDirectory($tmp_dir);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ class Cleanup extends Base
|
|||
// Get the list of files to clean up.
|
||||
$cleanup_list = $this->checkFiles();
|
||||
Context::set('cleanup_list', $cleanup_list);
|
||||
|
||||
|
||||
// Check previous errors.
|
||||
Context::set('cleanup_errors', $_SESSION['admin_cleanup_errors'] ?? []);
|
||||
unset($_SESSION['admin_cleanup_errors']);
|
||||
|
||||
|
||||
// Set the template file.
|
||||
$this->setTemplateFile('cleanup');
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ class Cleanup extends Base
|
|||
{
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
|
||||
// If there were errors, set information in session.
|
||||
else
|
||||
{
|
||||
|
|
@ -47,14 +47,14 @@ class Cleanup extends Base
|
|||
$this->setMessage('msg_cleanup_manually');
|
||||
$_SESSION['admin_cleanup_errors'] = $result;
|
||||
}
|
||||
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminCleanupList'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for files to clean up.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function checkFiles(): array
|
||||
|
|
@ -71,7 +71,7 @@ class Cleanup extends Base
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Check for case difference and moved target.
|
||||
if ($reason === 'case')
|
||||
{
|
||||
|
|
@ -92,17 +92,17 @@ class Cleanup extends Base
|
|||
$result[$name] = $reason;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ksort($result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the filesystem is case-sensitive.
|
||||
*
|
||||
*
|
||||
* This method generally returns true on Linux, and false on Windows and Mac OS,
|
||||
* but the result may differ if tested on an unusual filesystem.
|
||||
*
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkCaseSensitiveFilesystem(): bool
|
||||
|
|
@ -113,7 +113,7 @@ class Cleanup extends Base
|
|||
{
|
||||
return $cache;
|
||||
}
|
||||
|
||||
|
||||
// Return default values for most common operating systems.
|
||||
if (preg_match('/Linux/', \PHP_OS))
|
||||
{
|
||||
|
|
@ -123,29 +123,29 @@ class Cleanup extends Base
|
|||
{
|
||||
return $cache = false;
|
||||
}
|
||||
|
||||
|
||||
// Create two files that differ only in case, and check if they overwrite each other.
|
||||
$file1 = \RX_BASEDIR . 'files/cache/caseTest.php';
|
||||
$file2 = \RX_BASEDIR . 'files/cache/caseTEST.php';
|
||||
Storage::write($file1, '#1:' . Security::getRandom(36) . \PHP_EOL);
|
||||
Storage::write($file2, '#2:' . Security::getRandom(36) . \PHP_EOL);
|
||||
$cache = (Storage::read($file1) !== Storage::read($file2));
|
||||
|
||||
|
||||
// Clean up test files and return the result.
|
||||
Storage::delete($file1);
|
||||
Storage::delete($file2);
|
||||
return $cache;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete files.
|
||||
*
|
||||
*
|
||||
* If a name is given, only that file or directory will be deleted.
|
||||
* Otherwise, all files in the cleanup list will be deleted.
|
||||
*
|
||||
*
|
||||
* This method returns the list of files that could not be deleted,
|
||||
* with reasons for each file.
|
||||
*
|
||||
*
|
||||
* @param ?string $name
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -168,12 +168,12 @@ class Cleanup extends Base
|
|||
{
|
||||
$list = $this->checkFiles();
|
||||
}
|
||||
|
||||
|
||||
if (!count($list))
|
||||
{
|
||||
throw new TargetNotFound('msg_cleanup_list_empty');
|
||||
}
|
||||
|
||||
|
||||
// Delete each file or directory.
|
||||
$result = [];
|
||||
foreach ($list as $name => $reason)
|
||||
|
|
@ -187,7 +187,7 @@ class Cleanup extends Base
|
|||
{
|
||||
$success = Storage::delete($normalized_path);
|
||||
}
|
||||
|
||||
|
||||
if (!$success && Storage::exists($normalized_path))
|
||||
{
|
||||
if (!Storage::isWritable($normalized_path) || !Storage::isWritable(dirname($normalized_path)))
|
||||
|
|
@ -204,15 +204,15 @@ class Cleanup extends Base
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* List of files and directories to clean up.
|
||||
*/
|
||||
public const CLEANUP_LIST = [
|
||||
|
||||
|
||||
// Unnecessary files in the root directory
|
||||
'composer.json' => 'moved:common/composer.json',
|
||||
'composer.lock' => 'moved:common/composer.lock',
|
||||
|
|
@ -278,7 +278,7 @@ class Cleanup extends Base
|
|||
'modules/spamfilter/ruleset/' => 'deleted',
|
||||
'phpDoc/' => 'deleted:xe',
|
||||
'tools/' => 'deleted:xe',
|
||||
|
||||
|
||||
// Deleted lang.xml
|
||||
'common/lang/lang.xml' => 'deleted:xmllang',
|
||||
'layouts/xedition/lang/lang.xml' => 'deleted:xmllang',
|
||||
|
|
@ -388,7 +388,7 @@ class Cleanup extends Base
|
|||
'common/framework/parsers/dbtable/index.php' => 'case',
|
||||
'common/framework/parsers/dbtable/table.php' => 'case',
|
||||
'modules/member/controllers/device.php' => 'case',
|
||||
|
||||
|
||||
// Vendor directory
|
||||
'vendor/' => 'moved:common/vendor/',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -41,11 +41,11 @@ class Advanced extends Base
|
|||
$cache_default_ttl = 86400;
|
||||
$cache_servers = Config::get('cache');
|
||||
}
|
||||
|
||||
|
||||
Context::set('object_cache_types', $object_cache_types);
|
||||
Context::set('object_cache_type', $object_cache_type);
|
||||
Context::set('cache_default_ttl', $cache_default_ttl);
|
||||
|
||||
|
||||
if ($cache_servers)
|
||||
{
|
||||
if (preg_match('!^(/.+)(#[0-9]+)?$!', array_first($cache_servers), $matches))
|
||||
|
|
@ -71,7 +71,7 @@ class Advanced extends Base
|
|||
Context::set('object_cache_dbnum', 1);
|
||||
}
|
||||
Context::set('cache_truncate_method', Config::get('cache.truncate_method'));
|
||||
|
||||
|
||||
// Thumbnail settings
|
||||
$oDocumentModel = getModel('document');
|
||||
$config = $oDocumentModel->getDocumentConfig();
|
||||
|
|
@ -83,17 +83,17 @@ class Advanced extends Base
|
|||
Context::set('thumbnail_target', 'none');
|
||||
Context::set('thumbnail_type', 'fill');
|
||||
}
|
||||
|
||||
|
||||
// Default and enabled languages
|
||||
Context::set('supported_lang', Lang::getSupportedList());
|
||||
Context::set('default_lang', Config::get('locale.default_lang'));
|
||||
Context::set('enabled_lang', Config::get('locale.enabled_lang'));
|
||||
Context::set('auto_select_lang', Config::get('locale.auto_select_lang'));
|
||||
|
||||
|
||||
// Default time zone
|
||||
Context::set('timezones', DateTime::getTimezoneList());
|
||||
Context::set('selected_timezone', Config::get('locale.default_timezone'));
|
||||
|
||||
|
||||
// Other settings
|
||||
Context::set('use_rewrite', Router::getRewriteLevel());
|
||||
Context::set('use_mobile_view', (config('mobile.enabled') !== null ? config('mobile.enabled') : config('use_mobile_view')) ? true : false);
|
||||
|
|
@ -108,17 +108,17 @@ class Advanced extends Base
|
|||
Context::set('jquery_version', Config::get('view.jquery_version'));
|
||||
Context::set('use_server_push', Config::get('view.server_push'));
|
||||
Context::set('use_gzip', Config::get('view.use_gzip'));
|
||||
|
||||
|
||||
$this->setTemplateFile('config_advanced');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update advanced configuration.
|
||||
*/
|
||||
public function procAdminUpdateAdvanced()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
// Object cache
|
||||
if ($vars->object_cache_type)
|
||||
{
|
||||
|
|
@ -144,7 +144,7 @@ class Advanced extends Base
|
|||
}
|
||||
$cache_servers = array($vars->object_cache_type . '://' . $auth . $vars->object_cache_host . ':' . intval($vars->object_cache_port));
|
||||
}
|
||||
|
||||
|
||||
if ($vars->object_cache_type === 'redis')
|
||||
{
|
||||
$cache_servers[0] .= '#' . intval($vars->object_cache_dbnum);
|
||||
|
|
@ -168,13 +168,13 @@ class Advanced extends Base
|
|||
{
|
||||
Config::set('cache', array());
|
||||
}
|
||||
|
||||
|
||||
// Cache truncate method
|
||||
if (in_array($vars->cache_truncate_method, array('delete', 'empty')))
|
||||
{
|
||||
Config::set('cache.truncate_method', $vars->cache_truncate_method);
|
||||
}
|
||||
|
||||
|
||||
// Thumbnail settings
|
||||
$oDocumentModel = getModel('document');
|
||||
$document_config = $oDocumentModel->getDocumentConfig();
|
||||
|
|
@ -183,7 +183,7 @@ class Advanced extends Base
|
|||
$document_config->thumbnail_quality = intval($vars->thumbnail_quality) ?: 75;
|
||||
$oModuleController = getController('module');
|
||||
$oModuleController->insertModuleConfig('document', $document_config);
|
||||
|
||||
|
||||
// Mobile view
|
||||
Config::set('mobile.enabled', $vars->use_mobile_view === 'Y');
|
||||
Config::set('mobile.tablets', $vars->tablets_as_mobile === 'Y');
|
||||
|
|
@ -192,7 +192,7 @@ class Advanced extends Base
|
|||
{
|
||||
Config::set('use_mobile_view', $vars->use_mobile_view === 'Y');
|
||||
}
|
||||
|
||||
|
||||
// Languages and time zone
|
||||
$enabled_lang = $vars->enabled_lang;
|
||||
if (!in_array($vars->default_lang, $enabled_lang ?: []))
|
||||
|
|
@ -203,7 +203,7 @@ class Advanced extends Base
|
|||
Config::set('locale.enabled_lang', array_values($enabled_lang));
|
||||
Config::set('locale.auto_select_lang', $vars->auto_select_lang === 'Y');
|
||||
Config::set('locale.default_timezone', $vars->default_timezone);
|
||||
|
||||
|
||||
// Other settings
|
||||
Config::set('url.rewrite', intval($vars->use_rewrite));
|
||||
Config::set('use_rewrite', $vars->use_rewrite > 0);
|
||||
|
|
@ -215,13 +215,13 @@ class Advanced extends Base
|
|||
Config::set('view.jquery_version', $vars->jquery_version == 3 ? 3 : 2);
|
||||
Config::set('view.server_push', $vars->use_server_push === 'Y');
|
||||
Config::set('view.use_gzip', $vars->use_gzip === 'Y');
|
||||
|
||||
|
||||
// Save
|
||||
if (!Config::save())
|
||||
{
|
||||
throw new Exception('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigAdvanced'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,27 +29,27 @@ class Debug extends Base
|
|||
Context::set('debug_query_comment', Config::get('debug.query_comment'));
|
||||
Context::set('debug_query_full_stack', Config::get('debug.query_full_stack'));
|
||||
Context::set('debug_write_error_log', Config::get('debug.write_error_log'));
|
||||
|
||||
|
||||
// IP access control
|
||||
$allowed_ip = Config::get('debug.allow');
|
||||
Context::set('debug_allowed_ip', implode(PHP_EOL, $allowed_ip));
|
||||
Context::set('remote_addr', RX_CLIENT_IP);
|
||||
|
||||
|
||||
$this->setTemplateFile('config_debug');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update debug configuration.
|
||||
*/
|
||||
public function procAdminUpdateDebug()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
// Save display type settings
|
||||
$display_type = array_values(array_filter($vars->debug_display_type ?: [], function($str) {
|
||||
return in_array($str, ['panel', 'comment', 'file']);
|
||||
}));
|
||||
|
||||
|
||||
// Debug settings
|
||||
Config::set('debug.enabled', $vars->debug_enabled === 'Y');
|
||||
Config::set('debug.log_slow_queries', max(0, floatval($vars->debug_log_slow_queries)));
|
||||
|
|
@ -61,11 +61,11 @@ class Debug extends Base
|
|||
Config::set('debug.query_comment', $vars->debug_query_comment === 'Y');
|
||||
Config::set('debug.query_full_stack', $vars->debug_query_full_stack === 'Y');
|
||||
Config::set('debug.write_error_log', strval($vars->debug_write_error_log) ?: 'fatal');
|
||||
|
||||
|
||||
// Debug content
|
||||
$debug_content = array_values($vars->debug_display_content ?: array());
|
||||
Config::set('debug.display_content', $debug_content);
|
||||
|
||||
|
||||
// Log filename
|
||||
$log_filename = strval($vars->debug_log_filename);
|
||||
$log_filename_today = str_replace(array('YYYY', 'YY', 'MM', 'DD'), array(
|
||||
|
|
@ -87,7 +87,7 @@ class Debug extends Base
|
|||
throw new Exception('msg_debug_log_filename_not_writable');
|
||||
}
|
||||
Config::set('debug.log_filename', $log_filename);
|
||||
|
||||
|
||||
// IP access control
|
||||
$allowed_ip = array_map('trim', preg_split('/[\r\n]/', $vars->debug_allowed_ip));
|
||||
$allowed_ip = array_unique(array_filter($allowed_ip, function($item) {
|
||||
|
|
@ -97,13 +97,13 @@ class Debug extends Base
|
|||
throw new Exception('msg_invalid_ip');
|
||||
}
|
||||
Config::set('debug.allow', array_values($allowed_ip));
|
||||
|
||||
|
||||
// Save
|
||||
if (!Config::save())
|
||||
{
|
||||
throw new Exception('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigDebug'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class Domains extends Base
|
|||
Context::set('domain_list', $domain_list);
|
||||
Context::set('page_navigation', $domain_list->page_navigation);
|
||||
Context::set('page', $page);
|
||||
|
||||
|
||||
// Get index module info.
|
||||
$module_list = array();
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -41,13 +41,13 @@ class Domains extends Base
|
|||
}
|
||||
}
|
||||
Context::set('module_list', $module_list);
|
||||
|
||||
|
||||
// Get language list.
|
||||
Context::set('supported_lang', Lang::getSupportedList());
|
||||
|
||||
|
||||
$this->setTemplateFile('config_domains');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display domain edit screen
|
||||
*/
|
||||
|
|
@ -66,7 +66,7 @@ class Domains extends Base
|
|||
}
|
||||
Context::set('domain_info', $domain_info);
|
||||
Context::set('domain_copy', false);
|
||||
|
||||
|
||||
// Get modules.
|
||||
if ($domain_info && $domain_info->index_module_srl)
|
||||
{
|
||||
|
|
@ -77,7 +77,7 @@ class Domains extends Base
|
|||
$index_module_srl = '';
|
||||
}
|
||||
Context::set('index_module_srl', $index_module_srl);
|
||||
|
||||
|
||||
// Get language list.
|
||||
Context::set('supported_lang', Lang::getSupportedList());
|
||||
Context::set('enabled_lang', Config::get('locale.enabled_lang'));
|
||||
|
|
@ -90,7 +90,7 @@ class Domains extends Base
|
|||
$domain_lang = 'default';
|
||||
}
|
||||
Context::set('domain_lang', $domain_lang);
|
||||
|
||||
|
||||
// Get timezone list.
|
||||
Context::set('timezones', DateTime::getTimezoneList());
|
||||
if ($domain_info && $domain_info->settings->timezone)
|
||||
|
|
@ -102,7 +102,7 @@ class Domains extends Base
|
|||
$domain_timezone = Config::get('locale.default_timezone');
|
||||
}
|
||||
Context::set('domain_timezone', $domain_timezone);
|
||||
|
||||
|
||||
// Get favicon and images.
|
||||
if ($domain_info)
|
||||
{
|
||||
|
|
@ -111,10 +111,10 @@ class Domains extends Base
|
|||
Context::set('default_image_url', IconModel::getDefaultImageUrl($domain_info->domain_srl));
|
||||
Context::set('color_scheme', $domain_info->settings->color_scheme ?? 'auto');
|
||||
}
|
||||
|
||||
|
||||
$this->setTemplateFile('config_domains_edit');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display domain copy screen
|
||||
*/
|
||||
|
|
@ -127,13 +127,13 @@ class Domains extends Base
|
|||
{
|
||||
throw new Exception('msg_domain_not_found');
|
||||
}
|
||||
|
||||
|
||||
// Adjust some properties for copying.
|
||||
$domain_info->domain_srl = null;
|
||||
$domain_info->is_default_domain = 'N';
|
||||
Context::set('domain_info', $domain_info);
|
||||
Context::set('domain_copy', true);
|
||||
|
||||
|
||||
// Get modules.
|
||||
if ($domain_info && $domain_info->index_module_srl)
|
||||
{
|
||||
|
|
@ -144,7 +144,7 @@ class Domains extends Base
|
|||
$index_module_srl = '';
|
||||
}
|
||||
Context::set('index_module_srl', $index_module_srl);
|
||||
|
||||
|
||||
// Get language list.
|
||||
Context::set('supported_lang', Lang::getSupportedList());
|
||||
Context::set('enabled_lang', Config::get('locale.enabled_lang'));
|
||||
|
|
@ -157,7 +157,7 @@ class Domains extends Base
|
|||
$domain_lang = 'default';
|
||||
}
|
||||
Context::set('domain_lang', $domain_lang);
|
||||
|
||||
|
||||
// Get timezone list.
|
||||
Context::set('timezones', DateTime::getTimezoneList());
|
||||
if ($domain_info && $domain_info->settings->timezone)
|
||||
|
|
@ -169,7 +169,7 @@ class Domains extends Base
|
|||
$domain_timezone = Config::get('locale.default_timezone');
|
||||
}
|
||||
Context::set('domain_timezone', $domain_timezone);
|
||||
|
||||
|
||||
// Get favicon and images.
|
||||
if ($domain_info)
|
||||
{
|
||||
|
|
@ -178,24 +178,24 @@ class Domains extends Base
|
|||
Context::set('default_image_url', IconModel::getDefaultImageUrl($domain_info->domain_srl));
|
||||
Context::set('color_scheme', $domain_info->settings->color_scheme ?? 'auto');
|
||||
}
|
||||
|
||||
|
||||
$this->setTemplateFile('config_domains_edit');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update domains configuration.
|
||||
*/
|
||||
public function procAdminUpdateDomainConfig()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
// Validate the unregistered domain action.
|
||||
$valid_actions = array('redirect_301', 'redirect_302', 'display', 'block');
|
||||
if (!in_array($vars->unregistered_domain_action, $valid_actions))
|
||||
{
|
||||
$vars->unregistered_domain_action = 'redirect_301';
|
||||
}
|
||||
|
||||
|
||||
// Save system config.
|
||||
Config::set('url.unregistered_domain_action', $vars->unregistered_domain_action);
|
||||
Config::set('use_sso', $vars->use_sso === 'Y');
|
||||
|
|
@ -203,11 +203,11 @@ class Domains extends Base
|
|||
{
|
||||
throw new Exception('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigGeneral'));
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigGeneral'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert or update domain info.
|
||||
*/
|
||||
|
|
@ -224,7 +224,7 @@ class Domains extends Base
|
|||
throw new Exception('msg_domain_not_found');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Copying?
|
||||
$copy_domain_srl = intval($vars->copy_domain_srl);
|
||||
if (!$domain_info && $copy_domain_srl > -1)
|
||||
|
|
@ -239,7 +239,7 @@ class Domains extends Base
|
|||
{
|
||||
$copy_domain_info = null;
|
||||
}
|
||||
|
||||
|
||||
// Validate the title and subtitle.
|
||||
$vars->title = utf8_trim($vars->title);
|
||||
$vars->subtitle = utf8_trim($vars->subtitle);
|
||||
|
|
@ -247,7 +247,7 @@ class Domains extends Base
|
|||
{
|
||||
throw new Exception('msg_site_title_is_empty');
|
||||
}
|
||||
|
||||
|
||||
// Validate the domain.
|
||||
if (!preg_match('@^https?://@', $vars->domain))
|
||||
{
|
||||
|
|
@ -270,7 +270,7 @@ class Domains extends Base
|
|||
{
|
||||
throw new Exception('msg_domain_already_exists');
|
||||
}
|
||||
|
||||
|
||||
// Validate the ports.
|
||||
if ($vars->http_port == 80 || !$vars->http_port)
|
||||
{
|
||||
|
|
@ -288,21 +288,21 @@ class Domains extends Base
|
|||
{
|
||||
throw new Exception('msg_invalid_https_port');
|
||||
}
|
||||
|
||||
|
||||
// Validate the security setting.
|
||||
$valid_security_options = array('none', 'optional', 'always');
|
||||
if (!in_array($vars->domain_security, $valid_security_options))
|
||||
{
|
||||
$vars->domain_security = 'none';
|
||||
}
|
||||
|
||||
|
||||
// Validate the index module setting.
|
||||
$module_info = getModel('module')->getModuleInfoByModuleSrl(intval($vars->index_module_srl));
|
||||
if (!$module_info || $module_info->module_srl != $vars->index_module_srl)
|
||||
{
|
||||
throw new Exception('msg_invalid_index_module_srl');
|
||||
}
|
||||
|
||||
|
||||
// Validate the index document setting.
|
||||
if ($vars->index_document_srl)
|
||||
{
|
||||
|
|
@ -320,36 +320,36 @@ class Domains extends Base
|
|||
{
|
||||
$vars->index_document_srl = 0;
|
||||
}
|
||||
|
||||
|
||||
// Validate the default language.
|
||||
$enabled_lang = Config::get('locale.enabled_lang');
|
||||
if ($vars->default_lang !== 'default' && !in_array($vars->default_lang, $enabled_lang))
|
||||
{
|
||||
throw new Exception('msg_lang_is_not_enabled');
|
||||
}
|
||||
|
||||
|
||||
// Validate the default time zone.
|
||||
$timezone_list = DateTime::getTimezoneList();
|
||||
if ($vars->default_timezone !== 'default' && !isset($timezone_list[$vars->default_timezone]))
|
||||
{
|
||||
throw new Exception('msg_invalid_timezone');
|
||||
}
|
||||
|
||||
|
||||
// Clean up the meta keywords and description.
|
||||
$vars->meta_keywords = utf8_trim($vars->meta_keywords);
|
||||
$vars->meta_description = utf8_trim($vars->meta_description);
|
||||
|
||||
|
||||
// Clean up the header and footer scripts.
|
||||
$vars->html_header = utf8_trim($vars->html_header);
|
||||
$vars->html_footer = utf8_trim($vars->html_footer);
|
||||
|
||||
|
||||
// Validate the color scheme setting.
|
||||
$valid_color_scheme_options = array('auto', 'light', 'dark');
|
||||
if (!in_array($vars->color_scheme, $valid_color_scheme_options))
|
||||
{
|
||||
$vars->color_scheme = 'auto';
|
||||
}
|
||||
|
||||
|
||||
// Merge all settings into an array.
|
||||
$settings = array(
|
||||
'title' => $vars->title,
|
||||
|
|
@ -362,11 +362,11 @@ class Domains extends Base
|
|||
'html_footer' => $vars->html_footer,
|
||||
'color_scheme' => $vars->color_scheme
|
||||
);
|
||||
|
||||
|
||||
// Get the DB object and begin a transaction.
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
// Insert or update the domain.
|
||||
if (!$domain_info)
|
||||
{
|
||||
|
|
@ -408,7 +408,7 @@ class Domains extends Base
|
|||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If changing the default domain, set all other domains as non-default.
|
||||
if ($vars->is_default_domain === 'Y')
|
||||
{
|
||||
|
|
@ -420,7 +420,7 @@ class Domains extends Base
|
|||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Save or copy the favicon.
|
||||
if ($vars->delete_favicon)
|
||||
{
|
||||
|
|
@ -436,7 +436,7 @@ class Domains extends Base
|
|||
$target_filename = \RX_BASEDIR . 'files/attach/xeicon/' . $domain_srl . '/' . 'favicon.ico';
|
||||
Storage::copy($source_filename, $target_filename);
|
||||
}
|
||||
|
||||
|
||||
// Save or copy the mobile icon.
|
||||
if ($vars->delete_mobicon)
|
||||
{
|
||||
|
|
@ -452,7 +452,7 @@ class Domains extends Base
|
|||
$target_filename = \RX_BASEDIR . 'files/attach/xeicon/' . $domain_srl . '/' . 'mobicon.png';
|
||||
Storage::copy($source_filename, $target_filename);
|
||||
}
|
||||
|
||||
|
||||
// Save or copy the site default image.
|
||||
if ($vars->delete_default_image)
|
||||
{
|
||||
|
|
@ -485,7 +485,7 @@ class Domains extends Base
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Update system configuration to match the default domain.
|
||||
if ($domain_info && $domain_info->is_default_domain === 'Y')
|
||||
{
|
||||
|
|
@ -502,17 +502,17 @@ class Domains extends Base
|
|||
throw new Exception('msg_failed_to_save_config');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Commit.
|
||||
$oDB->commit();
|
||||
|
||||
|
||||
// Clear cache.
|
||||
Cache::clearGroup('site_and_module');
|
||||
|
||||
|
||||
// Redirect to the domain list.
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigGeneral'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a domain.
|
||||
*/
|
||||
|
|
@ -533,7 +533,7 @@ class Domains extends Base
|
|||
{
|
||||
throw new Exception('msg_cannot_delete_default_domain');
|
||||
}
|
||||
|
||||
|
||||
// Delete the domain.
|
||||
$args = new \stdClass;
|
||||
$args->domain_srl = $domain_srl;
|
||||
|
|
@ -542,12 +542,12 @@ class Domains extends Base
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Delete icons and default image for the domain.
|
||||
IconModel::deleteIcon($domain_srl, 'favicon.ico');
|
||||
IconModel::deleteIcon($domain_srl, 'mobicon.png');
|
||||
IconModel::deleteDefaultImage($domain_srl);
|
||||
|
||||
|
||||
// Clear cache.
|
||||
Cache::clearGroup('site_and_module');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,21 +21,21 @@ class Notification extends Base
|
|||
{
|
||||
// Load advanced mailer module (for lang).
|
||||
$oAdvancedMailerAdminView = \Advanced_mailerAdminView::getInstance();
|
||||
|
||||
|
||||
// Load advanced mailer config.
|
||||
$advanced_mailer_config = $oAdvancedMailerAdminView->getConfig();
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
|
||||
|
||||
// Load member config.
|
||||
$member_config = ModuleModel::getModuleConfig('member');
|
||||
Context::set('member_config', $member_config);
|
||||
Context::set('webmaster_name', !empty($member_config->webmaster_name) ? $member_config->webmaster_name : 'webmaster');
|
||||
Context::set('webmaster_email', $member_config->webmaster_email ?? '');
|
||||
|
||||
|
||||
// Load module config.
|
||||
$module_config = ModuleModel::getModuleConfig('module');
|
||||
Context::set('module_config', $module_config);
|
||||
|
||||
|
||||
// Load mail drivers.
|
||||
$mail_drivers = Mail::getSupportedDrivers();
|
||||
uasort($mail_drivers, function($a, $b) {
|
||||
|
|
@ -45,7 +45,7 @@ class Notification extends Base
|
|||
});
|
||||
Context::set('mail_drivers', $mail_drivers);
|
||||
Context::set('mail_driver', config('mail.type') ?: 'mailfunction');
|
||||
|
||||
|
||||
// Load SMS drivers.
|
||||
$sms_drivers = SMS::getSupportedDrivers();
|
||||
uasort($sms_drivers, function($a, $b) {
|
||||
|
|
@ -55,7 +55,7 @@ class Notification extends Base
|
|||
});
|
||||
Context::set('sms_drivers', $sms_drivers);
|
||||
Context::set('sms_driver', config('sms.type') ?: 'dummy');
|
||||
|
||||
|
||||
// Load Push drivers.
|
||||
$push_drivers = Push::getSupportedDrivers();
|
||||
uasort($push_drivers, function($a, $b) { return strcmp($a['name'], $b['name']); });
|
||||
|
|
@ -67,24 +67,24 @@ class Notification extends Base
|
|||
$apns_certificate = Storage::read($apns_certificate_filename);
|
||||
}
|
||||
Context::set('apns_certificate', $apns_certificate);
|
||||
|
||||
|
||||
// Workaround for compatibility with older version of Amazon SES driver.
|
||||
config('mail.ses.api_key', config('mail.ses.api_user'));
|
||||
config('mail.ses.api_secret', config('mail.ses.api_pass'));
|
||||
|
||||
|
||||
$this->setTemplateFile('config_notification');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update notification configuration.
|
||||
*/
|
||||
public function procAdminUpdateNotification()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
// Load advanced mailer module (for lang).
|
||||
$oAdvancedMailerAdminView = \Advanced_mailerAdminView::getInstance();
|
||||
|
||||
|
||||
// Validate the mail sender's information.
|
||||
if (!$vars->mail_default_name)
|
||||
{
|
||||
|
|
@ -102,7 +102,7 @@ class Notification extends Base
|
|||
{
|
||||
throw new Exception('msg_advanced_mailer_reply_to_is_invalid');
|
||||
}
|
||||
|
||||
|
||||
// Validate the mail driver.
|
||||
$mail_drivers = Mail::getSupportedDrivers();
|
||||
$mail_driver = $vars->mail_driver;
|
||||
|
|
@ -110,7 +110,7 @@ class Notification extends Base
|
|||
{
|
||||
throw new Exception('msg_advanced_mailer_sending_method_is_invalid');
|
||||
}
|
||||
|
||||
|
||||
// Validate the mail driver settings.
|
||||
$mail_driver_config = array();
|
||||
foreach ($mail_drivers[$mail_driver]['required'] as $conf_name)
|
||||
|
|
@ -122,7 +122,7 @@ class Notification extends Base
|
|||
}
|
||||
$mail_driver_config[$conf_name] = $conf_value;
|
||||
}
|
||||
|
||||
|
||||
// Validate the SMS driver.
|
||||
$sms_drivers = SMS::getSupportedDrivers();
|
||||
$sms_driver = $vars->sms_driver;
|
||||
|
|
@ -130,7 +130,7 @@ class Notification extends Base
|
|||
{
|
||||
throw new Exception('msg_advanced_mailer_sending_method_is_invalid');
|
||||
}
|
||||
|
||||
|
||||
// Validate the SMS driver settings.
|
||||
$sms_driver_config = array();
|
||||
foreach ($sms_drivers[$sms_driver]['required'] as $conf_name)
|
||||
|
|
@ -147,7 +147,7 @@ class Notification extends Base
|
|||
$conf_value = $vars->{'sms_' . $sms_driver . '_' . $conf_name} ?: null;
|
||||
$sms_driver_config[$conf_name] = $conf_value;
|
||||
}
|
||||
|
||||
|
||||
// Validate the selected Push drivers.
|
||||
$push_config = array('types' => array());
|
||||
$push_config['allow_guest_device'] = $vars->allow_guest_device === 'Y' ? true : false;
|
||||
|
|
@ -164,7 +164,7 @@ class Notification extends Base
|
|||
throw new Exception('msg_advanced_mailer_sending_method_is_invalid');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Validate the Push driver settings.
|
||||
foreach ($push_drivers as $driver_name => $driver_definition)
|
||||
{
|
||||
|
|
@ -176,7 +176,7 @@ class Notification extends Base
|
|||
throw new Exception('msg_advanced_mailer_push_config_invalid');
|
||||
}
|
||||
$push_config[$driver_name][$conf_name] = $conf_value;
|
||||
|
||||
|
||||
// Save certificates in a separate file and only store the filename in config.php.
|
||||
if ($conf_name === 'certificate')
|
||||
{
|
||||
|
|
@ -185,7 +185,7 @@ class Notification extends Base
|
|||
{
|
||||
$filename = './files/config/' . $driver_name . '/cert-' . \Rhymix\Framework\Security::getRandom(32) . '.pem';
|
||||
}
|
||||
|
||||
|
||||
if ($conf_value !== null)
|
||||
{
|
||||
Storage::write($filename, $conf_value);
|
||||
|
|
@ -203,7 +203,7 @@ class Notification extends Base
|
|||
$push_config[$driver_name][$conf_name] = $conf_value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Save advanced mailer config.
|
||||
getController('module')->updateModuleConfig('advanced_mailer', (object)array(
|
||||
'sender_name' => trim($vars->mail_default_name),
|
||||
|
|
@ -211,13 +211,13 @@ class Notification extends Base
|
|||
'force_sender' => toBool($vars->mail_force_default_sender),
|
||||
'reply_to' => trim($vars->mail_default_reply_to),
|
||||
));
|
||||
|
||||
|
||||
// Save member config.
|
||||
getController('module')->updateModuleConfig('member', (object)array(
|
||||
'webmaster_name' => trim($vars->mail_default_name),
|
||||
'webmaster_email' => trim($vars->mail_default_from),
|
||||
));
|
||||
|
||||
|
||||
// Save system config.
|
||||
Config::set("mail.default_name", trim($vars->mail_default_name));
|
||||
Config::set("mail.default_from", trim($vars->mail_default_from));
|
||||
|
|
@ -236,7 +236,7 @@ class Notification extends Base
|
|||
{
|
||||
throw new Exception('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigNotification'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ class SEO extends Base
|
|||
$config = ModuleModel::getModuleConfig('module');
|
||||
Context::set('site_meta_keywords', escape($config->meta_keywords ?? ''));
|
||||
Context::set('site_meta_description', escape($config->meta_description ?? ''));
|
||||
|
||||
|
||||
// Titles
|
||||
Context::set('seo_main_title', escape(Config::get('seo.main_title') ?: '$SITE_TITLE - $SITE_SUBTITLE'));
|
||||
Context::set('seo_subpage_title', escape(Config::get('seo.subpage_title') ?: '$SITE_TITLE - $SUBPAGE_TITLE'));
|
||||
Context::set('seo_document_title', escape(Config::get('seo.document_title') ?: '$SITE_TITLE - $DOCUMENT_TITLE'));
|
||||
|
||||
|
||||
// OpenGraph metadata
|
||||
Context::set('og_enabled', Config::get('seo.og_enabled'));
|
||||
Context::set('og_extract_description', Config::get('seo.og_extract_description'));
|
||||
|
|
@ -34,7 +34,7 @@ class SEO extends Base
|
|||
Context::set('og_use_nick_name', Config::get('seo.og_use_nick_name'));
|
||||
Context::set('og_use_timestamps', Config::get('seo.og_use_timestamps'));
|
||||
Context::set('twitter_enabled', Config::get('seo.twitter_enabled'));
|
||||
|
||||
|
||||
$this->setTemplateFile('config_seo');
|
||||
}
|
||||
|
||||
|
|
@ -44,17 +44,17 @@ class SEO extends Base
|
|||
public function procAdminUpdateSEO()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
$args = new \stdClass;
|
||||
$args->meta_keywords = $vars->site_meta_keywords ? implode(', ', array_map('trim', explode(',', $vars->site_meta_keywords))) : '';
|
||||
$args->meta_description = trim(utf8_normalize_spaces($vars->site_meta_description));
|
||||
$oModuleController = ModuleController::getInstance();
|
||||
$oModuleController->updateModuleConfig('module', $args);
|
||||
|
||||
|
||||
Config::set('seo.main_title', trim(utf8_normalize_spaces($vars->seo_main_title)));
|
||||
Config::set('seo.subpage_title', trim(utf8_normalize_spaces($vars->seo_subpage_title)));
|
||||
Config::set('seo.document_title', trim(utf8_normalize_spaces($vars->seo_document_title)));
|
||||
|
||||
|
||||
Config::set('seo.og_enabled', $vars->og_enabled === 'Y');
|
||||
Config::set('seo.og_extract_description', $vars->og_extract_description === 'Y');
|
||||
Config::set('seo.og_extract_images', $vars->og_extract_images === 'Y');
|
||||
|
|
@ -62,13 +62,13 @@ class SEO extends Base
|
|||
Config::set('seo.og_use_nick_name', $vars->og_use_nick_name === 'Y');
|
||||
Config::set('seo.og_use_timestamps', $vars->og_use_timestamps === 'Y');
|
||||
Config::set('seo.twitter_enabled', $vars->twitter_enabled === 'Y');
|
||||
|
||||
|
||||
// Save
|
||||
if (!Config::save())
|
||||
{
|
||||
throw new Exception('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigSEO'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,18 +19,18 @@ class Security extends Base
|
|||
// Load embed filter.
|
||||
context::set('mediafilter_whitelist', implode(PHP_EOL, MediaFilter::getWhitelist()));
|
||||
context::set('mediafilter_classes', implode(PHP_EOL, Config::get('mediafilter.classes') ?: array()));
|
||||
|
||||
|
||||
// Load robot user agents.
|
||||
$robot_user_agents = Config::get('security.robot_user_agents') ?: array();
|
||||
Context::set('robot_user_agents', implode(PHP_EOL, $robot_user_agents));
|
||||
|
||||
|
||||
// Admin IP access control
|
||||
$allowed_ip = Config::get('admin.allow');
|
||||
Context::set('admin_allowed_ip', implode(PHP_EOL, $allowed_ip));
|
||||
$denied_ip = Config::get('admin.deny');
|
||||
Context::set('admin_denied_ip', implode(PHP_EOL, $denied_ip));
|
||||
Context::set('remote_addr', RX_CLIENT_IP);
|
||||
|
||||
|
||||
// Session and cookie security settings
|
||||
Context::set('use_samesite', Config::get('session.samesite'));
|
||||
Context::set('use_session_keys', Config::get('session.use_keys'));
|
||||
|
|
@ -38,17 +38,17 @@ class Security extends Base
|
|||
Context::set('use_cookies_ssl', Config::get('session.use_ssl_cookies'));
|
||||
Context::set('check_csrf_token', Config::get('security.check_csrf_token'));
|
||||
Context::set('use_nofollow', Config::get('security.nofollow'));
|
||||
|
||||
|
||||
$this->setTemplateFile('config_security');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update security configuration.
|
||||
*/
|
||||
public function procAdminUpdateSecurity()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
// Media Filter iframe/embed whitelist
|
||||
$whitelist = $vars->mediafilter_whitelist;
|
||||
$whitelist = array_filter(array_map('trim', preg_split('/[\r\n]/', $whitelist)), function($item) {
|
||||
|
|
@ -61,7 +61,7 @@ class Security extends Base
|
|||
Config::set('mediafilter.whitelist', array_values($whitelist));
|
||||
Config::set('mediafilter.iframe', []);
|
||||
Config::set('mediafilter.object', []);
|
||||
|
||||
|
||||
// HTML classes
|
||||
$classes = $vars->mediafilter_classes;
|
||||
$classes = array_filter(array_map('trim', preg_split('/[\r\n]/', $classes)), function($item) {
|
||||
|
|
@ -69,19 +69,19 @@ class Security extends Base
|
|||
});
|
||||
natcasesort($classes);
|
||||
Config::set('mediafilter.classes', array_values($classes));
|
||||
|
||||
|
||||
// Robot user agents
|
||||
$robot_user_agents = $vars->robot_user_agents;
|
||||
$robot_user_agents = array_filter(array_map('trim', preg_split('/[\r\n]/', $robot_user_agents)), function($item) {
|
||||
return $item !== '';
|
||||
});
|
||||
Config::set('security.robot_user_agents', array_values($robot_user_agents));
|
||||
|
||||
|
||||
// Remove old embed filter
|
||||
$config = Config::getAll();
|
||||
unset($config['embedfilter']);
|
||||
Config::setAll($config);
|
||||
|
||||
|
||||
// Admin IP access control
|
||||
$allowed_ip = array_map('trim', preg_split('/[\r\n]/', $vars->admin_allowed_ip));
|
||||
$allowed_ip = array_unique(array_filter($allowed_ip, function($item) {
|
||||
|
|
@ -90,7 +90,7 @@ class Security extends Base
|
|||
if (!IpFilter::validateRanges($allowed_ip)) {
|
||||
throw new Exception('msg_invalid_ip');
|
||||
}
|
||||
|
||||
|
||||
$denied_ip = array_map('trim', preg_split('/[\r\n]/', $vars->admin_denied_ip));
|
||||
$denied_ip = array_unique(array_filter($denied_ip, function($item) {
|
||||
return $item !== '';
|
||||
|
|
@ -98,20 +98,20 @@ class Security extends Base
|
|||
if (!IpFilter::validateRanges($denied_ip)) {
|
||||
throw new Exception('msg_invalid_ip');
|
||||
}
|
||||
|
||||
|
||||
$oMemberAdminModel = getAdminModel('member');
|
||||
if (!$oMemberAdminModel->getMemberAdminIPCheck($allowed_ip, $denied_ip))
|
||||
{
|
||||
throw new Exception('msg_current_ip_will_be_denied');
|
||||
}
|
||||
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$vars->use_samesite = preg_replace('/[^a-zA-Z]/', '', $vars->use_samesite);
|
||||
if ($vars->use_samesite === 'None' && ($vars->use_session_ssl !== 'Y' || $site_module_info->security !== 'always'))
|
||||
{
|
||||
$vars->use_samesite = '';
|
||||
}
|
||||
|
||||
|
||||
Config::set('admin.allow', array_values($allowed_ip));
|
||||
Config::set('admin.deny', array_values($denied_ip));
|
||||
Config::set('session.samesite', $vars->use_samesite);
|
||||
|
|
@ -120,13 +120,13 @@ class Security extends Base
|
|||
Config::set('session.use_ssl_cookies', $vars->use_cookies_ssl === 'Y');
|
||||
Config::set('security.check_csrf_token', $vars->check_csrf_token === 'Y');
|
||||
Config::set('security.nofollow', $vars->use_nofollow === 'Y');
|
||||
|
||||
|
||||
// Save
|
||||
if (!Config::save())
|
||||
{
|
||||
throw new Exception('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigSecurity'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,31 +18,31 @@ class SiteLock extends Base
|
|||
Context::set('sitelock_locked', Config::get('lock.locked'));
|
||||
Context::set('sitelock_title', escape(Config::get('lock.title')));
|
||||
Context::set('sitelock_message', escape(Config::get('lock.message')));
|
||||
|
||||
|
||||
$allowed_ip = Config::get('lock.allow') ?: array();
|
||||
Context::set('sitelock_allowed_ip', implode(\PHP_EOL, $allowed_ip));
|
||||
Context::set('remote_addr', \RX_CLIENT_IP);
|
||||
|
||||
|
||||
$this->setTemplateFile('config_sitelock');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update sitelock configuration.
|
||||
*/
|
||||
public function procAdminUpdateSitelock()
|
||||
{
|
||||
$vars = Context::gets('sitelock_locked', 'sitelock_allowed_ip', 'sitelock_title', 'sitelock_message');
|
||||
|
||||
|
||||
$allowed_ip = array_map('trim', preg_split('/[\r\n]/', $vars->sitelock_allowed_ip));
|
||||
$allowed_ip = array_unique(array_filter($allowed_ip, function($item) {
|
||||
return $item !== '';
|
||||
}));
|
||||
|
||||
|
||||
if (!IpFilter::validateRanges($allowed_ip))
|
||||
{
|
||||
throw new Exception('msg_invalid_ip');
|
||||
}
|
||||
|
||||
|
||||
Config::set('lock.locked', $vars->sitelock_locked === 'Y');
|
||||
Config::set('lock.title', trim($vars->sitelock_title));
|
||||
Config::set('lock.message', trim($vars->sitelock_message));
|
||||
|
|
@ -51,7 +51,7 @@ class SiteLock extends Base
|
|||
{
|
||||
throw new Exception('msg_failed_to_save_config');
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigSitelock'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use ModuleModel;
|
|||
class AdminMenu
|
||||
{
|
||||
public const ADMIN_MENU_NAME = '__ADMINMENU_V17__';
|
||||
|
||||
|
||||
public const DEFAULT_MENU_STRUCTURE = [
|
||||
'dashboard' => [],
|
||||
'menu' => [
|
||||
|
|
@ -56,16 +56,16 @@ class AdminMenu
|
|||
{
|
||||
return self::ADMIN_MENU_NAME;
|
||||
}
|
||||
|
||||
|
||||
public static function getAdminMenuLang()
|
||||
{
|
||||
static $lang = null;
|
||||
|
||||
|
||||
if ($lang === null)
|
||||
{
|
||||
$lang = \Rhymix\Framework\Cache::get('admin_menu_langs:' . Context::getLangType());
|
||||
}
|
||||
|
||||
|
||||
if ($lang === null)
|
||||
{
|
||||
$lang = [];
|
||||
|
|
@ -81,7 +81,7 @@ class AdminMenu
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
\Rhymix\Framework\Cache::set('admin_menu_langs:' . Context::getLangType(), $lang, 0, true);
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ class AdminMenu
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$oMenuAdminModel = MenuAdminModel::getInstance();
|
||||
$output = $oMenuAdminModel->getMenuByTitle(self::ADMIN_MENU_NAME);
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ class AdminMenu
|
|||
$args->hover_btn = '';
|
||||
$args->active_btn = '';
|
||||
$args->group_srls = $admin_group_srl;
|
||||
|
||||
|
||||
$moduleActionInfo = array();
|
||||
foreach (self::DEFAULT_MENU_STRUCTURE as $key => $items)
|
||||
{
|
||||
|
|
@ -188,7 +188,7 @@ class AdminMenu
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
foreach ($items as $item)
|
||||
{
|
||||
list($module_name, $menu_name) = explode('.', $item);
|
||||
|
|
@ -196,7 +196,7 @@ class AdminMenu
|
|||
{
|
||||
$moduleActionInfo[$module_name] = ModuleModel::getModuleActionXml($module_name);
|
||||
}
|
||||
|
||||
|
||||
$args->menu_item_srl = getNextSequence();
|
||||
$args->parent_srl = $gnbDBList["'" . $key . "'"];
|
||||
$args->name = '{$lang->menu_gnb_sub[\'' . $menu_name . '\']}';
|
||||
|
|
@ -216,7 +216,7 @@ class AdminMenu
|
|||
|
||||
/**
|
||||
* Return parent old menu key by child menu
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected static function _getOldGnbKey($menuName)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class Favorite
|
|||
{
|
||||
/**
|
||||
* Get admin favorite list
|
||||
*
|
||||
*
|
||||
* @param bool $add_module_info
|
||||
* @return BaseObject
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ class Favorite
|
|||
|
||||
/**
|
||||
* Check if a module is already favorite
|
||||
*
|
||||
*
|
||||
* @param string $module
|
||||
* @return BaseObject
|
||||
*/
|
||||
|
|
@ -71,7 +71,7 @@ class Favorite
|
|||
|
||||
/**
|
||||
* Insert a favorite.
|
||||
*
|
||||
*
|
||||
* @param string $module
|
||||
* @param string $type
|
||||
* @return DBResultHelper
|
||||
|
|
@ -88,7 +88,7 @@ class Favorite
|
|||
|
||||
/**
|
||||
* Delete a favorite.
|
||||
*
|
||||
*
|
||||
* @param int $favorite_srl
|
||||
* @return DBResultHelper
|
||||
*/
|
||||
|
|
@ -102,7 +102,7 @@ class Favorite
|
|||
|
||||
/**
|
||||
* Delete all favorites.
|
||||
*
|
||||
*
|
||||
* @return DBResultHelper
|
||||
*/
|
||||
public static function deleteAllFavorites(): DBResultHelper
|
||||
|
|
@ -114,7 +114,7 @@ class Favorite
|
|||
|
||||
/**
|
||||
* Delete all favorites that don't point to an existing module.
|
||||
*
|
||||
*
|
||||
* @return BaseObject
|
||||
*/
|
||||
public static function deleteInvalidFavorites(): BaseObject
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class Icon
|
|||
{
|
||||
/**
|
||||
* Get favicon URL for a domain.
|
||||
*
|
||||
*
|
||||
* @param int $domain_srl
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -19,7 +19,7 @@ class Icon
|
|||
|
||||
/**
|
||||
* Get mobile icon URL for a domain.
|
||||
*
|
||||
*
|
||||
* @param int $domain_srl
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -30,7 +30,7 @@ class Icon
|
|||
|
||||
/**
|
||||
* Check if an icon file exists, and if so, return its URL.
|
||||
*
|
||||
*
|
||||
* @param int $domain_srl
|
||||
* @param string $icon_name
|
||||
* @return string
|
||||
|
|
@ -50,7 +50,7 @@ class Icon
|
|||
|
||||
/**
|
||||
* Get the default image for a domain.
|
||||
*
|
||||
*
|
||||
* @param int $domain_srl
|
||||
* @param int &$width
|
||||
* @param int &$height
|
||||
|
|
@ -74,7 +74,7 @@ class Icon
|
|||
|
||||
/**
|
||||
* Save an icon for a domain.
|
||||
*
|
||||
*
|
||||
* @param int $domain_srl
|
||||
* @param string $icon_name
|
||||
* @param array $fileinfo
|
||||
|
|
@ -115,7 +115,7 @@ class Icon
|
|||
|
||||
/**
|
||||
* Save the default image for a domain.
|
||||
*
|
||||
*
|
||||
* @param int $domain_srl
|
||||
* @param array $file_info
|
||||
* @return bool
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
// Get and validate the new configuration.
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
// Update the current module's configuration.
|
||||
$config = $this->getConfig();
|
||||
$config->log_sent_mail = toBool($vars->log_sent_mail);
|
||||
|
|
@ -33,7 +33,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
if (Context::get('success_return_url'))
|
||||
{
|
||||
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||
|
|
@ -43,7 +43,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminConfig'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save the exception configuration.
|
||||
*/
|
||||
|
|
@ -52,7 +52,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
// Get the current configuration.
|
||||
$config = $this->getConfig();
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
|
||||
|
||||
// Get and validate the list of exceptions.
|
||||
$exceptions = array();
|
||||
for ($i = 1; $i <= 3; $i++)
|
||||
|
|
@ -77,7 +77,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
}
|
||||
$exceptions[$i]['method'] = $method;
|
||||
$exceptions[$i]['domains'] = array();
|
||||
|
||||
|
||||
$domains = array_map('trim', preg_split('/[,\n]/', $domains, null, PREG_SPLIT_NO_EMPTY));
|
||||
foreach ($domains as $domain)
|
||||
{
|
||||
|
|
@ -89,7 +89,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Save the new configuration.
|
||||
$config->exceptions = $exceptions;
|
||||
$output = getController('module')->insertModuleConfig('advanced_mailer', $config);
|
||||
|
|
@ -101,7 +101,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
if (Context::get('success_return_url'))
|
||||
{
|
||||
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||
|
|
@ -111,7 +111,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminExceptions'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check the DNS record of a domain.
|
||||
*/
|
||||
|
|
@ -128,14 +128,14 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('record_content', false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$records = @dns_get_record($check_config->hostname, constant('DNS_' . $check_config->record_type));
|
||||
if ($records === false)
|
||||
{
|
||||
$this->add('record_content', false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$return_values = array();
|
||||
foreach ($records as $record)
|
||||
{
|
||||
|
|
@ -147,7 +147,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('record_content', implode("\n\n", $return_values));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear old mail sending log.
|
||||
*/
|
||||
|
|
@ -163,15 +163,15 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->status = $status;
|
||||
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
|
||||
$output = executeQuery('advanced_mailer.deleteMailLogs', $obj);
|
||||
|
||||
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminMailLog', 'status', $status));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear old SMS sending log.
|
||||
*/
|
||||
|
|
@ -187,15 +187,15 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->status = $status;
|
||||
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
|
||||
$output = executeQuery('advanced_mailer.deleteSMSLogs', $obj);
|
||||
|
||||
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSMSLog', 'status', $status));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear old Push sending log.
|
||||
*/
|
||||
|
|
@ -211,15 +211,15 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->status = $status;
|
||||
$obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap());
|
||||
$output = executeQuery('advanced_mailer.deletePushLogs', $obj);
|
||||
|
||||
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminPushLog', 'status', $status));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send a test mail.
|
||||
*/
|
||||
|
|
@ -228,7 +228,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$recipient_config = Context::gets('recipient_name', 'recipient_email');
|
||||
$recipient_name = $recipient_config->recipient_name;
|
||||
$recipient_email = $recipient_config->recipient_email;
|
||||
|
||||
|
||||
if (!$recipient_name)
|
||||
{
|
||||
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_name_is_empty'));
|
||||
|
|
@ -244,10 +244,10 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_email_is_invalid'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$oAdvancedMailerController = getController('advanced_mailer');
|
||||
$sending_method = $oAdvancedMailerController->getSendingMethodForEmailAddress($recipient_email) ?: config('mail.type');
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$oMail = new Rhymix\Framework\Mail();
|
||||
|
|
@ -256,7 +256,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
'<p>고급 메일 발송 모듈 <b>테스트</b> 메일입니다.</p><p>메일이 정상적으로 발송되고 있습니다.</p>');
|
||||
$oMail->addTo($recipient_email, $recipient_name);
|
||||
$result = $oMail->send();
|
||||
|
||||
|
||||
if (!$result)
|
||||
{
|
||||
if (count($oMail->getErrors()))
|
||||
|
|
@ -274,7 +274,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->add('test_result', nl2br(htmlspecialchars(implode("\n", $oMail->getErrors()))));
|
||||
return;
|
||||
}
|
||||
|
|
@ -290,11 +290,11 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('test_result', nl2br(htmlspecialchars($e->getMessage())));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->add('test_result', Context::getLang('msg_advanced_mailer_test_success'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send a test SMS.
|
||||
*/
|
||||
|
|
@ -303,7 +303,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$recipient_number = Context::get('recipient_number');
|
||||
$country_code = intval(Context::get('country_code'));
|
||||
$content = trim(Context::get('content'));
|
||||
|
||||
|
||||
if (!$recipient_number)
|
||||
{
|
||||
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_number_is_empty'));
|
||||
|
|
@ -314,14 +314,14 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_content_is_empty'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$oSMS = new Rhymix\Framework\SMS();
|
||||
$oSMS->addTo($recipient_number, $country_code);
|
||||
$oSMS->setBody($content);
|
||||
$result = $oSMS->send();
|
||||
|
||||
|
||||
if (!$result)
|
||||
{
|
||||
if (count($oSMS->getErrors()))
|
||||
|
|
@ -341,11 +341,11 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('test_result', nl2br(htmlspecialchars($e->getMessage())));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->add('test_result', Context::getLang('msg_advanced_mailer_test_success_sms'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send a test Push Notification.
|
||||
*/
|
||||
|
|
@ -355,14 +355,14 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$subject = trim(Context::get('subject'));
|
||||
$content = trim(Context::get('content'));
|
||||
$url = trim(Context::get('url'));
|
||||
|
||||
|
||||
$member_info = MemberModel::getMemberInfoByUserID($recipient_user_id);
|
||||
if (!$member_info || !$member_info->member_srl)
|
||||
{
|
||||
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_user_id_not_found'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass;
|
||||
$args->member_srl = $member_info->member_srl;
|
||||
$output = executeQueryArray('member.getMemberDeviceTokensByMemberSrl', $args);
|
||||
|
|
@ -371,7 +371,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_has_no_devices'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!$subject)
|
||||
{
|
||||
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_subject_is_empty'));
|
||||
|
|
@ -387,7 +387,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_url_is_invalid'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$oPush = new Rhymix\Framework\Push;
|
||||
|
|
@ -396,7 +396,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$oPush->setContent($content);
|
||||
$oPush->setURL($url);
|
||||
$result = $oPush->send();
|
||||
|
||||
|
||||
if (!$result)
|
||||
{
|
||||
if (count($oPush->getErrors()))
|
||||
|
|
@ -416,7 +416,7 @@ class Advanced_MailerAdminController extends Advanced_Mailer
|
|||
$this->add('test_result', nl2br(htmlspecialchars($e->getMessage())));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->add('test_result', Context::getLang('msg_advanced_mailer_test_success_sms'));
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('config');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the exception domains configuration form.
|
||||
*/
|
||||
|
|
@ -27,7 +27,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
|
||||
|
||||
for ($i = 1; $i <= 3; $i++)
|
||||
{
|
||||
if (!isset($advanced_mailer_config->exceptions[$i]))
|
||||
|
|
@ -39,15 +39,15 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
$advanced_mailer_config->exceptions[$i]['method'] = 'mailfunction';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
Context::set('sending_method', config('mail.type'));
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('exceptions');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the SPF/DKIM setting guide.
|
||||
*/
|
||||
|
|
@ -55,7 +55,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
|
||||
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
Context::set('sending_method', config('mail.type'));
|
||||
|
|
@ -67,7 +67,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
Context::set('sending_domain', preg_replace('/^www\./', '', $_SERVER['HTTP_HOST']));
|
||||
}
|
||||
|
||||
|
||||
$used_methods = array(config('mail.type'));
|
||||
$advanced_mailer_config->exceptions = $advanced_mailer_config->exceptions ?: array();
|
||||
foreach ($advanced_mailer_config->exceptions as $exception)
|
||||
|
|
@ -78,7 +78,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
Context::set('used_methods', $used_methods);
|
||||
|
||||
|
||||
$used_methods_with_usable_spf = array();
|
||||
$used_methods_with_usable_dkim = array();
|
||||
foreach ($used_methods as $method)
|
||||
|
|
@ -104,11 +104,11 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
ksort($used_methods_with_usable_dkim);
|
||||
Context::set('used_methods_with_usable_spf', $used_methods_with_usable_spf);
|
||||
Context::set('used_methods_with_usable_dkim', $used_methods_with_usable_dkim);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('spf_dkim');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the mail test form.
|
||||
*/
|
||||
|
|
@ -116,15 +116,15 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
|
||||
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
Context::set('sending_method', config('mail.type'));
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('mail_test');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the mail log.
|
||||
*/
|
||||
|
|
@ -137,20 +137,20 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
$maillog = $maillog->toBool() ? $this->procMailLog($maillog->data) : array();
|
||||
Context::set('advanced_mailer_log', $maillog);
|
||||
Context::set('advanced_mailer_status', $obj->status);
|
||||
|
||||
|
||||
$paging = $this->procPaging($obj->status, 'mail', $page);
|
||||
Context::set('total_count', $paging->total_count);
|
||||
Context::set('total_page', $paging->total_page);
|
||||
Context::set('page', $paging->page);
|
||||
Context::set('page_navigation', $paging->page_navigation);
|
||||
|
||||
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('mail_log');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the SMS test form.
|
||||
*/
|
||||
|
|
@ -158,15 +158,15 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
$sending_methods = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
|
||||
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
Context::set('sending_method', config('mail.type'));
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('sms_test');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the SMS log.
|
||||
*/
|
||||
|
|
@ -179,20 +179,20 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
$smslog = $smslog->toBool() ? $smslog->data : array();
|
||||
Context::set('advanced_mailer_log', $smslog);
|
||||
Context::set('advanced_mailer_status', $obj->status);
|
||||
|
||||
|
||||
$paging = $this->procPaging($obj->status, 'sms', $page);
|
||||
Context::set('total_count', $paging->total_count);
|
||||
Context::set('total_page', $paging->total_page);
|
||||
Context::set('page', $paging->page);
|
||||
Context::set('page_navigation', $paging->page_navigation);
|
||||
|
||||
|
||||
$sending_methods = Rhymix\Framework\SMS::getSupportedDrivers();
|
||||
Context::set('sending_methods', $sending_methods);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('sms_log');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the Push test form.
|
||||
*/
|
||||
|
|
@ -200,11 +200,11 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
{
|
||||
$advanced_mailer_config = $this->getConfig();
|
||||
Context::set('advanced_mailer_config', $advanced_mailer_config);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('push_test');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the Push log.
|
||||
*/
|
||||
|
|
@ -217,17 +217,17 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
$pushlog = $pushlog->toBool() ? $pushlog->data : array();
|
||||
Context::set('advanced_mailer_log', $pushlog);
|
||||
Context::set('advanced_mailer_status', $obj->status);
|
||||
|
||||
|
||||
$paging = $this->procPaging($obj->status, 'push', $page);
|
||||
Context::set('total_count', $paging->total_count);
|
||||
Context::set('total_page', $paging->total_page);
|
||||
Context::set('page', $paging->page);
|
||||
Context::set('page_navigation', $paging->page_navigation);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('push_log');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process mail log for display.
|
||||
*/
|
||||
|
|
@ -248,7 +248,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
$item->mail_from = $from;
|
||||
|
||||
|
||||
$to = explode("\n", $item->mail_to);
|
||||
foreach($to as &$toitem)
|
||||
{
|
||||
|
|
@ -263,10 +263,10 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
}
|
||||
$item->mail_to = $to;
|
||||
}
|
||||
|
||||
|
||||
return $log;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process paging.
|
||||
*/
|
||||
|
|
@ -288,7 +288,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
}
|
||||
$total_count = $count->data->count;
|
||||
$total_page = max(1, ceil($total_count / 20));
|
||||
|
||||
|
||||
$output = new stdClass;
|
||||
$output->total_count = $total_count;
|
||||
$output->total_page = $total_page;
|
||||
|
|
@ -296,7 +296,7 @@ class Advanced_MailerAdminView extends Advanced_Mailer
|
|||
$output->page_navigation = new PageHandler($total_count, $total_page, $page, 10);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the public IPv4 address of the current server.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -18,23 +18,23 @@ class Advanced_Mailer extends ModuleObject
|
|||
{
|
||||
$config = new stdClass();
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->is_enabled) || isset($config->sending_method) || isset($config->send_type))
|
||||
{
|
||||
$config = $this->migrateConfig($config);
|
||||
getController('module')->insertModuleConfig('advanced_mailer', $config);
|
||||
}
|
||||
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Migrate from previous configuration format.
|
||||
*/
|
||||
public function migrateConfig($config)
|
||||
{
|
||||
$systemconfig = array();
|
||||
|
||||
|
||||
if (isset($config->sending_method))
|
||||
{
|
||||
$systemconfig['mail.type'] = $config->sending_method;
|
||||
|
|
@ -47,7 +47,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
{
|
||||
$systemconfig['mail.type'] = 'mailfunction';
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->username))
|
||||
{
|
||||
if (in_array('username', $this->sending_methods[$config->sending_method]['conf']))
|
||||
|
|
@ -56,7 +56,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
unset($config->username);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->password))
|
||||
{
|
||||
if (in_array('password', $this->sending_methods[$config->sending_method]['conf']))
|
||||
|
|
@ -65,7 +65,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
unset($config->password);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->domain))
|
||||
{
|
||||
if (in_array('domain', $this->sending_methods[$config->sending_method]['conf']))
|
||||
|
|
@ -74,7 +74,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
unset($config->domain);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->api_key))
|
||||
{
|
||||
if (in_array('api_key', $this->sending_methods[$config->sending_method]['conf']))
|
||||
|
|
@ -83,7 +83,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
unset($config->api_key);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->account_type))
|
||||
{
|
||||
if (in_array('account_type', $this->sending_methods[$config->sending_method]['conf']))
|
||||
|
|
@ -92,25 +92,25 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
unset($config->account_type);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->aws_region))
|
||||
{
|
||||
$config->ses_region = $config->aws_region;
|
||||
unset($config->aws_region);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->aws_access_key))
|
||||
{
|
||||
$config->ses_access_key = $config->aws_access_key;
|
||||
unset($config->aws_access_key);
|
||||
}
|
||||
|
||||
|
||||
if (isset($config->aws_secret_key))
|
||||
{
|
||||
$config->ses_secret_key = $config->aws_secret_key;
|
||||
unset($config->aws_secret_key);
|
||||
}
|
||||
|
||||
|
||||
$mail_drivers = Rhymix\Framework\Mail::getSupportedDrivers();
|
||||
foreach ($mail_drivers as $driver_name => $driver_definition)
|
||||
{
|
||||
|
|
@ -153,7 +153,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (count($systemconfig))
|
||||
{
|
||||
foreach ($systemconfig as $key => $value)
|
||||
|
|
@ -162,7 +162,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
Rhymix\Framework\Config::save();
|
||||
}
|
||||
|
||||
|
||||
unset($config->is_enabled);
|
||||
unset($config->sending_method);
|
||||
unset($config->send_type);
|
||||
|
|
@ -173,10 +173,10 @@ class Advanced_Mailer extends ModuleObject
|
|||
{
|
||||
$config->exceptions = array();
|
||||
}
|
||||
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register triggers.
|
||||
*/
|
||||
|
|
@ -205,7 +205,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
$oModuleController->insertTrigger('push.send', 'advanced_mailer', 'controller', 'triggerAfterPushSend', 'after');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Install.
|
||||
*/
|
||||
|
|
@ -213,7 +213,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
{
|
||||
$this->registerTriggers();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check update.
|
||||
*/
|
||||
|
|
@ -242,7 +242,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update.
|
||||
*/
|
||||
|
|
@ -250,7 +250,7 @@ class Advanced_Mailer extends ModuleObject
|
|||
{
|
||||
$this->registerTriggers();
|
||||
}
|
||||
|
||||
|
||||
public function recompileCache()
|
||||
{
|
||||
// no-op
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
public function triggerBeforeMailSend($mail)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
$recipients = $mail->message->getTo() ?: array();
|
||||
if ($recipients)
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$mail->getFrom())
|
||||
{
|
||||
list($default_from, $default_name) = $this->getDefaultEmailIdentity();
|
||||
|
|
@ -58,20 +58,20 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* After mail send trigger.
|
||||
*/
|
||||
public function triggerAfterMailSend($mail)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
if (toBool($config->log_sent_mail ?? 'N') || (toBool($config->log_errors ?? 'N') && count($mail->errors)))
|
||||
{
|
||||
$obj = new \stdClass();
|
||||
$obj->mail_from = '';
|
||||
$obj->mail_to = '';
|
||||
|
||||
|
||||
if ($real_sender = $mail->message->getFrom())
|
||||
{
|
||||
foreach($real_sender as $email => $name)
|
||||
|
|
@ -79,7 +79,7 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
$obj->mail_from .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($real_to = $mail->message->getTo())
|
||||
{
|
||||
foreach($real_to as $email => $name)
|
||||
|
|
@ -87,7 +87,7 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
$obj->mail_to .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($real_cc = $mail->message->getCc())
|
||||
{
|
||||
foreach($real_cc as $email => $name)
|
||||
|
|
@ -95,7 +95,7 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
$obj->mail_to .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($real_bcc = $mail->message->getBcc())
|
||||
{
|
||||
foreach($real_bcc as $email => $name)
|
||||
|
|
@ -103,7 +103,7 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
$obj->mail_to .= (strval($name) !== '' ? "$name <$email>" : $email) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$obj->mail_from = trim($obj->mail_from);
|
||||
$obj->mail_to = trim($obj->mail_to);
|
||||
$obj->subject = $mail->message->getSubject();
|
||||
|
|
@ -118,10 +118,10 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the default identity for sending email.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDefaultEmailIdentity()
|
||||
|
|
@ -134,13 +134,13 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
$email = $member_config->webmaster_email;
|
||||
$name = $member_config->webmaster_name ?: 'webmaster';
|
||||
}
|
||||
|
||||
|
||||
return [$email, $name];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if an email address is on a list of exceptions.
|
||||
*
|
||||
*
|
||||
* @param string $email
|
||||
* @param object $config (optional)
|
||||
* @return string|null
|
||||
|
|
@ -151,14 +151,14 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
{
|
||||
$config = $this->getConfig();
|
||||
}
|
||||
|
||||
|
||||
if (!isset($config->exceptions) || !is_array($config->exceptions) || !count($config->exceptions))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$email = Rhymix\Framework\URL::encodeIdna($email);
|
||||
|
||||
|
||||
foreach ($config->exceptions as $exception)
|
||||
{
|
||||
$domains = array();
|
||||
|
|
@ -171,17 +171,17 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
return $exception['method'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* After SMS send trigger.
|
||||
*/
|
||||
public function triggerAfterSMSSend($sms)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
if (toBool($config->log_sent_sms ?? 'N') || (toBool($config->log_sms_errors ?? 'N') && count($sms->errors)))
|
||||
{
|
||||
$obj = new \stdClass();
|
||||
|
|
@ -211,14 +211,14 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* After Push send trigger.
|
||||
*/
|
||||
public function triggerAfterPushSend($push)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
||||
|
||||
if (toBool($config->log_sent_push ?? 'N') || (toBool($config->log_push_errors ?? 'N') && count($push->getErrors())))
|
||||
{
|
||||
$obj = new \stdClass();
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@ class Advanced_MailerModel extends Advanced_Mailer
|
|||
*/
|
||||
public function triggerReplaceMailClass()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class boardAdminController extends board {
|
|||
**/
|
||||
function init()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -37,7 +37,7 @@ class boardAdminController extends board {
|
|||
{
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($args->module_srl);
|
||||
}
|
||||
|
||||
|
||||
// setup extra_order_target
|
||||
$extra_order_target = array();
|
||||
if($args->module_srl)
|
||||
|
|
@ -77,10 +77,10 @@ class boardAdminController extends board {
|
|||
$args->protect_admin_content_delete = 'N';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order';
|
||||
if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
|
||||
|
||||
|
||||
$args->skip_bottom_list_days = max(0, intval($args->skip_bottom_list_days));
|
||||
$args->browser_title = trim(utf8_normalize_spaces($args->browser_title));
|
||||
$args->meta_keywords = $args->meta_keywords ? implode(', ', array_map('trim', explode(',', $args->meta_keywords))) : '';
|
||||
|
|
@ -91,7 +91,7 @@ class boardAdminController extends board {
|
|||
{
|
||||
unset($args->module_srl);
|
||||
}
|
||||
|
||||
|
||||
// preserve existing config
|
||||
if ($args->module_srl)
|
||||
{
|
||||
|
|
@ -209,25 +209,25 @@ class boardAdminController extends board {
|
|||
$include_modules = array_map('intval', $vars->include_modules ?: []);
|
||||
$include_days = max(0, floatval($vars->include_days));
|
||||
$include_notice = $vars->include_notice === 'Y' ? 'Y' : 'N';
|
||||
|
||||
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($module_srl);
|
||||
if (!$module_info)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\TargetNotFound;
|
||||
}
|
||||
|
||||
|
||||
$module_info->include_modules = implode(',', array_filter($include_modules, function($item) {
|
||||
return $item > 0;
|
||||
}));
|
||||
$module_info->include_days = floatval(number_format($include_days, 2, '.', ''));
|
||||
$module_info->include_notice = $include_notice;
|
||||
|
||||
|
||||
$output = getController('module')->updateModule($module_info);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
if (Context::get('success_return_url'))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ class boardAdminView extends board {
|
|||
$args->list_count = 1000;
|
||||
$output = executeQueryArray('board.getBoardList', $args, ['module_srl', 'mid', 'browser_title']);
|
||||
Context::set('board_list', $output->data);
|
||||
|
||||
|
||||
// setup the template file
|
||||
$this->setTemplateFile('addition_setup');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class boardAPI extends board
|
|||
|
||||
/**
|
||||
* Apply _arrangeContent to a list of documents.
|
||||
*
|
||||
*
|
||||
* @param array $content_list
|
||||
* @param object $grant
|
||||
* @return array
|
||||
|
|
@ -120,7 +120,7 @@ class boardAPI extends board
|
|||
|
||||
/**
|
||||
* Clean up document info so that only some fields are exposed.
|
||||
*
|
||||
*
|
||||
* @param object $content
|
||||
* @param object $grant
|
||||
* @return stdClass
|
||||
|
|
@ -162,7 +162,7 @@ class boardAPI extends board
|
|||
|
||||
/**
|
||||
* Clean up comment info so that only some fields are exposed.
|
||||
*
|
||||
*
|
||||
* @param array $comment_list
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -190,7 +190,7 @@ class boardAPI extends board
|
|||
|
||||
/**
|
||||
* Clean up file info so that only some fields are exposed.
|
||||
*
|
||||
*
|
||||
* @param array $file_list
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -211,7 +211,7 @@ class boardAPI extends board
|
|||
|
||||
/**
|
||||
* Clean up extra vars so that only some fields are exposed.
|
||||
*
|
||||
*
|
||||
* @param array $extra_var_list
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class boardController extends board
|
|||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief insert document
|
||||
**/
|
||||
|
|
@ -26,12 +26,12 @@ class boardController extends board
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// setup variables
|
||||
$obj = Context::getRequestVars();
|
||||
$obj->module_srl = $this->module_srl;
|
||||
$obj->commentStatus = $obj->comment_status;
|
||||
|
||||
|
||||
// Remove disallowed Unicode symbols.
|
||||
if ($this->module_info->filter_specialchars !== 'N')
|
||||
{
|
||||
|
|
@ -48,20 +48,20 @@ class boardController extends board
|
|||
$obj->tags = utf8_clean($obj->tags);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Return error if content is empty.
|
||||
if (is_empty_html_content($obj->content))
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_empty_content');
|
||||
}
|
||||
|
||||
|
||||
// Return error if content is too large.
|
||||
$document_length_limit = ($this->module_info->document_length_limit ?: 1024) * 1024;
|
||||
if (strlen($obj->content) > $document_length_limit && !$this->grant->manager)
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_content_too_long');
|
||||
}
|
||||
|
||||
|
||||
// unset document style if not manager
|
||||
if(!$this->grant->manager)
|
||||
{
|
||||
|
|
@ -73,12 +73,12 @@ class boardController extends board
|
|||
{
|
||||
$obj->is_admin = 'Y';
|
||||
}
|
||||
|
||||
|
||||
$oDocumentController = getController('document');
|
||||
|
||||
|
||||
$secret_status = DocumentModel::getConfigStatus('secret');
|
||||
$use_status = explode('|@|', $this->module_info->use_status);
|
||||
|
||||
|
||||
// Set status
|
||||
if(($obj->is_secret == 'Y' || $obj->status == $secret_status) && is_array($use_status) && in_array($secret_status, $use_status))
|
||||
{
|
||||
|
|
@ -89,16 +89,16 @@ class boardController extends board
|
|||
unset($obj->is_secret);
|
||||
$obj->status = DocumentModel::getConfigStatus('public');
|
||||
}
|
||||
|
||||
|
||||
// Set update log
|
||||
if($this->module_info->update_log == 'Y')
|
||||
{
|
||||
$obj->update_log_setting = 'Y';
|
||||
}
|
||||
|
||||
|
||||
$manual = false;
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
||||
$oDocument = DocumentModel::getDocument($obj->document_srl);
|
||||
|
||||
// Set anonymous information when insert mode or status is temp
|
||||
|
|
@ -108,17 +108,17 @@ class boardController extends board
|
|||
{
|
||||
$obj->document_srl = getNextSequence();
|
||||
}
|
||||
|
||||
|
||||
$manual = true;
|
||||
$anonymous_name = $this->module_info->anonymous_name ?: 'anonymous';
|
||||
$anonymous_name = $this->createAnonymousName($anonymous_name, $logged_info->member_srl, $obj->document_srl);
|
||||
$this->module_info->admin_mail = '';
|
||||
|
||||
|
||||
$obj->notify_message = 'N';
|
||||
$obj->email_address = $obj->homepage = $obj->user_id = '';
|
||||
$obj->user_name = $obj->nick_name = $anonymous_name;
|
||||
}
|
||||
|
||||
|
||||
// Update if the document already exists.
|
||||
if($oDocument->isExists())
|
||||
{
|
||||
|
|
@ -126,7 +126,7 @@ class boardController extends board
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// Protect admin document
|
||||
if ($this->module_info->protect_admin_content_update !== 'N')
|
||||
{
|
||||
|
|
@ -136,7 +136,7 @@ class boardController extends board
|
|||
throw new Rhymix\Framework\Exception('msg_admin_document_no_modify');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if document status is temp
|
||||
if($oDocument->get('status') == DocumentModel::getConfigStatus('temp'))
|
||||
{
|
||||
|
|
@ -146,7 +146,7 @@ class boardController extends board
|
|||
$obj->member_srl = abs($oDocument->get('member_srl')) * -1;
|
||||
$oDocument->add('member_srl', $obj->member_srl);
|
||||
}
|
||||
|
||||
|
||||
// Update list order, date
|
||||
$obj->last_update = $obj->regdate = date('YmdHis');
|
||||
$obj->update_order = $obj->list_order = (getNextSequence() * -1);
|
||||
|
|
@ -161,7 +161,7 @@ class boardController extends board
|
|||
throw new Rhymix\Framework\Exception('msg_protect_update_content');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Protect document by date
|
||||
if($this->module_info->protect_document_regdate > 0 && !$this->grant->manager)
|
||||
{
|
||||
|
|
@ -170,7 +170,7 @@ class boardController extends board
|
|||
throw new Rhymix\Framework\Exception(sprintf(lang('msg_protect_regdate_document'), $this->module_info->protect_document_regdate));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Preserve module_srl if the document belongs to a module that is included in this board
|
||||
if ($oDocument->get('module_srl') != $obj->module_srl && in_array($oDocument->get('module_srl'), explode(',', $this->module_info->include_modules ?: '')))
|
||||
{
|
||||
|
|
@ -181,7 +181,7 @@ class boardController extends board
|
|||
{
|
||||
$obj->module_srl = $oDocument->get('module_srl');
|
||||
}
|
||||
|
||||
|
||||
// notice & document style same as before if not manager
|
||||
if(!$this->grant->manager)
|
||||
{
|
||||
|
|
@ -189,13 +189,13 @@ class boardController extends board
|
|||
$obj->title_color = $oDocument->get('title_color');
|
||||
$obj->title_bold = $oDocument->get('title_bold');
|
||||
}
|
||||
|
||||
|
||||
$obj->reason_update = escape($obj->reason_update);
|
||||
}
|
||||
|
||||
|
||||
// Update
|
||||
$output = $oDocumentController->updateDocument($oDocument, $obj, $manual);
|
||||
|
||||
|
||||
$msg_code = 'success_updated';
|
||||
}
|
||||
// Insert a new document.
|
||||
|
|
@ -206,29 +206,29 @@ class boardController extends board
|
|||
{
|
||||
$obj->member_srl = $logged_info->member_srl * -1;
|
||||
}
|
||||
|
||||
|
||||
// Update list order if document_srl is already assigned
|
||||
if ($obj->document_srl)
|
||||
{
|
||||
$obj->update_order = $obj->list_order = (getNextSequence() * -1);
|
||||
}
|
||||
|
||||
|
||||
// Insert
|
||||
$output = $oDocumentController->insertDocument($obj, $manual, false, $obj->document_srl ? false : true);
|
||||
|
||||
|
||||
if ($output->toBool())
|
||||
{
|
||||
// Set grant for the new document.
|
||||
$oDocument = DocumentModel::getDocument($output->get('document_srl'));
|
||||
$oDocument->setGrantForSession();
|
||||
|
||||
|
||||
// send an email to admin user
|
||||
if ($this->module_info->admin_mail && config('mail.default_from'))
|
||||
{
|
||||
$browser_title = Context::replaceUserLang($this->module_info->browser_title);
|
||||
$mail_title = sprintf(lang('msg_document_notify_mail'), $browser_title, cut_str($obj->title, 20, '...'));
|
||||
$mail_content = sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('', 'document_srl', $output->get('document_srl')), getFullUrl('', 'document_srl', $output->get('document_srl')), $obj->content);
|
||||
|
||||
|
||||
$oMail = new \Rhymix\Framework\Mail();
|
||||
$oMail->setSubject($mail_title);
|
||||
$oMail->setBody($mail_content);
|
||||
|
|
@ -242,21 +242,21 @@ class boardController extends board
|
|||
$oMail->send();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$msg_code = 'success_registed';
|
||||
}
|
||||
|
||||
|
||||
// if there is an error
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// return the results
|
||||
$this->add('mid', Context::get('mid'));
|
||||
$this->add('document_srl', $output->get('document_srl'));
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'), 'document_srl', $output->get('document_srl')));
|
||||
|
||||
|
||||
// alert a message
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
|
@ -325,7 +325,7 @@ class boardController extends board
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// check protect content
|
||||
if($this->module_info->protect_content == 'Y' || $this->module_info->protect_delete_content == 'Y')
|
||||
{
|
||||
|
|
@ -415,7 +415,7 @@ class boardController extends board
|
|||
$obj->content = utf8_clean($obj->content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Return error if content is empty.
|
||||
if (is_empty_html_content($obj->content))
|
||||
{
|
||||
|
|
@ -428,7 +428,7 @@ class boardController extends board
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_content_too_long');
|
||||
}
|
||||
|
||||
|
||||
if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
|
||||
if(!is_array($this->module_info->use_status))
|
||||
{
|
||||
|
|
@ -453,7 +453,7 @@ class boardController extends board
|
|||
}
|
||||
|
||||
$obj->module_srl = $oDocument->get('module_srl');
|
||||
|
||||
|
||||
// For anonymous use, remove writer's information and notifying information
|
||||
if($this->module_info->use_anonymous == 'Y' && (!$this->grant->manager || ($this->module_info->anonymous_except_admin ?? 'N') !== 'Y'))
|
||||
{
|
||||
|
|
@ -505,7 +505,7 @@ class boardController extends board
|
|||
{
|
||||
// Update document last_update info?
|
||||
$update_document = $this->module_info->update_order_on_comment === 'N' ? false : true;
|
||||
|
||||
|
||||
// Parent exists.
|
||||
if($obj->parent_srl)
|
||||
{
|
||||
|
|
@ -592,7 +592,7 @@ class boardController extends board
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$childs = null;
|
||||
if($this->module_info->protect_delete_comment === 'Y' && $this->grant->manager == false)
|
||||
{
|
||||
|
|
@ -602,7 +602,7 @@ class boardController extends board
|
|||
throw new Rhymix\Framework\Exception('msg_board_delete_protect_comment');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($this->module_info->protect_admin_content_delete !== 'N' && $this->user->is_admin !== 'Y')
|
||||
{
|
||||
$member_info = MemberModel::getMemberInfo($comment->get('member_srl'));
|
||||
|
|
@ -760,7 +760,7 @@ class boardController extends board
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// get the module information
|
||||
$module_info = ModuleModel::getModuleInfoByMid($mid);
|
||||
if (!$module_info || !isset($module_info->module) || $module_info->module !== 'board')
|
||||
|
|
@ -774,14 +774,14 @@ class boardController extends board
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$url = getUrl('', 'mid', $mid, 'member_srl', $obj->member_srl);
|
||||
getController('member')->addMemberPopupMenu($url, 'cmd_view_own_document', '', 'self', 'board_own_document');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an anonymous nickname.
|
||||
*
|
||||
*
|
||||
* @param string $format
|
||||
* @param int $member_srl
|
||||
* @param int $document_srl
|
||||
|
|
@ -800,10 +800,10 @@ class boardController extends board
|
|||
}
|
||||
}, $format);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Subroutine for hashing anonymous nickname.
|
||||
*
|
||||
*
|
||||
* @param string $content
|
||||
* @param int $digits
|
||||
* @return string
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ class boardView extends board
|
|||
// Check if a permission for file download is granted
|
||||
// Get configurations (using module model object)
|
||||
$file_module_config = ModuleModel::getModulePartConfig('file',$this->module_srl);
|
||||
|
||||
|
||||
$downloadGrantCount = 0;
|
||||
if(is_array($file_module_config->download_grant))
|
||||
{
|
||||
|
|
@ -384,7 +384,7 @@ class boardView extends board
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted('msg_not_permitted_download');
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
|
|
@ -470,7 +470,7 @@ class boardView extends board
|
|||
}
|
||||
$output = DocumentModel::getNoticeList($args, $this->columnList);
|
||||
$notice_list = $output->data ?? [];
|
||||
|
||||
|
||||
$this->_fillModuleTitles($notice_list);
|
||||
Context::set('notice_list', $notice_list);
|
||||
}
|
||||
|
|
@ -507,7 +507,7 @@ class boardView extends board
|
|||
$args->search_target = Context::get('search_target');
|
||||
$args->search_keyword = Context::get('search_keyword');
|
||||
}
|
||||
|
||||
|
||||
if(!$search_option = Context::get('search_option'))
|
||||
{
|
||||
$search_option = $this->search_option;
|
||||
|
|
@ -516,13 +516,13 @@ class boardView extends board
|
|||
{
|
||||
$args->search_target = '';
|
||||
}
|
||||
|
||||
|
||||
// set member_srl for view particular member's document
|
||||
if($this->module_info->use_anonymous !== 'Y')
|
||||
{
|
||||
$args->member_srl = abs(Context::get('member_srl') ?? 0) ?: null;
|
||||
}
|
||||
|
||||
|
||||
// if the category is enabled, then get the category
|
||||
if($this->module_info->use_category=='Y')
|
||||
{
|
||||
|
|
@ -603,12 +603,12 @@ class boardView extends board
|
|||
public function _fillModuleTitles(&$document_list)
|
||||
{
|
||||
static $map = null;
|
||||
|
||||
|
||||
if (!$document_list)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ($this->include_modules)
|
||||
{
|
||||
if ($map === null)
|
||||
|
|
@ -655,17 +655,17 @@ class boardView extends board
|
|||
'regdate', 'last_update', 'last_updater', 'ipaddress', 'list_order', 'update_order',
|
||||
'allow_trackback', 'notify_message', 'status', 'comment_status',
|
||||
);
|
||||
|
||||
|
||||
// List of columns that should always be selected
|
||||
$defaultColumnList = array(
|
||||
'document_srl', 'module_srl', 'category_srl', 'lang_code', 'is_notice',
|
||||
'title', 'title_bold', 'title_color', 'member_srl', 'nick_name', 'tags', 'extra_vars',
|
||||
'comment_count', 'trackback_count', 'uploaded_count', 'status', 'regdate', 'last_update',
|
||||
);
|
||||
|
||||
|
||||
// List of columns selected by the user
|
||||
$selectedColumnList = array_keys($this->listConfig);
|
||||
|
||||
|
||||
// Return all columns for some legacy skins
|
||||
if($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog')
|
||||
{
|
||||
|
|
@ -682,12 +682,12 @@ class boardView extends board
|
|||
{
|
||||
$selectedColumnList[] = 'last_updater';
|
||||
}
|
||||
|
||||
|
||||
// Remove duplicates and/or invalid column names
|
||||
$selectedColumnList = array_intersect($selectedColumnList, $allColumnList);
|
||||
$this->columnList = array_unique(array_merge($defaultColumnList, $selectedColumnList));
|
||||
}
|
||||
|
||||
|
||||
// add table name
|
||||
foreach($this->columnList as $no => $value)
|
||||
{
|
||||
|
|
@ -756,19 +756,19 @@ class boardView extends board
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
if($this->grant->view == false || ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$oDocument = DocumentModel::getDocument($document_srl);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\TargetNotFound;
|
||||
}
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('default_layout');
|
||||
$this->setTemplateFile('comment.html');
|
||||
|
|
@ -819,7 +819,7 @@ class boardView extends board
|
|||
if($is_granted) $category_list[$category_srl] = $category;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// check if at least one category is granted
|
||||
$grant_exists = false;
|
||||
foreach ($category_list as $category)
|
||||
|
|
@ -866,7 +866,7 @@ class boardView extends board
|
|||
throw new Rhymix\Framework\Exception('msg_protect_update_content');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($this->module_info->protect_admin_content_update !== 'N')
|
||||
{
|
||||
$member_info = MemberModel::getMemberInfo($oDocument->get('member_srl'));
|
||||
|
|
@ -894,7 +894,7 @@ class boardView extends board
|
|||
{
|
||||
$pointForInsert = 0;
|
||||
}
|
||||
|
||||
|
||||
if($pointForInsert < 0)
|
||||
{
|
||||
if(!$this->user->isMember())
|
||||
|
|
@ -1195,7 +1195,7 @@ class boardView extends board
|
|||
throw new Rhymix\Framework\Exception('msg_admin_comment_no_modify');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// setup the comment variables on context
|
||||
Context::set('oSourceComment', CommentModel::getComment());
|
||||
Context::set('oComment', $oComment);
|
||||
|
|
@ -1256,7 +1256,7 @@ class boardView extends board
|
|||
throw new Rhymix\Framework\Exception('msg_admin_comment_no_delete');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if the comment is not existed, then back to the board content page
|
||||
if(!$oComment->isExists() )
|
||||
{
|
||||
|
|
@ -1321,7 +1321,7 @@ class boardView extends board
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$document_srl = Context::get('document_srl');
|
||||
if(!$document_srl)
|
||||
{
|
||||
|
|
@ -1333,7 +1333,7 @@ class boardView extends board
|
|||
{
|
||||
return $updatelog;
|
||||
}
|
||||
|
||||
|
||||
Context::set('total_count', $updatelog->page_navigation->total_count);
|
||||
Context::set('total_page', $updatelog->page_navigation->total_page);
|
||||
Context::set('page', $updatelog->page);
|
||||
|
|
@ -1440,7 +1440,7 @@ class boardView extends board
|
|||
Context::set('blame_member_info', $blame_member_infos);
|
||||
$this->setTemplateFile('vote_log');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Default 404 Handler.
|
||||
*/
|
||||
|
|
@ -1451,7 +1451,7 @@ class boardView extends board
|
|||
|
||||
/**
|
||||
* Display an error page.
|
||||
*
|
||||
*
|
||||
* @param string $msg_code
|
||||
* @param int $http_code
|
||||
* @return void
|
||||
|
|
@ -1470,9 +1470,9 @@ class boardView extends board
|
|||
|
||||
/**
|
||||
* Display an alert window on top of the page.
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
*
|
||||
* @param string $msg_code
|
||||
* @param int $http_code
|
||||
* @return void
|
||||
|
|
|
|||
|
|
@ -1,138 +1,138 @@
|
|||
<?php
|
||||
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
||||
|
||||
/**
|
||||
* @class boardWAP
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* @brief board module WAP class
|
||||
**/
|
||||
|
||||
class boardWAP extends board
|
||||
{
|
||||
/**
|
||||
* @brief wap procedure method
|
||||
**/
|
||||
function procWAP(&$oMobile)
|
||||
{
|
||||
// check grant
|
||||
if(!$this->grant->list || $this->module_info->consultation == 'Y')
|
||||
{
|
||||
return $oMobile->setContent(lang('msg_not_permitted'));
|
||||
}
|
||||
|
||||
// generate document model object
|
||||
$oDocumentModel = getModel('document');
|
||||
|
||||
// if the doument is existed
|
||||
$document_srl = Context::get('document_srl');
|
||||
if($document_srl)
|
||||
{
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if($oDocument->isExists())
|
||||
{
|
||||
// check the grant
|
||||
if(!$this->grant->view)
|
||||
{
|
||||
return $oMobile->setContent(lang('msg_not_permitted'));
|
||||
}
|
||||
|
||||
// setup the browser title
|
||||
Context::setBrowserTitle($oDocument->getTitleText());
|
||||
|
||||
// if the act is display comment list
|
||||
if($this->act=='dispBoardContentCommentList')
|
||||
{
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$output = $oCommentModel->getCommentList($oDocument->document_srl, 0, false, $oDocument->getCommentCount());
|
||||
|
||||
$content = '';
|
||||
if(count($output->data))
|
||||
{
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$oComment = new commentItem();
|
||||
$oComment->setAttribute($val);
|
||||
|
||||
if(!$oComment->isAccessible()) continue;
|
||||
|
||||
$content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
// setup mobile contents
|
||||
$oMobile->setContent( $content );
|
||||
|
||||
// setup upper URL
|
||||
$oMobile->setUpperUrl( getUrl('act',''), lang('cmd_go_upper') );
|
||||
|
||||
// display the document if the act is not display the comment list
|
||||
} else {
|
||||
|
||||
// setup contents (strip all html tags)
|
||||
$content = strip_tags(str_replace('<p>','<br> ',$oDocument->getContent(false,false,false)),'<br><b><i><u><em><small><strong><big>');
|
||||
|
||||
|
||||
// setup content information(include the comments link)
|
||||
$content = lang('replies').' : <a href="'.getUrl('act','dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content;
|
||||
$content = '<b>'.$oDocument->getNickName().'</b> ('.$oDocument->getRegdate("Y-m-d").")<br>\r\n".$content;
|
||||
|
||||
// setup mobile contents
|
||||
$oMobile->setContent( $content );
|
||||
|
||||
// setup upper URL
|
||||
$oMobile->setUpperUrl( getUrl('document_srl',''), lang('cmd_list') );
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// board index
|
||||
$args = new stdClass;
|
||||
$args->module_srl = $this->module_srl;
|
||||
$args->page = Context::get('page');;
|
||||
$args->list_count = 9;
|
||||
$args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
|
||||
$args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
|
||||
$output = $oDocumentModel->getDocumentList($args, $this->except_notice);
|
||||
$document_list = $output->data;
|
||||
$page_navigation = $output->page_navigation;
|
||||
|
||||
$childs = array();
|
||||
if($document_list && count($document_list))
|
||||
{
|
||||
foreach($document_list as $key => $val)
|
||||
{
|
||||
$href = getUrl('mid',$_GET['mid'],'document_srl',$val->document_srl);
|
||||
$obj = null;
|
||||
$obj['href'] = $val->getPermanentUrl();
|
||||
|
||||
$title = htmlspecialchars($val->getTitleText());
|
||||
if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']';
|
||||
$obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title;
|
||||
$childs[] = $obj;
|
||||
}
|
||||
$oMobile->setChilds($childs);
|
||||
}
|
||||
|
||||
$totalPage = $page_navigation->last_page;
|
||||
$page = (int)Context::get('page');
|
||||
if(!$page) $page = 1;
|
||||
|
||||
// next/prevUrl specification
|
||||
if($page > 1)
|
||||
{
|
||||
$oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', lang('cmd_prev'), $page-1, $totalPage));
|
||||
}
|
||||
|
||||
if($page < $totalPage)
|
||||
{
|
||||
$oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', lang('cmd_next'), $page+1, $totalPage));
|
||||
}
|
||||
|
||||
$oMobile->mobilePage = $page;
|
||||
$oMobile->totalPage = $totalPage;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
||||
|
||||
/**
|
||||
* @class boardWAP
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* @brief board module WAP class
|
||||
**/
|
||||
|
||||
class boardWAP extends board
|
||||
{
|
||||
/**
|
||||
* @brief wap procedure method
|
||||
**/
|
||||
function procWAP(&$oMobile)
|
||||
{
|
||||
// check grant
|
||||
if(!$this->grant->list || $this->module_info->consultation == 'Y')
|
||||
{
|
||||
return $oMobile->setContent(lang('msg_not_permitted'));
|
||||
}
|
||||
|
||||
// generate document model object
|
||||
$oDocumentModel = getModel('document');
|
||||
|
||||
// if the doument is existed
|
||||
$document_srl = Context::get('document_srl');
|
||||
if($document_srl)
|
||||
{
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if($oDocument->isExists())
|
||||
{
|
||||
// check the grant
|
||||
if(!$this->grant->view)
|
||||
{
|
||||
return $oMobile->setContent(lang('msg_not_permitted'));
|
||||
}
|
||||
|
||||
// setup the browser title
|
||||
Context::setBrowserTitle($oDocument->getTitleText());
|
||||
|
||||
// if the act is display comment list
|
||||
if($this->act=='dispBoardContentCommentList')
|
||||
{
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$output = $oCommentModel->getCommentList($oDocument->document_srl, 0, false, $oDocument->getCommentCount());
|
||||
|
||||
$content = '';
|
||||
if(count($output->data))
|
||||
{
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$oComment = new commentItem();
|
||||
$oComment->setAttribute($val);
|
||||
|
||||
if(!$oComment->isAccessible()) continue;
|
||||
|
||||
$content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
// setup mobile contents
|
||||
$oMobile->setContent( $content );
|
||||
|
||||
// setup upper URL
|
||||
$oMobile->setUpperUrl( getUrl('act',''), lang('cmd_go_upper') );
|
||||
|
||||
// display the document if the act is not display the comment list
|
||||
} else {
|
||||
|
||||
// setup contents (strip all html tags)
|
||||
$content = strip_tags(str_replace('<p>','<br> ',$oDocument->getContent(false,false,false)),'<br><b><i><u><em><small><strong><big>');
|
||||
|
||||
|
||||
// setup content information(include the comments link)
|
||||
$content = lang('replies').' : <a href="'.getUrl('act','dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content;
|
||||
$content = '<b>'.$oDocument->getNickName().'</b> ('.$oDocument->getRegdate("Y-m-d").")<br>\r\n".$content;
|
||||
|
||||
// setup mobile contents
|
||||
$oMobile->setContent( $content );
|
||||
|
||||
// setup upper URL
|
||||
$oMobile->setUpperUrl( getUrl('document_srl',''), lang('cmd_list') );
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// board index
|
||||
$args = new stdClass;
|
||||
$args->module_srl = $this->module_srl;
|
||||
$args->page = Context::get('page');;
|
||||
$args->list_count = 9;
|
||||
$args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
|
||||
$args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
|
||||
$output = $oDocumentModel->getDocumentList($args, $this->except_notice);
|
||||
$document_list = $output->data;
|
||||
$page_navigation = $output->page_navigation;
|
||||
|
||||
$childs = array();
|
||||
if($document_list && count($document_list))
|
||||
{
|
||||
foreach($document_list as $key => $val)
|
||||
{
|
||||
$href = getUrl('mid',$_GET['mid'],'document_srl',$val->document_srl);
|
||||
$obj = null;
|
||||
$obj['href'] = $val->getPermanentUrl();
|
||||
|
||||
$title = htmlspecialchars($val->getTitleText());
|
||||
if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']';
|
||||
$obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title;
|
||||
$childs[] = $obj;
|
||||
}
|
||||
$oMobile->setChilds($childs);
|
||||
}
|
||||
|
||||
$totalPage = $page_navigation->last_page;
|
||||
$page = (int)Context::get('page');
|
||||
if(!$page) $page = 1;
|
||||
|
||||
// next/prevUrl specification
|
||||
if($page > 1)
|
||||
{
|
||||
$oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', lang('cmd_prev'), $page-1, $totalPage));
|
||||
}
|
||||
|
||||
if($page < $totalPage)
|
||||
{
|
||||
$oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', lang('cmd_next'), $page+1, $totalPage));
|
||||
}
|
||||
|
||||
$oMobile->mobilePage = $page;
|
||||
$oMobile->totalPage = $totalPage;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class CommentAdminController extends Comment
|
|||
|
||||
$deleted_count = 0;
|
||||
$module_infos = [];
|
||||
|
||||
|
||||
// Delete the comment posting
|
||||
for($i = 0; $i < $comment_count; $i++)
|
||||
{
|
||||
|
|
@ -230,13 +230,13 @@ class CommentAdminController extends Comment
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$module_srl = $comment->get('module_srl');
|
||||
if (!isset($module_infos[$module_srl]))
|
||||
{
|
||||
$module_infos[$module_srl] = ModuleModel::getModuleInfoByModuleSrl($module_srl)->comment_delete_message ?? '';
|
||||
}
|
||||
|
||||
|
||||
if($module_infos[$module_srl] === 'yes')
|
||||
{
|
||||
$output = $oCommentController->updateCommentByDelete($comment, true);
|
||||
|
|
@ -257,7 +257,7 @@ class CommentAdminController extends Comment
|
|||
{
|
||||
$output = $oCommentController->deleteComment($comment_srl, true, toBool($isTrash));
|
||||
}
|
||||
|
||||
|
||||
if(!$output->toBool() && $output->error !== -2)
|
||||
{
|
||||
$oDB->rollback();
|
||||
|
|
@ -276,7 +276,7 @@ class CommentAdminController extends Comment
|
|||
|
||||
$deleted_count++;
|
||||
}
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$msgCode = '';
|
||||
|
|
@ -357,7 +357,7 @@ class CommentAdminController extends Comment
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj->comment_srl = $oComment->get('comment_srl');
|
||||
$obj->module_srl = $oComment->get('module_srl');
|
||||
|
|
@ -482,7 +482,7 @@ class CommentAdminController extends Comment
|
|||
{
|
||||
$originObject = (object) $originObject;
|
||||
}
|
||||
|
||||
|
||||
$oCommentController = getController('comment');
|
||||
$oCommentModel = getModel('comment');
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class CommentAdminView extends Comment
|
|||
}
|
||||
*/
|
||||
|
||||
// get a list by using comment->getCommentList.
|
||||
// get a list by using comment->getCommentList.
|
||||
$oCommentModel = getModel('comment');
|
||||
$secretNameList = $oCommentModel->getSecretNameList();
|
||||
$output = $oCommentModel->getTotalCommentList($args);
|
||||
|
|
@ -89,7 +89,7 @@ class CommentAdminView extends Comment
|
|||
}
|
||||
}
|
||||
Context::set('module_list', $module_list);
|
||||
|
||||
|
||||
// Get anonymous nicknames
|
||||
$anonymous_member_srls = array();
|
||||
foreach($output->data as $val)
|
||||
|
|
@ -114,11 +114,11 @@ class CommentAdminView extends Comment
|
|||
}
|
||||
}
|
||||
Context::set('member_nick_name', $member_nick_neme);
|
||||
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('search_target', 'search_keyword');
|
||||
|
||||
// set the template
|
||||
// set the template
|
||||
$this->setTemplatePath($this->module_path . 'tpl');
|
||||
$this->setTemplateFile('comment_list');
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ class CommentAdminView extends Comment
|
|||
$args->list_count = 30; // /< the number of comment postings to appear on a single page
|
||||
$args->page_count = 10; // /< the number of pages to appear on the page navigation
|
||||
$args->order_type = 'desc'; // /< sorted value
|
||||
|
||||
|
||||
// select sort method
|
||||
$sort_index = Context::get('sort_index');
|
||||
if (!in_array($sort_index, array('declared_latest', 'declared_count', 'regdate')))
|
||||
|
|
@ -143,7 +143,7 @@ class CommentAdminView extends Comment
|
|||
$sort_index = 'declared_latest';
|
||||
}
|
||||
Context::set('sort_index', $sort_index);
|
||||
|
||||
|
||||
// get latest declared list
|
||||
if ($sort_index === 'declared_latest')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class Comment extends ModuleObject
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
|
|
@ -85,7 +85,7 @@ class Comment extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
|
|
@ -95,7 +95,7 @@ class Comment extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ class Comment extends ModuleObject
|
|||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleController = getController('module');
|
||||
|
||||
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
if(!ModuleModel::getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
|
||||
{
|
||||
|
|
@ -128,7 +128,7 @@ class Comment extends ModuleObject
|
|||
$oDB->addIndex("comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE);
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
|
||||
|
|
@ -144,13 +144,13 @@ class Comment extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex('comments', 'idx_parent_srl', array('parent_srl'));
|
||||
}
|
||||
|
||||
|
||||
// 2017.12.21 Add an index for nick_name
|
||||
if(!$oDB->isIndexExists('comments', 'idx_nick_name'))
|
||||
{
|
||||
$oDB->addIndex('comments', 'idx_nick_name', array('nick_name'));
|
||||
}
|
||||
|
||||
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
|
|
@ -168,7 +168,7 @@ class Comment extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class CommentController extends Comment
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('failed_voted_canceled');
|
||||
}
|
||||
|
||||
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ class CommentController extends Comment
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('failed_blamed_canceled');
|
||||
}
|
||||
|
||||
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, $point > 0 ? 'failed_voted_canceled' : 'failed_blamed_canceled');
|
||||
}
|
||||
|
||||
|
||||
// Check if the current user has voted previously.
|
||||
$args = new stdClass;
|
||||
$args->comment_srl = $comment_srl;
|
||||
|
|
@ -243,10 +243,10 @@ class CommentController extends Comment
|
|||
|
||||
//session reset
|
||||
unset($_SESSION['voted_comment'][$comment_srl]);
|
||||
|
||||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('comment.updateVotedCountCancel', 'after', $trigger_obj);
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -276,7 +276,7 @@ class CommentController extends Comment
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// if an user select message from options, message would be the option.
|
||||
$message_option = strval(Context::get('message_option'));
|
||||
$improper_comment_reasons = lang('improper_comment_reasons');
|
||||
|
|
@ -460,7 +460,7 @@ class CommentController extends Comment
|
|||
|
||||
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
|
||||
unset($obj->manual_member_info);
|
||||
|
||||
|
||||
// Sanitize variables
|
||||
$obj->comment_srl = intval($obj->comment_srl);
|
||||
$obj->module_srl = intval($obj->module_srl);
|
||||
|
|
@ -468,7 +468,7 @@ class CommentController extends Comment
|
|||
$obj->parent_srl = intval($obj->parent_srl);
|
||||
|
||||
$obj->uploaded_count = FileModel::getFilesCount($obj->comment_srl);
|
||||
|
||||
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -537,7 +537,7 @@ class CommentController extends Comment
|
|||
{
|
||||
$obj->comment_srl = getNextSequence();
|
||||
}
|
||||
elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl))
|
||||
elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
|
@ -553,13 +553,13 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_empty_content');
|
||||
}
|
||||
|
||||
|
||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||
if(!$manual_inserted || isset($obj->allow_html) || isset($obj->use_html))
|
||||
{
|
||||
$obj->content = getModel('editor')->converter($obj, 'comment');
|
||||
}
|
||||
|
||||
|
||||
if(!$obj->regdate)
|
||||
{
|
||||
$obj->regdate = date("YmdHis");
|
||||
|
|
@ -659,7 +659,7 @@ class CommentController extends Comment
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// create the controller object of the document
|
||||
$oDocumentController = getController('document');
|
||||
|
||||
|
|
@ -684,7 +684,7 @@ class CommentController extends Comment
|
|||
{
|
||||
$obj->updated_file_count = 0;
|
||||
}
|
||||
|
||||
|
||||
// call a trigger(after)
|
||||
ModuleHandler::triggerCall('comment.insertComment', 'after', $obj);
|
||||
|
||||
|
|
@ -722,8 +722,8 @@ class CommentController extends Comment
|
|||
|
||||
/**
|
||||
* Send email to module's admins after a new comment was interted successfully
|
||||
* if Comments Approval System is used
|
||||
* @param object $obj
|
||||
* if Comments Approval System is used
|
||||
* @param object $obj
|
||||
* @return void
|
||||
*/
|
||||
function sendEmailToAdminAfterInsertComment($obj)
|
||||
|
|
@ -836,7 +836,7 @@ class CommentController extends Comment
|
|||
|
||||
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
|
||||
unset($obj->manual_member_info);
|
||||
|
||||
|
||||
// Sanitize variables
|
||||
$obj->comment_srl = intval($obj->comment_srl);
|
||||
$obj->module_srl = intval($obj->module_srl);
|
||||
|
|
@ -844,7 +844,7 @@ class CommentController extends Comment
|
|||
$obj->parent_srl = intval($obj->parent_srl);
|
||||
|
||||
$obj->uploaded_count = FileModel::getFilesCount($obj->comment_srl);
|
||||
|
||||
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -874,7 +874,7 @@ class CommentController extends Comment
|
|||
$obj->password = MemberModel::hashPassword($obj->password);
|
||||
}
|
||||
|
||||
if($obj->homepage)
|
||||
if($obj->homepage)
|
||||
{
|
||||
$obj->homepage = escape($obj->homepage);
|
||||
if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage))
|
||||
|
|
@ -919,13 +919,13 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_empty_content');
|
||||
}
|
||||
|
||||
|
||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||
if(!$manual_updated || isset($obj->allow_html) || isset($obj->use_html))
|
||||
{
|
||||
$obj->content = getModel('editor')->converter($obj, 'comment');
|
||||
}
|
||||
|
||||
|
||||
// remove iframe and script if not a top administrator on the session
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
|
|
@ -983,7 +983,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
|
||||
// check if comment exists and permission is granted
|
||||
$comment = CommentModel::getComment($obj->comment_srl);
|
||||
if(!$comment->isExists())
|
||||
|
|
@ -994,7 +994,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
||||
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -1017,7 +1017,7 @@ class CommentController extends Comment
|
|||
// Begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
// Update
|
||||
$obj->member_srl = 0;
|
||||
unset($obj->last_update);
|
||||
|
|
@ -1109,7 +1109,7 @@ class CommentController extends Comment
|
|||
{
|
||||
// check if comment already exists
|
||||
$comment = CommentModel::getComment($comment_srl);
|
||||
|
||||
|
||||
if(!$comment->isExists())
|
||||
{
|
||||
return new BaseObject(-2, 'msg_not_founded');
|
||||
|
|
@ -1231,8 +1231,8 @@ class CommentController extends Comment
|
|||
{
|
||||
$this->_deleteDeclaredComments($args);
|
||||
$this->_deleteVotedComments($args);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->upload_target_srl = $comment_srl;
|
||||
|
|
@ -1268,10 +1268,10 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$module_info = ModuleModel::getModuleInfo($oComment->get('module_srl'));
|
||||
|
||||
|
||||
if ($module_info->protect_admin_content_delete !== 'N' && $logged_info->is_admin !== 'Y')
|
||||
{
|
||||
$member_info = MemberModel::getMemberInfo($oComment->get('member_srl'));
|
||||
|
|
@ -1608,15 +1608,15 @@ class CommentController extends Comment
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$declared_count = ($output->data->declared_count) ? $output->data->declared_count : 0;
|
||||
$declare_message = trim(htmlspecialchars($declare_message));
|
||||
|
||||
|
||||
$trigger_obj = new stdClass();
|
||||
$trigger_obj->comment_srl = $comment_srl;
|
||||
$trigger_obj->declared_count = $declared_count;
|
||||
$trigger_obj->declare_message = $declare_message;
|
||||
|
||||
|
||||
// Call a trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'before', $trigger_obj);
|
||||
if(!$trigger_output->toBool())
|
||||
|
|
@ -1636,7 +1636,7 @@ class CommentController extends Comment
|
|||
|
||||
// Get currently logged in user.
|
||||
$member_srl = intval($this->user->member_srl);
|
||||
|
||||
|
||||
// if the comment author is a member
|
||||
if($oComment->get('member_srl'))
|
||||
{
|
||||
|
|
@ -1665,12 +1665,12 @@ class CommentController extends Comment
|
|||
$_SESSION['declared_comment'][$comment_srl] = FALSE;
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
|
||||
// Fill in remaining information for logging.
|
||||
$args->member_srl = $member_srl;
|
||||
$args->ipaddress = \RX_CLIENT_IP;
|
||||
$args->declare_message = $declare_message;
|
||||
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
|
@ -1757,7 +1757,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'failed_declared_cancel');
|
||||
}
|
||||
|
||||
|
||||
// Get the original document
|
||||
$oComment = CommentModel::getComment($comment_srl);
|
||||
|
||||
|
|
@ -1797,7 +1797,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
if ($declared_count > 1)
|
||||
{
|
||||
$output = executeQuery('comment.updateDeclaredCommentCancel', $args);
|
||||
|
|
@ -1811,14 +1811,14 @@ class CommentController extends Comment
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$output = executeQuery('comment.deleteDeclaredCommentLog', $args);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$message_targets = array();
|
||||
$module_srl = $oComment->get('module_srl');
|
||||
$comment_config = ModuleModel::getModulePartConfig('comment', $module_srl);
|
||||
|
|
@ -1898,19 +1898,19 @@ class CommentController extends Comment
|
|||
foreach ($target_module_srl as $srl)
|
||||
{
|
||||
if (!$srl) continue;
|
||||
|
||||
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$module_grant = ModuleModel::getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$module_srl[] = $srl;
|
||||
}
|
||||
|
||||
|
|
@ -2020,19 +2020,19 @@ class CommentController extends Comment
|
|||
|
||||
$this->add('comment_list', $commentList);
|
||||
}
|
||||
|
||||
|
||||
function triggerMoveDocument($obj)
|
||||
{
|
||||
executeQuery('comment.updateCommentModule', $obj);
|
||||
executeQuery('comment.updateCommentListModule', $obj);
|
||||
}
|
||||
|
||||
|
||||
function triggerAddCopyDocument(&$obj)
|
||||
{
|
||||
$args = new stdClass;
|
||||
$args->document_srls = $obj->source->document_srl;
|
||||
$comment_list = executeQueryArray('comment.getCommentsByDocumentSrls', $args)->data;
|
||||
|
||||
|
||||
$copied_comments = array();
|
||||
foreach($comment_list as $comment)
|
||||
{
|
||||
|
|
@ -2041,24 +2041,24 @@ class CommentController extends Comment
|
|||
$copy->module_srl = $obj->copied->module_srl;
|
||||
$copy->document_srl = $obj->copied->document_srl;
|
||||
$copy->parent_srl = $comment->parent_srl ? $copied_comments[$comment->parent_srl] : 0;
|
||||
|
||||
|
||||
// call a trigger (add)
|
||||
$args = new stdClass;
|
||||
$args->source = $comment;
|
||||
$args->copied = $copy;
|
||||
ModuleHandler::triggerCall('comment.copyCommentByDocument', 'add', $args);
|
||||
|
||||
|
||||
// insert a copied comment
|
||||
$this->insertComment($copy, true);
|
||||
|
||||
|
||||
$copied_comments[$comment->comment_srl] = $copy->comment_srl;
|
||||
}
|
||||
|
||||
|
||||
// update
|
||||
$obj->copied->last_updater = $copy->nick_name;
|
||||
$obj->copied->comment_count = count($copied_comments);
|
||||
}
|
||||
|
||||
|
||||
function triggerCopyModule(&$obj)
|
||||
{
|
||||
$commentConfig = ModuleModel::getModulePartConfig('comment', $obj->originModuleSrl);
|
||||
|
|
|
|||
|
|
@ -93,24 +93,24 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return (bool) ($this->comment_srl);
|
||||
}
|
||||
|
||||
|
||||
function isGranted()
|
||||
{
|
||||
if(!$this->isExists())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (isset($_SESSION['granted_comment'][$this->comment_srl]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if ($this->grant_cache !== null)
|
||||
{
|
||||
return $this->grant_cache;
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if (!$logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -124,30 +124,30 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return $this->grant_cache = true;
|
||||
}
|
||||
|
||||
|
||||
$grant = ModuleModel::getGrant(ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl')), $logged_info);
|
||||
if ($grant->manager)
|
||||
{
|
||||
return $this->grant_cache = true;
|
||||
}
|
||||
|
||||
|
||||
return $this->grant_cache = false;
|
||||
}
|
||||
|
||||
|
||||
function setGrant()
|
||||
{
|
||||
$this->grant_cache = true;
|
||||
}
|
||||
|
||||
|
||||
function setGrantForSession()
|
||||
{
|
||||
$_SESSION['granted_comment'][$this->comment_srl] = true;
|
||||
$this->setGrant();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the status code.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus()
|
||||
|
|
@ -170,7 +170,7 @@ class CommentItem extends BaseObject
|
|||
|
||||
/**
|
||||
* Return the status in human-readable text.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatusText()
|
||||
|
|
@ -193,7 +193,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ($strict)
|
||||
{
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl'));
|
||||
|
|
@ -207,34 +207,34 @@ class CommentItem extends BaseObject
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($_SESSION['accessible'][$this->comment_srl]) && $_SESSION['accessible'][$this->comment_srl] === $this->get('last_update'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if ($this->get('status') == RX_STATUS_PUBLIC && $this->get('is_secret') !== 'Y')
|
||||
{
|
||||
$this->setAccessible();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if ($this->isGranted())
|
||||
{
|
||||
$this->setAccessible();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
$oDocument = DocumentModel::getDocument($this->get('document_srl'));
|
||||
if ($oDocument->isGranted())
|
||||
{
|
||||
$this->setAccessible();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function setAccessible()
|
||||
{
|
||||
if(Context::getSessionStatus())
|
||||
|
|
@ -242,27 +242,27 @@ class CommentItem extends BaseObject
|
|||
$_SESSION['accessible'][$this->comment_srl] = $this->get('last_update');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function isEditable()
|
||||
{
|
||||
return !$this->get('member_srl') || $this->isGranted();
|
||||
}
|
||||
|
||||
|
||||
function isSecret()
|
||||
{
|
||||
return $this->get('status') == RX_STATUS_SECRET || $this->get('is_secret') == 'Y';
|
||||
}
|
||||
|
||||
|
||||
function isDeleted()
|
||||
{
|
||||
return $this->get('status') == RX_STATUS_DELETED || $this->get('status') == RX_STATUS_DELETED_BY_ADMIN;
|
||||
}
|
||||
|
||||
|
||||
function isDeletedByAdmin()
|
||||
{
|
||||
return $this->get('status') == RX_STATUS_DELETED_BY_ADMIN;
|
||||
}
|
||||
|
||||
|
||||
function useNotify()
|
||||
{
|
||||
return $this->get('notify_message') == 'Y';
|
||||
|
|
@ -280,7 +280,7 @@ class CommentItem extends BaseObject
|
|||
return;
|
||||
}
|
||||
|
||||
// pass if the author is not logged-in user
|
||||
// pass if the author is not logged-in user
|
||||
if(!$this->get('member_srl'))
|
||||
{
|
||||
return;
|
||||
|
|
@ -293,7 +293,7 @@ class CommentItem extends BaseObject
|
|||
return;
|
||||
}
|
||||
|
||||
// get where the comment belongs to
|
||||
// get where the comment belongs to
|
||||
$oDocument = DocumentModel::getDocument($this->get('document_srl'));
|
||||
|
||||
// Variables
|
||||
|
|
@ -422,7 +422,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return $_SESSION['declared_comment'][$this->comment_srl];
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
if ($logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -439,7 +439,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return $_SESSION['declared_comment'][$this->comment_srl] = $declared_count;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -461,7 +461,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
$content = $this->get('content');
|
||||
}
|
||||
|
||||
|
||||
$content = trim(utf8_normalize_spaces(html_entity_decode(strip_tags($content))));
|
||||
if($strlen)
|
||||
{
|
||||
|
|
@ -492,7 +492,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
$content = $this->get('content');
|
||||
}
|
||||
|
||||
|
||||
if($strlen)
|
||||
{
|
||||
$content = trim(utf8_normalize_spaces(html_entity_decode(strip_tags($content))));
|
||||
|
|
@ -568,16 +568,16 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
// Remove tags
|
||||
$content = strip_tags($this->getContent(false, false));
|
||||
|
||||
|
||||
// Convert temporarily html entity for truncate
|
||||
$content = html_entity_decode($content, ENT_QUOTES);
|
||||
|
||||
|
||||
// Replace all whitespaces to single space
|
||||
$content = utf8_trim(utf8_normalize_spaces($content));
|
||||
|
||||
|
||||
// Truncate string
|
||||
$content = cut_str($content, $str_size, $tail);
|
||||
|
||||
|
||||
return escape($content);
|
||||
}
|
||||
|
||||
|
|
@ -633,7 +633,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return $this->get('uploaded_count') ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -643,12 +643,12 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->get('uploaded_count'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$file_list = FileModel::getFiles($this->comment_srl, array(), 'file_srl', TRUE);
|
||||
return $file_list;
|
||||
}
|
||||
|
|
@ -755,7 +755,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
$config->thumbnail_quality = 75;
|
||||
}
|
||||
|
||||
|
||||
// If signiture height setting is omitted, create a square
|
||||
if(!is_int($width))
|
||||
{
|
||||
|
|
@ -799,7 +799,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return $thumbnail_url . '?' . date('YmdHis', filemtime($thumbnail_file));
|
||||
}
|
||||
|
||||
|
||||
// return false if neigher attached file nor image;
|
||||
if(!$this->get('uploaded_count') && !preg_match("!<img!is", $this->get('content')))
|
||||
{
|
||||
|
|
@ -846,7 +846,7 @@ class CommentItem extends BaseObject
|
|||
}
|
||||
}
|
||||
|
||||
// get an image file from the doc content if no file attached.
|
||||
// get an image file from the doc content if no file attached.
|
||||
if(!$source_file && $config->thumbnail_target !== 'attachment')
|
||||
{
|
||||
$external_image_min_width = min(100, round($trigger_obj->width * 0.3));
|
||||
|
|
|
|||
|
|
@ -375,9 +375,9 @@ class CommentModel extends Comment
|
|||
|
||||
/**
|
||||
* Get the module info without duplication
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getDistinctModules()
|
||||
|
|
@ -573,7 +573,7 @@ class CommentModel extends Comment
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
// If an alternate output is set, use it instead of running the default queries
|
||||
if (isset($args->use_alternate_output) && $args->use_alternate_output instanceof BaseObject)
|
||||
{
|
||||
|
|
@ -587,7 +587,7 @@ class CommentModel extends Comment
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// insert data into CommentPageList table if the number of results is different from stored comments
|
||||
if(!$output->data)
|
||||
{
|
||||
|
|
@ -605,7 +605,7 @@ class CommentModel extends Comment
|
|||
ModuleHandler::triggerCall('comment.getCommentList', 'after', $output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find out which page a comment is on
|
||||
* @param int $document_srl
|
||||
|
|
@ -623,14 +623,14 @@ class CommentModel extends Comment
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// return if no comment exists
|
||||
$document_comment_count = $oDocument->getCommentCount();
|
||||
if($document_comment_count < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Get the comment count per page
|
||||
if(!$count)
|
||||
{
|
||||
|
|
@ -642,14 +642,14 @@ class CommentModel extends Comment
|
|||
{
|
||||
$comment_count = $count;
|
||||
}
|
||||
|
||||
|
||||
// Get the number of pages
|
||||
$total_pages = max(1, ceil($document_comment_count / $comment_count));
|
||||
if ($total_pages == 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
// Find out which page the comment is on
|
||||
$args = new stdClass();
|
||||
$args->document_srl = $document_srl;
|
||||
|
|
@ -961,7 +961,7 @@ class CommentModel extends Comment
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// If an alternate output is set, use it instead of running the default queries
|
||||
if (isset($args->use_alternate_output) && $args->use_alternate_output instanceof BaseObject)
|
||||
{
|
||||
|
|
@ -972,7 +972,7 @@ class CommentModel extends Comment
|
|||
{
|
||||
$output = executeQueryArray($query_id, $args, $columnList);
|
||||
}
|
||||
|
||||
|
||||
// return when no result or error occurance
|
||||
if(!$output->toBool() || !count($output->data))
|
||||
{
|
||||
|
|
@ -1132,7 +1132,7 @@ class CommentModel extends Comment
|
|||
|
||||
return $comment_config;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of voting member
|
||||
* @return void
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class communicationAdminController extends communication
|
|||
$output = $oModuleController->insertModuleConfig('communication', $args);
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispCommunicationAdminConfig');
|
||||
|
||||
|
||||
return $this->setRedirectUrl($returnUrl, $output);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class communicationAdminModel extends communication
|
|||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir);
|
||||
Context::set('skin_info', $skin_info);
|
||||
Context::set('communication_config', CommunicationModel::getConfig());
|
||||
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('skin_info.colorset..title', 'skin_info.colorset..name');
|
||||
$security->encodeHTML('skin_info.colorset..name');
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
||||
|
||||
/**
|
||||
* @class communication
|
||||
* @class communication
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* communication module of the high class
|
||||
*/
|
||||
|
|
@ -22,7 +22,7 @@ class communication extends ModuleObject
|
|||
function moduleInstall()
|
||||
{
|
||||
$oModuleController = getController('module');
|
||||
|
||||
|
||||
foreach($this->triggers as $trigger)
|
||||
{
|
||||
$oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
|
||||
|
|
@ -39,7 +39,7 @@ class communication extends ModuleObject
|
|||
function checkUpdate()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
|
||||
foreach($this->triggers as $trigger)
|
||||
{
|
||||
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
|
||||
|
|
@ -65,7 +65,7 @@ class communication extends ModuleObject
|
|||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ class communication extends ModuleObject
|
|||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController = getController('module');
|
||||
|
||||
|
||||
foreach($this->triggers as $trigger)
|
||||
{
|
||||
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
|
||||
|
|
@ -106,7 +106,7 @@ class communication extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class communicationController extends communication
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
MemberController::clearMemberCache($args->member_srl);
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispCommunicationMessages', 'message_type', Context::get('message_type'));
|
||||
|
|
@ -82,7 +82,7 @@ class communicationController extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_content_is_null');
|
||||
}
|
||||
|
||||
|
||||
$temp_srl = intval(Context::get('temp_srl')) ?: null;
|
||||
if($temp_srl && !$_SESSION['upload_info'][$temp_srl]->enabled)
|
||||
{
|
||||
|
|
@ -241,7 +241,7 @@ class communicationController extends communication
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// update attached files
|
||||
if ($temp_srl)
|
||||
{
|
||||
|
|
@ -251,10 +251,10 @@ class communicationController extends communication
|
|||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('communication.sendMessage', 'after', $trigger_obj);
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
// create a flag that message is sent (in file format)
|
||||
|
||||
// create a flag that message is sent (in file format)
|
||||
$this->updateFlagFile($receiver_srl);
|
||||
|
||||
return new BaseObject(0, 'success_sended');
|
||||
|
|
@ -395,7 +395,7 @@ class communicationController extends communication
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Delete attachment, only if related message has also been deleted
|
||||
$related = $message->related_srl ? $oCommunicationModel->getSelectedMessage($message->related_srl) : true;
|
||||
if (!$related)
|
||||
|
|
@ -404,7 +404,7 @@ class communicationController extends communication
|
|||
$oFileController->deleteFiles($message->message_srl);
|
||||
$oFileController->deleteFiles($message->related_srl);
|
||||
}
|
||||
|
||||
|
||||
$this->updateFlagFile($member_srl);
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
|
@ -467,7 +467,7 @@ class communicationController extends communication
|
|||
// Organize variables
|
||||
$args = new stdClass();
|
||||
$args->message_srls = implode(',', $target);
|
||||
|
||||
|
||||
if ($message_type === 'N')
|
||||
{
|
||||
$args->message_type = 'R';
|
||||
|
|
@ -476,7 +476,7 @@ class communicationController extends communication
|
|||
{
|
||||
$args->message_type = $message_type;
|
||||
}
|
||||
|
||||
|
||||
if($message_type == 'S')
|
||||
{
|
||||
$args->sender_srl = $member_srl;
|
||||
|
|
@ -503,14 +503,14 @@ class communicationController extends communication
|
|||
unset($related[$item->message_srl]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Delete
|
||||
$output = executeQuery('communication.deleteMessages', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Delete attachment, only if related message has also been deleted
|
||||
$oFileController = getController('file');
|
||||
foreach ($related as $message_srl => $related_srl)
|
||||
|
|
@ -518,7 +518,7 @@ class communicationController extends communication
|
|||
$oFileController->deleteFiles($message_srl);
|
||||
$oFileController->deleteFiles($related_srl);
|
||||
}
|
||||
|
||||
|
||||
$this->updateFlagFile($member_srl);
|
||||
$this->setMessage('success_deleted');
|
||||
|
||||
|
|
@ -549,7 +549,7 @@ class communicationController extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_no_self_friend');
|
||||
}
|
||||
|
||||
|
||||
// Check duplicate friend
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
|
|
@ -567,7 +567,7 @@ class communicationController extends communication
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
// Variable
|
||||
$args->friend_srl = getNextSequence();
|
||||
$args->list_order = $args->friend_srl * -1;
|
||||
|
|
@ -579,7 +579,7 @@ class communicationController extends communication
|
|||
|
||||
// Call trigger (after)
|
||||
$trigger_output = ModuleHandler::triggerCall('communication.addFriend', 'after', $args);
|
||||
|
||||
|
||||
$this->add('member_srl', $target_srl);
|
||||
$this->setMessage('success_registed');
|
||||
|
||||
|
|
@ -663,7 +663,7 @@ class communicationController extends communication
|
|||
}
|
||||
|
||||
/**
|
||||
* Delete a friend
|
||||
* Delete a friend
|
||||
* @return void|Object (success : void, fail : Object)
|
||||
*/
|
||||
function procCommunicationDeleteFriend()
|
||||
|
|
@ -693,14 +693,14 @@ class communicationController extends communication
|
|||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->friend_srl_list = $friend_srl_list;
|
||||
|
||||
|
||||
// Call trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('communication.deleteFriend', 'before', $args);
|
||||
if(!$trigger_output->toBool())
|
||||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
// Delete
|
||||
$output = executeQuery('communication.deleteFriend', $args);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -710,7 +710,7 @@ class communicationController extends communication
|
|||
|
||||
// Call trigger (after)
|
||||
$trigger_output = ModuleHandler::triggerCall('communication.deleteFriend', 'after', $args);
|
||||
|
||||
|
||||
$this->setMessage('success_deleted');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispCommunicationFriend');
|
||||
|
|
@ -855,7 +855,7 @@ class communicationController extends communication
|
|||
|
||||
/**
|
||||
* set a message status to be 'already read'
|
||||
* @param int $message_srl
|
||||
* @param int $message_srl
|
||||
* @return Object
|
||||
*/
|
||||
function setMessageReaded($message_srl)
|
||||
|
|
@ -864,14 +864,14 @@ class communicationController extends communication
|
|||
$args->message_srl = $message_srl;
|
||||
$args->related_srl = $message_srl;
|
||||
$output = executeQuery('communication.setMessageReaded', $args);
|
||||
|
||||
|
||||
// Update flag file
|
||||
$logged_info = Context::get('logged_info');
|
||||
$this->updateFlagFile($logged_info->member_srl);
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update flag file
|
||||
* @param int $member_srl
|
||||
|
|
@ -897,12 +897,12 @@ class communicationController extends communication
|
|||
// Add menus on the member login information
|
||||
$config = getModel('communication')->getConfig();
|
||||
$oMemberController = getController('member');
|
||||
|
||||
|
||||
if($config->enable_message == 'Y')
|
||||
{
|
||||
$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
|
||||
}
|
||||
|
||||
|
||||
if($config->enable_friend == 'Y')
|
||||
{
|
||||
$oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
|
||||
|
|
@ -921,10 +921,10 @@ class communicationController extends communication
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$oCommunicationModel = getModel('communication');
|
||||
$config = $oCommunicationModel->getConfig();
|
||||
|
||||
|
||||
if($config->enable_message == 'N' && $config->enable_friend == 'N')
|
||||
{
|
||||
return;
|
||||
|
|
@ -933,12 +933,12 @@ class communicationController extends communication
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$mid = Context::get('cur_mid');
|
||||
$member_srl = Context::get('target_srl');
|
||||
$logged_info = Context::get('logged_info');
|
||||
$oMemberController = getController('member');
|
||||
|
||||
|
||||
// Add a feature to display own message box.
|
||||
if($logged_info->member_srl == $member_srl)
|
||||
{
|
||||
|
|
@ -947,7 +947,7 @@ class communicationController extends communication
|
|||
{
|
||||
$oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationMessages'), 'cmd_view_message_box', '', 'self');
|
||||
}
|
||||
|
||||
|
||||
// Display a list of friends
|
||||
if($config->enable_friend == 'Y')
|
||||
{
|
||||
|
|
@ -970,7 +970,7 @@ class communicationController extends communication
|
|||
{
|
||||
$oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup');
|
||||
}
|
||||
|
||||
|
||||
// Add a menu for listing friends (if a friend is new)
|
||||
if($config->enable_friend == 'Y' && !$oCommunicationModel->isAddedFriend($member_srl))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class communicationMobile extends communicationView
|
|||
$this->module_info->mlayout_srl = $this->config->mlayout_srl;
|
||||
$this->setLayoutPath($layout_info->path);
|
||||
}
|
||||
|
||||
|
||||
$this->setTemplatePath($template_path);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class communicationModel extends communication
|
|||
{
|
||||
$config = new stdClass();
|
||||
}
|
||||
|
||||
|
||||
$config->enable_message = $config->enable_message ?? 'Y';
|
||||
$config->enable_friend = $config->enable_friend ?? 'Y';
|
||||
$config->enable_attachment = $config->enable_attachment ?? 'N';
|
||||
|
|
@ -42,12 +42,12 @@ class communicationModel extends communication
|
|||
$config->mskin = $config->mskin ?? 'default';
|
||||
$config->mcolorset = $config->mcolorset ?? 'white';
|
||||
$config->grant_send = $config->grant_send ?? array('default' => 'member');
|
||||
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get grant array for insert to database. table module_config's config field
|
||||
* @brief get grant array for insert to database. table module_config's config field
|
||||
* @param string $default
|
||||
* @param array $group
|
||||
* @return array
|
||||
|
|
@ -59,17 +59,17 @@ class communicationModel extends communication
|
|||
{
|
||||
$grant = array('default' => $default);
|
||||
}
|
||||
else if(is_array($group))
|
||||
else if(is_array($group))
|
||||
{
|
||||
$grant_group = array();
|
||||
foreach($group as $group_srl)
|
||||
{
|
||||
$grant_group[$group_srl] = true;
|
||||
}
|
||||
|
||||
|
||||
$grant = array('group' => $grant_group);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $grant;
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ class communicationModel extends communication
|
|||
public static function checkGrant($arrGrant)
|
||||
{
|
||||
if(!$arrGrant) return false;
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y') return true;
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ class communicationModel extends communication
|
|||
|
||||
$oCommunicationController = getController('communication');
|
||||
$oCommunicationController->setMessageReaded($message->message_srl);
|
||||
|
||||
|
||||
if (!$message->member_srl)
|
||||
{
|
||||
$message->member_srl = $message->sender_srl;
|
||||
|
|
@ -280,13 +280,13 @@ class communicationModel extends communication
|
|||
$message->user_name = $message->nick_name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of files attached to a message.
|
||||
*
|
||||
*
|
||||
* @param object $message
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -318,7 +318,7 @@ class communicationModel extends communication
|
|||
$args->page_count = 10;
|
||||
|
||||
$output = executeQuery('communication.getFriends', $args, $columnList);
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -334,7 +334,7 @@ class communicationModel extends communication
|
|||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->target_srl = $member_srl;
|
||||
|
||||
|
||||
$output = executeQuery('communication.isAddedFriend', $args);
|
||||
|
||||
return $output->data->count;
|
||||
|
|
@ -354,7 +354,7 @@ class communicationModel extends communication
|
|||
$args->friend_group_srl = $friend_group_srl;
|
||||
|
||||
$output = executeQuery('communication.getFriendGroup', $args);
|
||||
|
||||
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
|
|
@ -372,15 +372,15 @@ class communicationModel extends communication
|
|||
$friend_group_list = array();
|
||||
foreach ($output->data as $item)
|
||||
{
|
||||
$friend_group_list[$item->friend_group_srl] = $item;
|
||||
$friend_group_list[$item->friend_group_srl] = $item;
|
||||
}
|
||||
return $friend_group_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* check whether to be added in the friend list
|
||||
* @param int $target_srl
|
||||
* @return boolean (true : friend, false : not friend)
|
||||
* @param int $target_srl
|
||||
* @return boolean (true : friend, false : not friend)
|
||||
*/
|
||||
public static function isFriend($target_srl)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class communicationView extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -117,7 +117,7 @@ class communicationView extends communication
|
|||
stripEmbedTagForAdmin($message->content, $message->sender_srl);
|
||||
Context::set('message', $message);
|
||||
Context::set('message_files', CommunicationModel::getMessageFiles($message));
|
||||
|
||||
|
||||
if(Mobile::isFromMobilePhone() && file_exists($this->getTemplatePath() . 'read_message.html'))
|
||||
{
|
||||
$template_filename = 'read_message';
|
||||
|
|
@ -132,7 +132,7 @@ class communicationView extends communication
|
|||
// Extract a list
|
||||
$columnList = array('message_srl', 'message_type', 'related_srl', 'readed', 'title', 'member.member_srl', 'member.nick_name', 'message.regdate', 'readed_date');
|
||||
$output = $oCommunicationModel->getMessages($message_type, $columnList);
|
||||
|
||||
|
||||
// set a template file
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
|
|
@ -159,7 +159,7 @@ class communicationView extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -200,13 +200,13 @@ class communicationView extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// Fix missing mid (it causes errors when uploading)
|
||||
if(!Context::get('mid'))
|
||||
{
|
||||
Context::set('mid', Context::get('site_module_info')->mid);
|
||||
}
|
||||
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -231,7 +231,7 @@ class communicationView extends communication
|
|||
|
||||
$oCommunicationModel = getModel('communication');
|
||||
$oMemberModel = getModel('member');
|
||||
|
||||
|
||||
// get message_srl of the original message if it is a reply
|
||||
$message_srl = Context::get('message_srl');
|
||||
if($message_srl)
|
||||
|
|
@ -292,13 +292,13 @@ class communicationView extends communication
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// Error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
}
|
||||
|
||||
|
||||
$oCommunicationModel = getModel('communication');
|
||||
|
||||
// get a group list
|
||||
|
|
@ -346,12 +346,12 @@ class communicationView extends communication
|
|||
{
|
||||
$this->setLayoutPath('./common/tpl/');
|
||||
$this->setLayoutFile("popup_layout");
|
||||
|
||||
|
||||
if($this->config->enable_friend == 'N')
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// error appears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -396,12 +396,12 @@ class communicationView extends communication
|
|||
{
|
||||
$this->setLayoutPath('./common/tpl/');
|
||||
$this->setLayoutFile("popup_layout");
|
||||
|
||||
|
||||
if($this->config->enable_friend == 'N')
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// error apprears if not logged-in
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class DocumentAdminController extends Document
|
|||
|
||||
$this->setMessage(sprintf(lang('msg_checked_document_is_deleted'), $document_count) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save the default settings of the document module
|
||||
* @return object
|
||||
|
|
@ -56,7 +56,7 @@ class DocumentAdminController extends Document
|
|||
$config->view_count_option = Context::get('view_count_option');
|
||||
$config->icons = Context::get('icons');
|
||||
$config->micons = Context::get('micons');
|
||||
|
||||
|
||||
// Get icon skin type
|
||||
$config->icons_type = 'gif';
|
||||
$config->micons_type = 'gif';
|
||||
|
|
@ -364,7 +364,7 @@ class DocumentAdminController extends Document
|
|||
$oDocumentController->moveDocumentToTrash($args);
|
||||
|
||||
$returnUrl = Context::get('success_return_url');
|
||||
if(!$returnUrl)
|
||||
if(!$returnUrl)
|
||||
{
|
||||
$arrUrl = parse_url(Context::get('cur_url'));
|
||||
$query = "";
|
||||
|
|
@ -424,7 +424,7 @@ class DocumentAdminController extends Document
|
|||
$trash_srl = Context::get('trash_srl');
|
||||
$this->restoreTrash($trash_srl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Move module of the documents
|
||||
* @param array $document_srl_list
|
||||
|
|
@ -443,17 +443,17 @@ class DocumentAdminController extends Document
|
|||
$document_srl_list = array_map('trim', explode(',', $document_srl_list));
|
||||
}
|
||||
$document_srl_list = array_map('intval', $document_srl_list);
|
||||
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj->document_srls = $document_srl_list;
|
||||
$obj->list_count = count($document_srl_list);
|
||||
$obj->document_list = executeQueryArray('document.getDocuments', $obj)->data;
|
||||
$obj->module_srl = $target_module_srl;
|
||||
$obj->category_srl = $target_category_srl;
|
||||
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('document.moveDocumentModule', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -461,10 +461,10 @@ class DocumentAdminController extends Document
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$origin_category = array();
|
||||
$oDocumentController = getController('document');
|
||||
|
||||
|
||||
foreach($obj->document_list as $document)
|
||||
{
|
||||
// if the target module is different
|
||||
|
|
@ -472,16 +472,16 @@ class DocumentAdminController extends Document
|
|||
{
|
||||
$oDocumentController->deleteDocumentAliasByDocument($document->document_srl);
|
||||
}
|
||||
|
||||
|
||||
// if the target category is different
|
||||
if($document->category_srl != $obj->category_srl && $document->category_srl)
|
||||
{
|
||||
$origin_category[$document->category_srl] = $document->module_srl;
|
||||
}
|
||||
|
||||
|
||||
$oDocumentController->insertDocumentUpdateLog($document);
|
||||
}
|
||||
|
||||
|
||||
// update documents
|
||||
$output = executeQuery('document.updateDocumentsModule', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -489,7 +489,7 @@ class DocumentAdminController extends Document
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// update extra vars
|
||||
$output = executeQuery('document.updateDocumentExtraVarsModule', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -497,10 +497,10 @@ class DocumentAdminController extends Document
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// call a trigger (after)
|
||||
ModuleHandler::triggerCall('document.moveDocumentModule', 'after', $obj);
|
||||
|
||||
|
||||
// update category count
|
||||
foreach($origin_category as $category_srl => $module_srl)
|
||||
{
|
||||
|
|
@ -510,15 +510,15 @@ class DocumentAdminController extends Document
|
|||
{
|
||||
$oDocumentController->updateCategoryCount($obj->module_srl, $obj->category_srl);
|
||||
}
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
|
||||
// remove from cache
|
||||
foreach($obj->document_list as $document)
|
||||
{
|
||||
DocumentController::clearDocumentCache($document->document_srl);
|
||||
}
|
||||
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
|
|
@ -540,17 +540,17 @@ class DocumentAdminController extends Document
|
|||
$document_srl_list = array_map('trim', explode(',', $document_srl_list));
|
||||
}
|
||||
$document_srl_list = array_map('intval', $document_srl_list);
|
||||
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj->document_srls = $document_srl_list;
|
||||
$obj->list_count = count($document_srl_list);
|
||||
$obj->document_list = executeQueryArray('document.getDocuments', $obj)->data;
|
||||
$obj->module_srl = $target_module_srl;
|
||||
$obj->category_srl = $target_category_srl;
|
||||
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('document.copyDocumentModule', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -558,10 +558,10 @@ class DocumentAdminController extends Document
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$oDocumentController = getController('document');
|
||||
$extra_vars_list = getModel('document')->getDocumentExtraVarsFromDB($document_srl_list)->data;
|
||||
|
||||
|
||||
$extra_vars = array();
|
||||
foreach($extra_vars_list as $extra)
|
||||
{
|
||||
|
|
@ -569,10 +569,10 @@ class DocumentAdminController extends Document
|
|||
{
|
||||
$extra_vars[$extra->document_srl] = array();
|
||||
}
|
||||
|
||||
|
||||
$extra_vars[$extra->document_srl][] = $extra;
|
||||
}
|
||||
|
||||
|
||||
$copied_srls = array();
|
||||
foreach($obj->document_list as $document)
|
||||
{
|
||||
|
|
@ -583,13 +583,13 @@ class DocumentAdminController extends Document
|
|||
$copy->comment_count = 0;
|
||||
$copy->trackback_count = 0;
|
||||
$copy->password_is_hashed = true;
|
||||
|
||||
|
||||
// call a trigger (add)
|
||||
$args = new stdClass;
|
||||
$args->source = $document;
|
||||
$args->copied = $copy;
|
||||
ModuleHandler::triggerCall('document.copyDocumentModule', 'add', $args);
|
||||
|
||||
|
||||
// insert a copied document
|
||||
$output = $oDocumentController->insertDocument($copy, true, true);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -597,7 +597,7 @@ class DocumentAdminController extends Document
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// insert copied extra vars of the document
|
||||
if(isset($extra_vars[$document->document_srl]))
|
||||
{
|
||||
|
|
@ -606,22 +606,22 @@ class DocumentAdminController extends Document
|
|||
$oDocumentController->insertDocumentExtraVar($copy->module_srl, $copy->document_srl, $extra->var_idx, $extra->value, $extra->eid, $extra->lang_code);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$copied_srls[$document->document_srl] = $copy->document_srl;
|
||||
}
|
||||
|
||||
|
||||
// call a trigger (after)
|
||||
$obj->copied_srls = $copied_srls;
|
||||
ModuleHandler::triggerCall('document.copyDocumentModule', 'after', $obj);
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
|
||||
// return copied document_srls
|
||||
$output = new BaseObject();
|
||||
$output->add('copied_srls', $copied_srls);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete all documents of the module
|
||||
* @param int $module_srl
|
||||
|
|
@ -633,23 +633,23 @@ class DocumentAdminController extends Document
|
|||
$args->list_count = 0;
|
||||
$args->module_srl = intval($module_srl);
|
||||
$document_list = executeQueryArray('document.getDocumentList', $args, array('document_srl'))->data;
|
||||
|
||||
|
||||
// delete documents
|
||||
$output = executeQuery('document.deleteModuleDocument', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// remove from cache
|
||||
foreach ($document_list as $document)
|
||||
{
|
||||
DocumentController::clearDocumentCache($document->document_srl);
|
||||
}
|
||||
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Restore document from trash module, called by trash module
|
||||
* This method is passived
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class DocumentAdminView extends Document
|
|||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // /< the number of posts to display on a single page
|
||||
$args->page_count = 5; // /< the number of pages that appear in the page navigation
|
||||
|
||||
|
||||
$args->search_target = Context::get('search_target'); // /< search (title, contents ...)
|
||||
$args->search_keyword = Context::get('search_keyword'); // /< keyword to search
|
||||
if ($args->search_target === 'member_srl')
|
||||
|
|
@ -56,7 +56,7 @@ class DocumentAdminView extends Document
|
|||
$args->sort_index = 'list_order'; // /< sorting value
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
$args->statusList = array($this->getConfigStatus('public'), $this->getConfigStatus('secret'), $this->getConfigStatus('temp'));
|
||||
|
||||
|
||||
// get a list
|
||||
$oDocumentModel = getModel('document');
|
||||
$columnList = array('document_srl', 'module_srl', 'category_srl', 'member_srl', 'title', 'nick_name', 'comment_count', 'trackback_count', 'readed_count', 'voted_count', 'blamed_count', 'regdate', 'ipaddress', 'status');
|
||||
|
|
@ -104,7 +104,7 @@ class DocumentAdminView extends Document
|
|||
}
|
||||
}
|
||||
Context::set('module_list', $module_list);
|
||||
|
||||
|
||||
// Get anonymous nicknames
|
||||
$anonymous_member_srls = array();
|
||||
$member_nick_name = array();
|
||||
|
|
@ -176,7 +176,7 @@ class DocumentAdminView extends Document
|
|||
$args->list_count = 20; // /< the number of posts to display on a single page
|
||||
$args->page_count = 10; // /< the number of pages that appear in the page navigation
|
||||
$args->order_type = strtolower(Context::get('order_type')) === 'asc' ? 'asc' : 'desc';
|
||||
|
||||
|
||||
// select sort method
|
||||
$sort_index = Context::get('sort_index');
|
||||
if (!in_array($sort_index, array('declared_latest', 'declared_count', 'regdate')))
|
||||
|
|
@ -184,7 +184,7 @@ class DocumentAdminView extends Document
|
|||
$sort_index = 'declared_latest';
|
||||
}
|
||||
Context::set('sort_index', $sort_index);
|
||||
|
||||
|
||||
// get latest declared list
|
||||
if ($sort_index === 'declared_latest')
|
||||
{
|
||||
|
|
@ -325,7 +325,7 @@ class DocumentAdminView extends Document
|
|||
}
|
||||
else
|
||||
{
|
||||
$aliases = $output->data;
|
||||
$aliases = $output->data;
|
||||
}
|
||||
|
||||
Context::set('aliases', $aliases);
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ class Document extends ModuleObject
|
|||
|
||||
/**
|
||||
* List of status texts supported by Rhymix.
|
||||
*
|
||||
*
|
||||
* Also see status constants in common/constants.php
|
||||
* and integer status codes used in the comment module.
|
||||
*
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $statusList = array(
|
||||
|
|
@ -107,10 +107,10 @@ class Document extends ModuleObject
|
|||
// 2011. 10. 25 status index check
|
||||
if(!$oDB->isIndexExists("documents", "idx_module_status")) return true;
|
||||
|
||||
// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
|
||||
// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after')) return true;
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
|
||||
// 2016. 1. 27: Add a column(declare_message) for report
|
||||
|
|
@ -121,13 +121,13 @@ class Document extends ModuleObject
|
|||
|
||||
// 2019. 3. 07 #1146
|
||||
if(!$oDB->isColumnExists('document_update_log', 'reason_update')) return true;
|
||||
|
||||
|
||||
// 2017.12.21 Add an index for nick_name
|
||||
if(!$oDB->isIndexExists('documents', 'idx_nick_name')) return true;
|
||||
|
||||
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('file.deleteFile', 'document', 'controller', 'triggerAfterDeleteFile', 'after')) return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -217,13 +217,13 @@ class Document extends ModuleObject
|
|||
$oDB->addIndex("documents", "idx_module_status", array("module_srl","status"));
|
||||
}
|
||||
|
||||
// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
|
||||
// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after');
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after');
|
||||
|
|
@ -241,19 +241,19 @@ class Document extends ModuleObject
|
|||
$oDB->addColumn('document_update_log', 'is_admin', 'varchar', 1);
|
||||
$oDB->addIndex('document_update_log', 'idx_is_admin', array('is_admin'));
|
||||
}
|
||||
|
||||
|
||||
// 2019. 3. 07 #1146
|
||||
if(!$oDB->isColumnExists('document_update_log', 'reason_update'))
|
||||
{
|
||||
$oDB->addColumn('document_update_log', 'reason_update', 'text', '', null, false, 'extra_vars');
|
||||
}
|
||||
|
||||
|
||||
// 2017.12.21 Add an index for nick_name
|
||||
if(!$oDB->isIndexExists('documents', 'idx_nick_name'))
|
||||
{
|
||||
$oDB->addIndex('documents', 'idx_nick_name', array('nick_name'));
|
||||
}
|
||||
|
||||
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('file.deleteFile', 'document', 'controller', 'triggerAfterDeleteFile', 'after'))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class DocumentController extends Document
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$module_info = $this->module_info;
|
||||
if(!$module_info->module_srl)
|
||||
{
|
||||
|
|
@ -42,7 +42,7 @@ class DocumentController extends Document
|
|||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oDocument = DocumentModel::getDocument($document_srl, false, false);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
|
|
@ -75,7 +75,7 @@ class DocumentController extends Document
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$module_info = $this->module_info;
|
||||
if(!$module_info->module_srl)
|
||||
{
|
||||
|
|
@ -106,7 +106,7 @@ class DocumentController extends Document
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('failed_voted_canceled');
|
||||
}
|
||||
|
||||
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCountCancel($document_srl, $oDocument, $point);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -171,7 +171,7 @@ class DocumentController extends Document
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
|
||||
}
|
||||
|
||||
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCount($document_srl, $point);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -214,7 +214,7 @@ class DocumentController extends Document
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('failed_blamed_canceled');
|
||||
}
|
||||
|
||||
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCountCancel($document_srl, $oDocument, $point);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -254,14 +254,14 @@ class DocumentController extends Document
|
|||
$args->ipaddress = \RX_CLIENT_IP;
|
||||
}
|
||||
$output = executeQuery('document.getDocumentVotedLogInfo', $args);
|
||||
|
||||
|
||||
if(!$output->data->count)
|
||||
{
|
||||
return new BaseObject(-1, $point > 0 ? 'failed_voted_canceled' : 'failed_blamed_canceled');
|
||||
}
|
||||
|
||||
$point = $output->data->point;
|
||||
|
||||
|
||||
// Call a trigger (before)
|
||||
$trigger_obj = new stdClass;
|
||||
$trigger_obj->member_srl = $oDocument->get('member_srl');
|
||||
|
|
@ -277,11 +277,11 @@ class DocumentController extends Document
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
if($point != 0)
|
||||
{
|
||||
$args = new stdClass();
|
||||
|
|
@ -306,9 +306,9 @@ class DocumentController extends Document
|
|||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('document.updateVotedCountCancel', 'after', $trigger_obj);
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -403,7 +403,7 @@ class DocumentController extends Document
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$oDocument = DocumentModel::getDocument($document_srl);
|
||||
if (!$oDocument || !$oDocument->isExists())
|
||||
{
|
||||
|
|
@ -413,14 +413,14 @@ class DocumentController extends Document
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\TargetNotFound;
|
||||
}
|
||||
|
||||
|
||||
$output = $this->deleteDocument($document_srl);
|
||||
if ($output instanceof BaseObject && !$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete alias when module deleted
|
||||
* @param int $module_srl
|
||||
|
|
@ -521,13 +521,13 @@ class DocumentController extends Document
|
|||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
// List variables
|
||||
if($obj->comment_status) $obj->commentStatus = $obj->comment_status;
|
||||
if(!$obj->commentStatus) $obj->commentStatus = 'DENY';
|
||||
if($obj->commentStatus == 'DENY') $this->_checkCommentStatusForOldVersion($obj);
|
||||
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
|
||||
if($obj->homepage)
|
||||
if($obj->homepage)
|
||||
{
|
||||
$obj->homepage = escape($obj->homepage);
|
||||
if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage))
|
||||
|
|
@ -535,17 +535,17 @@ class DocumentController extends Document
|
|||
$obj->homepage = 'http://'.$obj->homepage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($obj->notify_message != 'Y') $obj->notify_message = 'N';
|
||||
if(!$obj->email_address) $obj->email_address = '';
|
||||
if(!$isRestore) $obj->ipaddress = \RX_CLIENT_IP;
|
||||
$obj->isRestore = $isRestore ? true : false;
|
||||
|
||||
|
||||
// Sanitize variables
|
||||
$obj->document_srl = intval($obj->document_srl);
|
||||
$obj->category_srl = intval($obj->category_srl);
|
||||
$obj->module_srl = intval($obj->module_srl);
|
||||
|
||||
|
||||
// Default Status
|
||||
if($obj->status)
|
||||
{
|
||||
|
|
@ -558,14 +558,14 @@ class DocumentController extends Document
|
|||
{
|
||||
$this->_checkDocumentStatusForOldVersion($obj);
|
||||
}
|
||||
|
||||
|
||||
// can modify regdate only manager
|
||||
$grant = Context::get('grant');
|
||||
if(!$grant->manager)
|
||||
{
|
||||
unset($obj->regdate);
|
||||
}
|
||||
|
||||
|
||||
// Serialize the $extra_vars, check the extra_vars type, because duplicate serialized avoid
|
||||
if (!isset($obj->extra_vars))
|
||||
{
|
||||
|
|
@ -586,7 +586,7 @@ class DocumentController extends Document
|
|||
unset($obj->manual_member_info);
|
||||
|
||||
$obj->uploaded_count = FileModel::getFilesCount($obj->document_srl);
|
||||
|
||||
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('document.insertDocument', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -665,7 +665,7 @@ class DocumentController extends Document
|
|||
{
|
||||
$obj->content = getModel('editor')->converter($obj, 'document');
|
||||
}
|
||||
|
||||
|
||||
// Remove iframe and script if not a top adminisrator in the session.
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
|
|
@ -680,7 +680,7 @@ class DocumentController extends Document
|
|||
$obj->content = utf8_mbencode($obj->content);
|
||||
|
||||
$obj->lang_code = Context::getLangType();
|
||||
|
||||
|
||||
// Insert data into the DB
|
||||
$output = executeQuery('document.insertDocument', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -718,10 +718,10 @@ class DocumentController extends Document
|
|||
$this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, $idx, $value, $extra_item->eid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Update the category if the category_srl exists.
|
||||
if($obj->category_srl) $this->updateCategoryCount($obj->module_srl, $obj->category_srl);
|
||||
|
||||
|
||||
// Call a trigger (after)
|
||||
if($obj->update_log_setting === 'Y')
|
||||
{
|
||||
|
|
@ -741,7 +741,7 @@ class DocumentController extends Document
|
|||
$oDB->rollback();
|
||||
return $attachOutput;
|
||||
}
|
||||
|
||||
|
||||
$obj->updated_file_count = $attachOutput->get('updated_file_count');
|
||||
ModuleHandler::triggerCall('document.insertDocument', 'after', $obj);
|
||||
|
||||
|
|
@ -772,17 +772,17 @@ class DocumentController extends Document
|
|||
{
|
||||
return new BaseObject(-1, 'msg_security_violation');
|
||||
}
|
||||
|
||||
|
||||
if(!$source_obj->document_srl || !$obj->document_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalied_request');
|
||||
}
|
||||
|
||||
|
||||
// Sanitize variables
|
||||
$obj->document_srl = intval($obj->document_srl);
|
||||
$obj->category_srl = intval($obj->category_srl);
|
||||
$obj->module_srl = intval($obj->module_srl);
|
||||
|
||||
|
||||
// Default Status
|
||||
if($obj->status)
|
||||
{
|
||||
|
|
@ -790,7 +790,7 @@ class DocumentController extends Document
|
|||
{
|
||||
$obj->status = $this->getDefaultStatus();
|
||||
}
|
||||
|
||||
|
||||
// Do not update to temp document (point problem)
|
||||
if($obj->status == $this->getConfigStatus('temp'))
|
||||
{
|
||||
|
|
@ -801,12 +801,12 @@ class DocumentController extends Document
|
|||
{
|
||||
$this->_checkDocumentStatusForOldVersion($obj);
|
||||
}
|
||||
|
||||
|
||||
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
|
||||
unset($obj->manual_member_info);
|
||||
|
||||
$obj->uploaded_count = FileModel::getFilesCount($obj->document_srl);
|
||||
|
||||
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('document.updateDocument', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -817,9 +817,9 @@ class DocumentController extends Document
|
|||
// begin transaction
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
if(!$obj->module_srl) $obj->module_srl = $source_obj->get('module_srl');
|
||||
|
||||
|
||||
$document_config = ModuleModel::getModulePartConfig('document', $obj->module_srl);
|
||||
if(!$document_config)
|
||||
{
|
||||
|
|
@ -829,7 +829,7 @@ class DocumentController extends Document
|
|||
$bUseHistory = $document_config->use_history == 'Y' || $document_config->use_history == 'Trace';
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
||||
if($bUseHistory)
|
||||
{
|
||||
$args = new stdClass;
|
||||
|
|
@ -861,16 +861,16 @@ class DocumentController extends Document
|
|||
$obj->homepage = 'http://'.$obj->homepage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($obj->notify_message != 'Y') $obj->notify_message = 'N';
|
||||
|
||||
|
||||
// can modify regdate only manager
|
||||
$grant = Context::get('grant');
|
||||
if(!$grant->manager)
|
||||
{
|
||||
unset($obj->regdate);
|
||||
}
|
||||
|
||||
|
||||
// Serialize the $extra_vars
|
||||
if (isset($obj->extra_vars) && !is_string($obj->extra_vars))
|
||||
{
|
||||
|
|
@ -952,7 +952,7 @@ class DocumentController extends Document
|
|||
{
|
||||
$obj->content = getModel('editor')->converter($obj, 'document');
|
||||
}
|
||||
|
||||
|
||||
// Remove iframe and script if not a top adminisrator in the session.
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
|
|
@ -1069,7 +1069,7 @@ class DocumentController extends Document
|
|||
return $attachOutput;
|
||||
}
|
||||
$obj->updated_file_count = $attachOutput->get('updated_file_count');
|
||||
|
||||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('document.updateDocument', 'after', $obj);
|
||||
|
||||
|
|
@ -1080,7 +1080,7 @@ class DocumentController extends Document
|
|||
Rhymix\Framework\Storage::deleteDirectory(RX_BASEDIR . sprintf('files/thumbnails/%s', getNumberingPath($obj->document_srl, 3)));
|
||||
|
||||
$output->add('document_srl',$obj->document_srl);
|
||||
|
||||
|
||||
//remove from cache
|
||||
self::clearDocumentCache($obj->document_srl);
|
||||
return $output;
|
||||
|
|
@ -1195,7 +1195,7 @@ class DocumentController extends Document
|
|||
$trigger_obj = $oDocument->getObjectVars();
|
||||
$trigger_obj->isEmptyTrash = $isEmptyTrash ? true : false;
|
||||
ModuleHandler::triggerCall('document.deleteDocument', 'after', $trigger_obj);
|
||||
|
||||
|
||||
// declared document, log delete
|
||||
$this->_deleteDeclaredDocuments($args);
|
||||
$this->_deleteDocumentReadedLog($args);
|
||||
|
|
@ -1356,7 +1356,7 @@ class DocumentController extends Document
|
|||
$args->isvalid = 'N';
|
||||
executeQuery('file.updateFileValid', $args);
|
||||
}
|
||||
|
||||
|
||||
// Call a trigger (after)
|
||||
$obj->module_srl = $oDocument->get('module_srl');
|
||||
$obj->member_srl = $oDocument->get('member_srl');
|
||||
|
|
@ -1384,7 +1384,7 @@ class DocumentController extends Document
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Get the view count option, and use the default if the value is empty or invalid.
|
||||
$valid_options = array(
|
||||
'all' => true,
|
||||
|
|
@ -1392,7 +1392,7 @@ class DocumentController extends Document
|
|||
'once' => true,
|
||||
'none' => true,
|
||||
);
|
||||
|
||||
|
||||
$config = DocumentModel::getDocumentConfig();
|
||||
if (!isset($config->view_count_option) || !isset($valid_options[$config->view_count_option]))
|
||||
{
|
||||
|
|
@ -1404,12 +1404,12 @@ class DocumentController extends Document
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Get document and user information.
|
||||
$document_srl = $oDocument->document_srl;
|
||||
$member_srl = $oDocument->get('member_srl');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
||||
// Option 'some': only count once per session.
|
||||
if ($config->view_count_option != 'all' && isset($_SESSION['readed_document'][$document_srl]))
|
||||
{
|
||||
|
|
@ -1428,7 +1428,7 @@ class DocumentController extends Document
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Pass if the author's member_srl is the same as the visitor's.
|
||||
if($member_srl && $logged_info && $logged_info->member_srl && $logged_info->member_srl == $member_srl)
|
||||
{
|
||||
|
|
@ -1440,7 +1440,7 @@ class DocumentController extends Document
|
|||
// Call a trigger when the read count is updated (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('document.updateReadedCount', 'before', $oDocument);
|
||||
if(!$trigger_output->toBool()) return $trigger_output;
|
||||
|
||||
|
||||
// Update read counts
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
|
@ -1453,7 +1453,7 @@ class DocumentController extends Document
|
|||
$oDB->commit();
|
||||
|
||||
// Register session
|
||||
if(!isset($_SESSION['readed_document'][$document_srl]) && Context::getSessionStatus())
|
||||
if(!isset($_SESSION['readed_document'][$document_srl]) && Context::getSessionStatus())
|
||||
{
|
||||
$_SESSION['readed_document'][$document_srl] = true;
|
||||
}
|
||||
|
|
@ -1577,7 +1577,7 @@ class DocumentController extends Document
|
|||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
|
||||
if (is_int($idx_or_eid) || ctype_digit($idx_or_eid))
|
||||
{
|
||||
if (!$eid)
|
||||
|
|
@ -1598,7 +1598,7 @@ class DocumentController extends Document
|
|||
return new BaseObject(-1, 'Invalid eid: ' . $eid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj->module_srl = $module_srl;
|
||||
$obj->document_srl = $document_srl;
|
||||
|
|
@ -1626,7 +1626,7 @@ class DocumentController extends Document
|
|||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
|
||||
if (is_int($idx_or_eid) || ctype_digit($idx_or_eid))
|
||||
{
|
||||
if (!$eid)
|
||||
|
|
@ -1647,7 +1647,7 @@ class DocumentController extends Document
|
|||
return new BaseObject(-1, 'Invalid eid: ' . $eid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj->module_srl = $module_srl;
|
||||
$obj->document_srl = $document_srl;
|
||||
|
|
@ -1658,21 +1658,21 @@ class DocumentController extends Document
|
|||
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
$output = self::deleteDocumentExtraVars($module_srl, $document_srl, $idx_or_eid, $lang_code, $eid);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$output = self::insertDocumentExtraVar($module_srl, $document_srl, $idx_or_eid, $value, $eid, $lang_code);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -1782,7 +1782,7 @@ class DocumentController extends Document
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
|
@ -1806,7 +1806,7 @@ class DocumentController extends Document
|
|||
|
||||
// Leave in the session information
|
||||
$_SESSION['voted_document'][$document_srl] = $trigger_obj->point;
|
||||
|
||||
|
||||
// Leave logs
|
||||
$args->point = $trigger_obj->point;
|
||||
$output = executeQuery('document.insertDocumentVotedLog', $args);
|
||||
|
|
@ -1815,7 +1815,7 @@ class DocumentController extends Document
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('document.updateVotedCount', 'after', $trigger_obj);
|
||||
|
||||
|
|
@ -1836,7 +1836,7 @@ class DocumentController extends Document
|
|||
$output->setMessage('success_blamed');
|
||||
$output->add('blamed_count', $trigger_obj->after_point);
|
||||
}
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -1862,10 +1862,10 @@ class DocumentController extends Document
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$declared_count = ($output->data->declared_count) ? $output->data->declared_count : 0;
|
||||
$declare_message = trim(htmlspecialchars($declare_message));
|
||||
|
||||
|
||||
$trigger_obj = new stdClass();
|
||||
$trigger_obj->document_srl = $document_srl;
|
||||
$trigger_obj->declared_count = $declared_count;
|
||||
|
|
@ -1890,7 +1890,7 @@ class DocumentController extends Document
|
|||
|
||||
// Get currently logged in user.
|
||||
$member_srl = $this->user->member_srl;
|
||||
|
||||
|
||||
// Check if document's author is a member.
|
||||
if($oDocument->get('member_srl'))
|
||||
{
|
||||
|
|
@ -1919,12 +1919,12 @@ class DocumentController extends Document
|
|||
$_SESSION['declared_document'][$document_srl] = false;
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
|
||||
// Fill in remaining information for logging.
|
||||
$args->member_srl = $member_srl;
|
||||
$args->ipaddress = \RX_CLIENT_IP;
|
||||
$args->declare_message = $declare_message;
|
||||
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
|
@ -1954,7 +1954,7 @@ class DocumentController extends Document
|
|||
}
|
||||
|
||||
$this->add('declared_count', $declared_count + 1);
|
||||
|
||||
|
||||
// Send message to admin
|
||||
$message_targets = array();
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
|
|
@ -2011,7 +2011,7 @@ class DocumentController extends Document
|
|||
{
|
||||
return new BaseObject(-1, 'failed_declared_cancel');
|
||||
}
|
||||
|
||||
|
||||
// Get the original document
|
||||
$oDocument = DocumentModel::getDocument($document_srl, false, false);
|
||||
|
||||
|
|
@ -2034,7 +2034,7 @@ class DocumentController extends Document
|
|||
unset($_SESSION['declared_document'][$document_srl]);
|
||||
return new BaseObject(-1, 'failed_declared_cancel');
|
||||
}
|
||||
|
||||
|
||||
// Get current declared count
|
||||
$args = new stdClass();
|
||||
$args->document_srl = $document_srl;
|
||||
|
|
@ -2050,7 +2050,7 @@ class DocumentController extends Document
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
if($declared_count > 1)
|
||||
{
|
||||
$output = executeQuery('document.updateDeclaredDocumentCancel', $args);
|
||||
|
|
@ -2064,14 +2064,14 @@ class DocumentController extends Document
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$output = executeQuery('document.deleteDeclaredDocumentLog', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$message_targets = array();
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
$document_config = ModuleModel::getModulePartConfig('document', $module_srl);
|
||||
|
|
@ -2101,7 +2101,7 @@ class DocumentController extends Document
|
|||
$oCommunicationController->sendMessage($this->user->member_srl, $target_member_srl, $message_title, $message_content, false. null, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$trigger_obj->declared_count = $declared_count - 1;
|
||||
|
|
@ -2258,7 +2258,7 @@ class DocumentController extends Document
|
|||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->makeCategoryFile($category_info->module_srl);
|
||||
|
||||
|
||||
// remove cache
|
||||
$page = 0;
|
||||
while(true)
|
||||
|
|
@ -3022,7 +3022,7 @@ class DocumentController extends Document
|
|||
{
|
||||
@set_time_limit(0);
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj->type = Context::get('type');
|
||||
$obj->document_list = array();
|
||||
|
|
@ -3032,7 +3032,7 @@ class DocumentController extends Document
|
|||
$obj->manager_message = Context::get('message_content') ? nl2br(escape(strip_tags(Context::get('message_content')))) : '';
|
||||
$obj->send_message = $obj->manager_message || Context::get('send_default_message') == 'Y';
|
||||
$obj->return_message = '';
|
||||
|
||||
|
||||
// Check permission of target module
|
||||
if($obj->target_module_srl)
|
||||
{
|
||||
|
|
@ -3047,7 +3047,7 @@ class DocumentController extends Document
|
|||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set Cart
|
||||
$cart = Context::get('cart');
|
||||
if(!is_array($cart))
|
||||
|
|
@ -3055,21 +3055,21 @@ class DocumentController extends Document
|
|||
$cart = explode('|@|', $cart);
|
||||
}
|
||||
$obj->document_srl_list = array_unique(array_map('intval', $cart));
|
||||
|
||||
|
||||
// Set document list
|
||||
$obj->document_list = DocumentModel::getDocuments($obj->document_srl_list, false, false);
|
||||
if(empty($obj->document_list))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('document.manage', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$oController = getAdminController('document');
|
||||
if($obj->type == 'move')
|
||||
{
|
||||
|
|
@ -3077,13 +3077,13 @@ class DocumentController extends Document
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('fail_to_move');
|
||||
}
|
||||
|
||||
|
||||
$output = $oController->moveDocumentModule($obj->document_srl_list, $obj->target_module_srl, $obj->target_category_srl);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$obj->return_message = 'success_moved';
|
||||
}
|
||||
else if($obj->type == 'copy')
|
||||
|
|
@ -3092,13 +3092,13 @@ class DocumentController extends Document
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('fail_to_move');
|
||||
}
|
||||
|
||||
|
||||
$output = $oController->copyDocumentModule($obj->document_srl_list, $obj->target_module_srl, $obj->target_category_srl);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$obj->return_message = 'success_copied';
|
||||
}
|
||||
else if($obj->type == 'delete')
|
||||
|
|
@ -3112,14 +3112,14 @@ class DocumentController extends Document
|
|||
$obj->return_message = $output->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$obj->return_message = $obj->return_message ?: 'success_deleted';
|
||||
}
|
||||
else if($obj->type == 'trash')
|
||||
{
|
||||
$args = new stdClass;
|
||||
$args->description = $obj->manager_message;
|
||||
|
||||
|
||||
foreach ($obj->document_list as $document_srl => $oDocument)
|
||||
{
|
||||
$args->document_srl = $document_srl;
|
||||
|
|
@ -3130,7 +3130,7 @@ class DocumentController extends Document
|
|||
$obj->return_message = $output->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$obj->return_message = $obj->return_message ?: 'success_trashed';
|
||||
}
|
||||
else if($obj->type == 'cancelDeclare')
|
||||
|
|
@ -3142,17 +3142,17 @@ class DocumentController extends Document
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$obj->return_message = 'success_declare_canceled';
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('document.manage', 'after', $obj);
|
||||
|
||||
|
||||
// Send a message
|
||||
$actions = lang('default_message_verbs');
|
||||
if(isset($actions[$obj->type]) && $obj->send_message)
|
||||
|
|
@ -3166,7 +3166,7 @@ class DocumentController extends Document
|
|||
<ul>%1\$s</ul>
|
||||
Content;
|
||||
$document_item = '<li><a href="%1$s">%2$s</a></li>';
|
||||
|
||||
|
||||
// Set recipient
|
||||
$recipients = array();
|
||||
foreach ($obj->document_list as $document_srl => $oDocument)
|
||||
|
|
@ -3175,15 +3175,15 @@ Content;
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if(!isset($recipients[$member_srl]))
|
||||
{
|
||||
$recipients[$member_srl] = array();
|
||||
}
|
||||
|
||||
|
||||
$recipients[$member_srl][] = sprintf($document_item, $oDocument->getPermanentUrl(), $oDocument->getTitleText());
|
||||
}
|
||||
|
||||
|
||||
// Send
|
||||
$oCommunicationController = getController('communication');
|
||||
foreach ($recipients as $member_srl => $items)
|
||||
|
|
@ -3191,9 +3191,9 @@ Content;
|
|||
$oCommunicationController->sendMessage($this->user->member_srl, $member_srl, $title, sprintf($content, implode('', $items)), true, null, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$_SESSION['document_management'] = array();
|
||||
|
||||
|
||||
$this->setMessage($obj->return_message);
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList'));
|
||||
}
|
||||
|
|
@ -3211,19 +3211,19 @@ Content;
|
|||
foreach ($target_module_srl as $srl)
|
||||
{
|
||||
if (!$srl) continue;
|
||||
|
||||
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$module_grant = ModuleModel::getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$module_srl[] = $srl;
|
||||
}
|
||||
|
||||
|
|
@ -3246,7 +3246,7 @@ Content;
|
|||
{
|
||||
$output = $oModuleController->insertModulePartConfig('document',$srl,$document_config);
|
||||
}
|
||||
|
||||
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated', 'info');
|
||||
|
||||
|
|
@ -3264,11 +3264,11 @@ Content;
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$obj = Context::getRequestVars();
|
||||
$obj->module_srl = $this->module_srl;
|
||||
$obj->status = $this->getConfigStatus('temp');
|
||||
|
||||
|
||||
// unset document style if not manager
|
||||
if(!$this->grant->manager)
|
||||
{
|
||||
|
|
@ -3276,9 +3276,9 @@ Content;
|
|||
unset($obj->title_color);
|
||||
unset($obj->title_bold);
|
||||
}
|
||||
|
||||
|
||||
$oDocument = DocumentModel::getDocument($obj->document_srl);
|
||||
|
||||
|
||||
// Update if already exists
|
||||
if($oDocument->isExists())
|
||||
{
|
||||
|
|
@ -3286,22 +3286,22 @@ Content;
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
if($oDocument->get('status') != $this->getConfigStatus('temp'))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$output = $this->updateDocument($oDocument, $obj);
|
||||
}
|
||||
// Otherwise, get a new
|
||||
else
|
||||
{
|
||||
$output = $this->insertDocument($obj);
|
||||
|
||||
|
||||
$oDocument = DocumentModel::getDocument($output->get('document_srl'));
|
||||
}
|
||||
|
||||
|
||||
// Set the attachment to be invalid state
|
||||
if($oDocument->hasUploadedFiles())
|
||||
{
|
||||
|
|
@ -3310,7 +3310,7 @@ Content;
|
|||
$args->upload_target_srl = $oDocument->document_srl;
|
||||
executeQuery('file.updateFileValid', $args);
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage('success_saved');
|
||||
$this->add('document_srl', $output->get('document_srl'));
|
||||
}
|
||||
|
|
@ -3325,7 +3325,7 @@ Content;
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$documentSrls = Context::get('document_srls');
|
||||
if($documentSrls) $documentSrlList = explode(',', $documentSrls);
|
||||
|
||||
|
|
@ -3346,7 +3346,7 @@ Content;
|
|||
|
||||
/**
|
||||
* Clear document cache
|
||||
*
|
||||
*
|
||||
* @param int $document_srl
|
||||
* @param string $type
|
||||
*/
|
||||
|
|
@ -3365,7 +3365,7 @@ Content;
|
|||
unset($GLOBALS['RX_DOCUMENT_LANG'][$document_srl]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For old version, comment allow status check.
|
||||
* @param object $obj
|
||||
|
|
@ -3399,35 +3399,35 @@ Content;
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function updateUploaedCount($document_srl_list)
|
||||
{
|
||||
if(!is_array($document_srl_list))
|
||||
{
|
||||
$document_srl_list = array($document_srl_list);
|
||||
}
|
||||
|
||||
|
||||
if(empty($document_srl_list))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$document_srl_list = array_unique($document_srl_list);
|
||||
|
||||
|
||||
foreach($document_srl_list as $document_srl)
|
||||
{
|
||||
if(!$document_srl = (int) $document_srl)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass;
|
||||
$args->document_srl = $document_srl;
|
||||
$args->uploaded_count = FileModel::getFilesCount($document_srl);
|
||||
executeQuery('document.updateUploadedCount', $args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function triggerAfterDeleteFile($file)
|
||||
{
|
||||
$oDocument = DocumentModel::getDocument($file->upload_target_srl, false, false);
|
||||
|
|
@ -3435,10 +3435,10 @@ Content;
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->updateUploaedCount($file->upload_target_srl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copy extra keys when module copied
|
||||
* @param object $obj
|
||||
|
|
|
|||
|
|
@ -92,11 +92,11 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$document_item = false;
|
||||
$columnList = array();
|
||||
$reload_counts = true;
|
||||
|
||||
|
||||
if ($this->columnList === false)
|
||||
{
|
||||
$reload_counts = false;
|
||||
|
|
@ -145,7 +145,7 @@ class DocumentItem extends BaseObject
|
|||
$this->document_srl = null;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->document_srl = $attribute->document_srl;
|
||||
$this->lang_code = $attribute->lang_code ?? null;
|
||||
$this->adds($attribute);
|
||||
|
|
@ -154,22 +154,22 @@ class DocumentItem extends BaseObject
|
|||
$this->add('apparent_module_srl', $attribute->module_srl);
|
||||
$this->add('origin_module_srl', $attribute->module_srl);
|
||||
}
|
||||
|
||||
|
||||
// set XE_DOCUMENT_LIST
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$this->document_srl] = $this;
|
||||
|
||||
|
||||
// set tags
|
||||
if($this->get('tags'))
|
||||
{
|
||||
$this->add('tag_list', $this->getTags());
|
||||
}
|
||||
|
||||
|
||||
// set extra vars
|
||||
if($load_extra_vars)
|
||||
{
|
||||
DocumentModel::setToAllDocumentExtraVars();
|
||||
}
|
||||
|
||||
|
||||
// set content in user language
|
||||
if(isset($GLOBALS['RX_DOCUMENT_LANG'][$this->document_srl]['title']))
|
||||
{
|
||||
|
|
@ -185,24 +185,24 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return (bool) ($this->document_srl);
|
||||
}
|
||||
|
||||
|
||||
function isGranted()
|
||||
{
|
||||
if(!$this->isExists())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (isset($_SESSION['granted_document'][$this->document_srl]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if ($this->grant_cache !== null)
|
||||
{
|
||||
return $this->grant_cache;
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if (!$logged_info || !$logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -216,34 +216,34 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return $this->grant_cache = true;
|
||||
}
|
||||
|
||||
|
||||
$grant = ModuleModel::getGrant(ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl')), $logged_info);
|
||||
if ($grant->manager)
|
||||
{
|
||||
return $this->grant_cache = true;
|
||||
}
|
||||
|
||||
|
||||
return $this->grant_cache = false;
|
||||
}
|
||||
|
||||
|
||||
function setGrant()
|
||||
{
|
||||
$this->grant_cache = true;
|
||||
}
|
||||
|
||||
|
||||
function setGrantForSession()
|
||||
{
|
||||
$_SESSION['granted_document'][$this->document_srl] = true;
|
||||
$this->setGrant();
|
||||
}
|
||||
|
||||
|
||||
function isAccessible($strict = false)
|
||||
{
|
||||
if(!$this->isExists())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ($strict)
|
||||
{
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl'));
|
||||
|
|
@ -257,28 +257,28 @@ class DocumentItem extends BaseObject
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($_SESSION['accessible'][$this->document_srl]) && $_SESSION['accessible'][$this->document_srl] === $this->get('last_update'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
$status_list = DocumentModel::getStatusList();
|
||||
if ($this->get('status') === $status_list['public'])
|
||||
{
|
||||
$this->setAccessible();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if ($this->isGranted())
|
||||
{
|
||||
$this->setAccessible();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function setAccessible()
|
||||
{
|
||||
if(Context::getSessionStatus())
|
||||
|
|
@ -286,7 +286,7 @@ class DocumentItem extends BaseObject
|
|||
$_SESSION['accessible'][$this->document_srl] = $this->get('last_update');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function allowComment()
|
||||
{
|
||||
// init write, document is not exists. so allow comment status is true
|
||||
|
|
@ -294,7 +294,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return (bool) ($this->get('comment_status') == 'ALLOW');
|
||||
}
|
||||
|
||||
|
|
@ -303,7 +303,7 @@ class DocumentItem extends BaseObject
|
|||
static $allow_trackback_status = null;
|
||||
if(is_null($allow_trackback_status))
|
||||
{
|
||||
|
||||
|
||||
// Check the tarckback module exist
|
||||
if(!getClass('trackback'))
|
||||
{
|
||||
|
|
@ -313,12 +313,12 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
// If the trackback module is configured to be disabled, do not allow. Otherwise, check the setting of each module.
|
||||
$trackback_config = ModuleModel::getModuleConfig('trackback');
|
||||
|
||||
|
||||
if(!$trackback_config)
|
||||
{
|
||||
$trackback_config = new stdClass();
|
||||
}
|
||||
|
||||
|
||||
if(!isset($trackback_config->enable_trackback)) $trackback_config->enable_trackback = 'Y';
|
||||
if($trackback_config->enable_trackback != 'Y') $allow_trackback_status = false;
|
||||
else
|
||||
|
|
@ -340,7 +340,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return (bool) ($this->get('comment_status') != 'ALLOW');
|
||||
}
|
||||
|
||||
|
|
@ -348,29 +348,29 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return (bool) (!$this->get('member_srl') || $this->isGranted());
|
||||
}
|
||||
|
||||
|
||||
function isSecret()
|
||||
{
|
||||
return (bool) ($this->get('status') == DocumentModel::getConfigStatus('secret'));
|
||||
}
|
||||
|
||||
|
||||
function isNotice()
|
||||
{
|
||||
return (bool) ($this->get('is_notice') === 'Y' || $this->get('is_notice') === 'A');
|
||||
}
|
||||
|
||||
|
||||
function useNotify()
|
||||
{
|
||||
return (bool) ($this->get('notify_message') == 'Y');
|
||||
}
|
||||
|
||||
|
||||
function doCart()
|
||||
{
|
||||
if(!$this->isExists())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$this->isCarted() ? $this->removeCart() : $this->addCart();
|
||||
}
|
||||
|
||||
|
|
@ -411,18 +411,18 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Return if the currently logged-in user is an author
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->member_srl == $this->get('member_srl'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// List variables
|
||||
$title = ($type ? sprintf('[%s] ', $type) : '') . cut_str(strip_tags($content), 10, '...');
|
||||
$content = sprintf('%s<br><br>from : <a href="%s" target="_blank">%s</a>',$content, getFullUrl('', 'document_srl', $this->document_srl), getFullUrl('', 'document_srl', $this->document_srl));
|
||||
|
||||
|
||||
// Send a message
|
||||
$sender_member_srl = $logged_info->member_srl ?: $this->get('member_srl');
|
||||
getController('communication')->sendMessage($sender_member_srl, $this->get('member_srl'), $title, $content, false, null, false);
|
||||
|
|
@ -439,7 +439,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return $this->get('ipaddress');
|
||||
}
|
||||
|
||||
|
||||
return '*' . strstr($this->get('ipaddress') ?? '', '.');
|
||||
}
|
||||
|
||||
|
|
@ -454,12 +454,12 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!preg_match('@^[a-z]+://@i', $url))
|
||||
{
|
||||
$url = 'http://' . $url;
|
||||
}
|
||||
|
||||
|
||||
return escape($url, false);
|
||||
}
|
||||
|
||||
|
|
@ -494,7 +494,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
return $cut_size ? cut_str($this->get('title'), $cut_size, $tail) : $this->get('title');
|
||||
}
|
||||
|
||||
|
|
@ -514,7 +514,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return $_SESSION['voted_document'][$this->document_srl];
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -554,7 +554,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -565,7 +565,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return $_SESSION['declared_document'][$this->document_srl];
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
if($logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -582,7 +582,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return $_SESSION['declared_document'][$this->document_srl] = $declaredCount;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -592,10 +592,10 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$title = escape($this->getTitleText($cut_size, $tail), false);
|
||||
$this->add('title_color', trim($this->get('title_color') ?? ''));
|
||||
|
||||
|
||||
$attrs = array();
|
||||
if($this->get('title_bold') == 'Y')
|
||||
{
|
||||
|
|
@ -609,7 +609,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return sprintf('<span style="%s">%s</span>', implode(';', $attrs), $title);
|
||||
}
|
||||
|
||||
|
||||
return $title;
|
||||
}
|
||||
|
||||
|
|
@ -619,19 +619,19 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->isAccessible())
|
||||
{
|
||||
return lang('msg_is_secret');
|
||||
}
|
||||
|
||||
|
||||
$content = $this->get('content');
|
||||
$content = trim(utf8_normalize_spaces(html_entity_decode(strip_tags($content))));
|
||||
if($strlen)
|
||||
{
|
||||
$content = cut_str($content, $strlen, '...');
|
||||
}
|
||||
|
||||
|
||||
return escape($content);
|
||||
}
|
||||
|
||||
|
|
@ -641,12 +641,12 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->isAccessible())
|
||||
{
|
||||
return lang('msg_is_secret');
|
||||
}
|
||||
|
||||
|
||||
$content = $this->get('content');
|
||||
$content = preg_replace_callback('/<(object|param|embed)[^>]*/is', array($this, '_checkAllowScriptAccess'), $content);
|
||||
$content = preg_replace_callback('/<object[^>]*>/is', array($this, '_addAllowScriptAccess'), $content);
|
||||
|
|
@ -655,7 +655,7 @@ class DocumentItem extends BaseObject
|
|||
$content = trim(utf8_normalize_spaces(html_entity_decode(strip_tags($content))));
|
||||
$content = cut_str($content, $strlen, '...');
|
||||
}
|
||||
|
||||
|
||||
return escape($content);
|
||||
}
|
||||
|
||||
|
|
@ -708,18 +708,18 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->isAccessible())
|
||||
{
|
||||
return lang('msg_is_secret');
|
||||
}
|
||||
|
||||
|
||||
$content = $this->get('content');
|
||||
if(!$stripEmbedTagException)
|
||||
{
|
||||
stripEmbedTagForAdmin($content, $this->get('member_srl'));
|
||||
}
|
||||
|
||||
|
||||
// Define a link if using a rewrite module
|
||||
if(Context::isAllowRewrite())
|
||||
{
|
||||
|
|
@ -761,7 +761,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
$content = preg_replace_callback('/<img([^>]+)>/i',array($this,'replaceResourceRealPath'), $content);
|
||||
}
|
||||
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
|
@ -779,31 +779,31 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$content = $this->getContent($add_popup_menu, $add_content_info, $resource_realpath, $add_xe_content_class);
|
||||
$content = getController('editor')->transComponent($content);
|
||||
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
function getSummary($str_size = 50, $tail = '...')
|
||||
{
|
||||
// Remove tags
|
||||
$content = $this->getContent(false, false);
|
||||
$content = strip_tags(preg_replace('!<(style|script)\b.+?</\\1>!is', '', $content));
|
||||
|
||||
|
||||
// Convert temporarily html entity for truncate
|
||||
$content = html_entity_decode($content, ENT_QUOTES);
|
||||
|
||||
|
||||
// Replace all whitespaces to single space
|
||||
$content = utf8_trim(utf8_normalize_spaces($content));
|
||||
|
||||
|
||||
// Truncate string
|
||||
$content = cut_str($content, $str_size, $tail);
|
||||
|
||||
|
||||
return escape($content);
|
||||
}
|
||||
|
||||
|
||||
function getRegdate($format = 'Y.m.d H:i:s', $conversion = true)
|
||||
{
|
||||
return zdate($this->get('regdate'), $format, $conversion);
|
||||
|
|
@ -854,9 +854,9 @@ class DocumentItem extends BaseObject
|
|||
*/
|
||||
public function getTrackbackUrl()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getUrl()
|
||||
{
|
||||
return getFullUrl('', 'mid', $this->getApparentMid(), 'document_srl', $this->get('document_srl'));
|
||||
|
|
@ -868,14 +868,14 @@ class DocumentItem extends BaseObject
|
|||
$tag_list = array_filter($tag_list, function($str) { return $str !== ''; });
|
||||
return array_unique($tag_list);
|
||||
}
|
||||
|
||||
|
||||
public function getHashtags()
|
||||
{
|
||||
preg_match_all('/(?<!&)#([\pL\pN_]+)/u', strip_tags($this->get('content')), $hashtags);
|
||||
$hashtags[1] = array_map(function($str) { return escape($str, false); }, $hashtags[1]);
|
||||
return array_unique($hashtags[1]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update readed count
|
||||
* @return void
|
||||
|
|
@ -911,35 +911,35 @@ class DocumentItem extends BaseObject
|
|||
|
||||
return DocumentModel::getExtraVars($module_srl, $this->document_srl);
|
||||
}
|
||||
|
||||
|
||||
function getExtraEids()
|
||||
{
|
||||
if($this->extra_eids)
|
||||
{
|
||||
return $this->extra_eids;
|
||||
}
|
||||
|
||||
|
||||
$extra_vars = $this->getExtraVars();
|
||||
foreach($extra_vars as $idx => $key)
|
||||
{
|
||||
$this->extra_eids[$key->eid] = $key;
|
||||
}
|
||||
|
||||
|
||||
return $this->extra_eids;
|
||||
}
|
||||
|
||||
|
||||
function getExtraValue($idx)
|
||||
{
|
||||
$extra_vars = $this->getExtraVars();
|
||||
return isset($extra_vars[$idx]) ? $extra_vars[$idx]->getValue() : '';
|
||||
}
|
||||
|
||||
|
||||
function getExtraValueHTML($idx)
|
||||
{
|
||||
$extra_vars = $this->getExtraVars();
|
||||
return isset($extra_vars[$idx]) ? $extra_vars[$idx]->getValueHTML() : '';
|
||||
}
|
||||
|
||||
|
||||
function getExtraEidValue($eid)
|
||||
{
|
||||
$extra_eids = $this->getExtraEids();
|
||||
|
|
@ -951,7 +951,7 @@ class DocumentItem extends BaseObject
|
|||
$extra_eids = $this->getExtraEids();
|
||||
return isset($extra_eids[$eid]) ? $extra_eids[$eid]->getValueHTML() : '';
|
||||
}
|
||||
|
||||
|
||||
function getExtraVarsValue($key)
|
||||
{
|
||||
$extra_vals = unserialize($this->get('extra_vars'));
|
||||
|
|
@ -969,12 +969,12 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->isAccessible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// cpage is a number of comment pages
|
||||
$cpageStr = sprintf('%d_cpage', $this->document_srl);
|
||||
$cpage = Context::get($cpageStr);
|
||||
|
|
@ -994,7 +994,7 @@ class DocumentItem extends BaseObject
|
|||
// Get a list of comments
|
||||
$output = CommentModel::getCommentList($this->document_srl, $cpage);
|
||||
if(!$output->toBool() || !count($output->data)) return;
|
||||
|
||||
|
||||
// Create commentItem object from a comment list
|
||||
// If admin priviledge is granted on parent posts, you can read its child posts.
|
||||
$accessible = array();
|
||||
|
|
@ -1016,7 +1016,7 @@ class DocumentItem extends BaseObject
|
|||
}
|
||||
$comment_list[$val->comment_srl] = $oCommentItem;
|
||||
}
|
||||
|
||||
|
||||
// Cache the vote log for all comments.
|
||||
$logged_info = Context::get('logged_info');
|
||||
if ($logged_info->member_srl)
|
||||
|
|
@ -1048,12 +1048,12 @@ class DocumentItem extends BaseObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Variable setting to be displayed on the skin
|
||||
Context::set($cpageStr, $output->page_navigation->cur_page);
|
||||
Context::set('cpage', $output->page_navigation->cur_page);
|
||||
if($output->total_page>1) $this->comment_page_navigation = $output->page_navigation;
|
||||
|
||||
|
||||
// Call trigger (after)
|
||||
$output = ModuleHandler::triggerCall('document.getComments', 'after', $comment_list);
|
||||
|
||||
|
|
@ -1107,7 +1107,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
$config->thumbnail_quality = 75;
|
||||
}
|
||||
|
||||
|
||||
// If not specify its height, create a square
|
||||
if(!is_int($width))
|
||||
{
|
||||
|
|
@ -1117,7 +1117,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
$height = $width;
|
||||
}
|
||||
|
||||
|
||||
// Define thumbnail information
|
||||
$thumbnail_path = sprintf('files/thumbnails/%s',getNumberingPath($this->document_srl, 3));
|
||||
$thumbnail_file = sprintf('%s%dx%d.%s.jpg', $thumbnail_path, $width, $height, $thumbnail_type);
|
||||
|
|
@ -1137,7 +1137,7 @@ class DocumentItem extends BaseObject
|
|||
return $thumbnail_url . '?' . date('YmdHis', filemtime($thumbnail_file));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Call trigger for custom thumbnails.
|
||||
$trigger_obj = (object)[
|
||||
'document_srl' => $this->document_srl, 'width' => $width, 'height' => $height,
|
||||
|
|
@ -1150,7 +1150,7 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return $thumbnail_url . '?' . date('YmdHis', filemtime($thumbnail_file));
|
||||
}
|
||||
|
||||
|
||||
// Get content if it does not exist.
|
||||
if($this->get('content'))
|
||||
{
|
||||
|
|
@ -1163,7 +1163,7 @@ class DocumentItem extends BaseObject
|
|||
$output = executeQuery('document.getDocument', $args);
|
||||
$content = $output->data->content;
|
||||
}
|
||||
|
||||
|
||||
// Return false if neither attachement nor image files in the document
|
||||
if(!$this->get('uploaded_count') && !preg_match("!<img!is", $content)) return;
|
||||
|
||||
|
|
@ -1262,7 +1262,7 @@ class DocumentItem extends BaseObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($source_file)
|
||||
{
|
||||
$output_file = FileHandler::createImageFile($source_file, $thumbnail_file, $trigger_obj->width, $trigger_obj->height, $trigger_obj->image_type, $trigger_obj->type, $trigger_obj->quality);
|
||||
|
|
@ -1343,7 +1343,7 @@ class DocumentItem extends BaseObject
|
|||
|
||||
/**
|
||||
* Return the status code.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getStatus()
|
||||
|
|
@ -1354,7 +1354,7 @@ class DocumentItem extends BaseObject
|
|||
|
||||
/**
|
||||
* Return the status in human-readable text.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getStatusText()
|
||||
|
|
@ -1406,7 +1406,7 @@ class DocumentItem extends BaseObject
|
|||
$iconSkin = 'default';
|
||||
$iconType = 'gif';
|
||||
}
|
||||
|
||||
|
||||
$path = sprintf('%s%s', \RX_BASEURL, "modules/document/tpl/icons/$iconSkin/");
|
||||
$buff = array();
|
||||
foreach($icons as $icon)
|
||||
|
|
@ -1422,12 +1422,12 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->isAccessible())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return $this->get('uploaded_count')? true : false;
|
||||
}
|
||||
|
||||
|
|
@ -1437,22 +1437,22 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->isAccessible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->get('uploaded_count'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!isset($this->uploadedFiles[$sortIndex]))
|
||||
{
|
||||
$this->uploadedFiles[$sortIndex] = FileModel::getFiles($this->document_srl, array(), $sortIndex, true);
|
||||
}
|
||||
|
||||
|
||||
return $this->uploadedFiles[$sortIndex];
|
||||
}
|
||||
|
||||
|
|
@ -1478,12 +1478,12 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->isAccessible())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1577,7 +1577,7 @@ class DocumentItem extends BaseObject
|
|||
|
||||
/**
|
||||
* Returns the apparent mid.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getApparentMid()
|
||||
|
|
@ -1587,7 +1587,7 @@ class DocumentItem extends BaseObject
|
|||
|
||||
/**
|
||||
* Returns the true mid.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getDocumentMid()
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class DocumentModel extends Document
|
|||
{
|
||||
return $_SESSION['granted_document'][$document_srl];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return document extra information from database
|
||||
* @param array $document_srls
|
||||
|
|
@ -41,7 +41,7 @@ class DocumentModel extends Document
|
|||
$args->document_srl = $document_srls;
|
||||
return executeQueryArray('document.getDocumentExtraVars', $args);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Extra variables for each article will not be processed bulk select and apply the macro city
|
||||
* @return void
|
||||
|
|
@ -54,10 +54,10 @@ class DocumentModel extends Document
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static $checked = array();
|
||||
static $module_extra_keys = array();
|
||||
|
||||
|
||||
// check documents
|
||||
$document_srls = array();
|
||||
foreach($_document_list as $document_srl => $oDocument)
|
||||
|
|
@ -66,16 +66,16 @@ class DocumentModel extends Document
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$checked[$document_srl] = true;
|
||||
$document_srls[] = $document_srl;
|
||||
}
|
||||
|
||||
|
||||
if(!$document_srls)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// get extra values of documents
|
||||
$extra_values = array();
|
||||
$output = self::getDocumentExtraVarsFromDB($document_srls);
|
||||
|
|
@ -85,10 +85,10 @@ class DocumentModel extends Document
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$extra_values[$val->document_srl][$val->var_idx][$val->lang_code] = trim($val->value);
|
||||
}
|
||||
|
||||
|
||||
// set extra variables and document language
|
||||
$user_lang_code = Context::getLangType();
|
||||
foreach($document_srls as $document_srl)
|
||||
|
|
@ -97,7 +97,7 @@ class DocumentModel extends Document
|
|||
$module_srl = $oDocument->get('module_srl');
|
||||
$document_lang_code = $oDocument->get('lang_code');
|
||||
$document_extra_values = $extra_values[$document_srl] ?? [];
|
||||
|
||||
|
||||
// set XE_EXTRA_VARS
|
||||
if(!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl]))
|
||||
{
|
||||
|
|
@ -106,7 +106,7 @@ class DocumentModel extends Document
|
|||
{
|
||||
$module_extra_keys[$module_srl] = self::getExtraKeys($module_srl);
|
||||
}
|
||||
|
||||
|
||||
// set extra variables of the document
|
||||
if($module_extra_keys[$module_srl])
|
||||
{
|
||||
|
|
@ -114,7 +114,7 @@ class DocumentModel extends Document
|
|||
foreach($module_extra_keys[$module_srl] as $idx => $key)
|
||||
{
|
||||
$document_extra_vars[$idx] = clone($key);
|
||||
|
||||
|
||||
// set variable value in user language
|
||||
if(isset($document_extra_values[$idx][$user_lang_code]))
|
||||
{
|
||||
|
|
@ -125,11 +125,11 @@ class DocumentModel extends Document
|
|||
$document_extra_vars[$idx]->setValue($document_extra_values[$idx][$document_lang_code]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$GLOBALS['XE_EXTRA_VARS'][$document_srl] = $document_extra_vars;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// set RX_DOCUMENT_LANG
|
||||
if(!isset($GLOBALS['RX_DOCUMENT_LANG'][$document_srl]) && $document_lang_code !== $user_lang_code)
|
||||
{
|
||||
|
|
@ -174,7 +174,7 @@ class DocumentModel extends Document
|
|||
trigger_error('Called DocumentModel::getDocument() with $is_admin = true', \E_USER_WARNING);
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->setGrant();
|
||||
}
|
||||
|
||||
|
||||
return $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ class DocumentModel extends Document
|
|||
$args->list_count = is_array($document_srls) ? count($document_srls) : 1;
|
||||
$args->order_type = 'asc';
|
||||
$output = executeQueryArray('document.getDocuments', $args, $columnList);
|
||||
|
||||
|
||||
$documents = array();
|
||||
foreach($output->data as $attribute)
|
||||
{
|
||||
|
|
@ -216,15 +216,15 @@ class DocumentModel extends Document
|
|||
trigger_error('Called DocumentModel::getDocuments() with $is_admin = true', \E_USER_WARNING);
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl]->setGrant();
|
||||
}
|
||||
|
||||
|
||||
$documents[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl];
|
||||
}
|
||||
|
||||
|
||||
if($load_extra_vars)
|
||||
{
|
||||
self::setToAllDocumentExtraVars();
|
||||
}
|
||||
|
||||
|
||||
return $documents;
|
||||
}
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ class DocumentModel extends Document
|
|||
$obj->isExtraVars = $sort_check->isExtraVars;
|
||||
$obj->except_notice = $except_notice;
|
||||
$obj->columnList = $columnList;
|
||||
|
||||
|
||||
// Call trigger (before)
|
||||
// This trigger can be used to set an alternative output using a different search method
|
||||
unset($obj->use_alternate_output);
|
||||
|
|
@ -252,7 +252,7 @@ class DocumentModel extends Document
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// If an alternate output is set, use it instead of running the default queries
|
||||
if (isset($obj->use_alternate_output) && $obj->use_alternate_output instanceof BaseObject)
|
||||
{
|
||||
|
|
@ -264,13 +264,13 @@ class DocumentModel extends Document
|
|||
self::_setSearchOption($obj, $args, $query_id, $use_division);
|
||||
$output = executeQueryArray($query_id, $args, $args->columnList);
|
||||
}
|
||||
|
||||
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool() || !$result = $output->data)
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$output->data = array();
|
||||
foreach($result as $key => $attribute)
|
||||
{
|
||||
|
|
@ -281,12 +281,12 @@ class DocumentModel extends Document
|
|||
}
|
||||
$output->data[$key] = $GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl];
|
||||
}
|
||||
|
||||
|
||||
if($load_extra_vars)
|
||||
{
|
||||
self::setToAllDocumentExtraVars();
|
||||
}
|
||||
|
||||
|
||||
// Call trigger (after)
|
||||
// This trigger can be used to modify search results
|
||||
ModuleHandler::triggerCall('document.getDocumentList', 'after', $output);
|
||||
|
|
@ -324,12 +324,12 @@ class DocumentModel extends Document
|
|||
{
|
||||
$output = executeQueryArray('document.getNoticeList', $args, $columnList);
|
||||
}
|
||||
|
||||
|
||||
if(!$output->toBool() || !$result = $output->data)
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$output->data = array();
|
||||
foreach($result as $attribute)
|
||||
{
|
||||
|
|
@ -338,10 +338,10 @@ class DocumentModel extends Document
|
|||
$oDocument = new documentItem();
|
||||
$oDocument->setAttribute($attribute, false);
|
||||
}
|
||||
|
||||
|
||||
$output->data[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl];
|
||||
}
|
||||
|
||||
|
||||
self::setToAllDocumentExtraVars();
|
||||
|
||||
// Call trigger (after)
|
||||
|
|
@ -446,15 +446,15 @@ class DocumentModel extends Document
|
|||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
ksort($GLOBALS['XE_EXTRA_VARS'][$document_srl]);
|
||||
|
||||
|
||||
return $GLOBALS['XE_EXTRA_VARS'][$document_srl];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get var_idx of extra variable from its eid
|
||||
*
|
||||
*
|
||||
* @param int $module_srl
|
||||
* @param string $eid
|
||||
* @return int|false
|
||||
|
|
@ -475,7 +475,7 @@ class DocumentModel extends Document
|
|||
|
||||
/**
|
||||
* Get eid of extra variable from its var_idx
|
||||
*
|
||||
*
|
||||
* @param int $module_srl
|
||||
* @param int $idx
|
||||
* @return string|false
|
||||
|
|
@ -493,7 +493,7 @@ class DocumentModel extends Document
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show pop-up menu of the selected posts
|
||||
* Printing, scrap, recommendations and negative, reported the Add Features
|
||||
|
|
@ -1281,7 +1281,7 @@ class DocumentModel extends Document
|
|||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setting sort index
|
||||
* @param object $obj
|
||||
|
|
@ -1293,34 +1293,34 @@ class DocumentModel extends Document
|
|||
$args = new stdClass;
|
||||
$args->sort_index = $obj->sort_index ?? null;
|
||||
$args->isExtraVars = false;
|
||||
|
||||
|
||||
// check it's default sort
|
||||
$default_sort = array('list_order', 'regdate', 'last_update', 'update_order', 'readed_count', 'voted_count', 'blamed_count', 'comment_count', 'trackback_count', 'uploaded_count', 'title', 'category_srl');
|
||||
if(in_array($args->sort_index, $default_sort))
|
||||
{
|
||||
return $args;
|
||||
}
|
||||
|
||||
|
||||
// check it can use extra variable
|
||||
if(!$load_extra_vars || !$extra_keys = self::getExtraKeys($obj->module_srl ?? 0))
|
||||
{
|
||||
$args->sort_index = 'list_order';
|
||||
return $args;
|
||||
}
|
||||
|
||||
|
||||
$eids = array();
|
||||
foreach($extra_keys as $idx => $key)
|
||||
{
|
||||
$eids[] = $key->eid;
|
||||
}
|
||||
|
||||
|
||||
// check it exists in extra keys of the module
|
||||
if(!in_array($args->sort_index, $eids))
|
||||
{
|
||||
$args->sort_index = 'list_order';
|
||||
return $args;
|
||||
}
|
||||
|
||||
|
||||
$args->isExtraVars = true;
|
||||
return $args;
|
||||
}
|
||||
|
|
@ -1361,13 +1361,13 @@ class DocumentModel extends Document
|
|||
$args->s_is_notice = ($searchOpt->except_notice ?? false) ? 'N' : null;
|
||||
$args->statusList = $searchOpt->statusList ?? array(self::getConfigStatus('public'), self::getConfigStatus('secret'));
|
||||
$args->columnList = $searchOpt->columnList ?? array();
|
||||
|
||||
|
||||
// get directly module_srl by mid
|
||||
if(isset($searchOpt->mid) && $searchOpt->mid)
|
||||
{
|
||||
$args->module_srl = ModuleModel::getModuleSrlByMid($searchOpt->mid);
|
||||
}
|
||||
|
||||
|
||||
// add subcategories
|
||||
if(isset($args->category_srl) && $args->category_srl)
|
||||
{
|
||||
|
|
@ -1379,13 +1379,13 @@ class DocumentModel extends Document
|
|||
$args->category_srl = $categories;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// default
|
||||
$query_id = null;
|
||||
$use_division = false;
|
||||
$search_target = $searchOpt->search_target ?? null;
|
||||
$search_keyword = trim($searchOpt->search_keyword ?? '') ?: null;
|
||||
|
||||
|
||||
// search
|
||||
if($search_target && $search_keyword)
|
||||
{
|
||||
|
|
@ -1463,7 +1463,7 @@ class DocumentModel extends Document
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// exclude secret documents in searching if current user does not have privilege
|
||||
if(!isset($args->member_srl) || !$args->member_srl || !Context::get('is_logged') || $args->member_srl !== Context::get('logged_info')->member_srl)
|
||||
{
|
||||
|
|
@ -1475,7 +1475,7 @@ class DocumentModel extends Document
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// set query
|
||||
if(!$query_id)
|
||||
{
|
||||
|
|
@ -1499,12 +1499,12 @@ class DocumentModel extends Document
|
|||
$query_id = 'document.getDocumentList';
|
||||
}
|
||||
}
|
||||
// other queries not support to sort extra variable
|
||||
// other queries not support to sort extra variable
|
||||
elseif($searchOpt->isExtraVars)
|
||||
{
|
||||
$args->sort_index = 'list_order';
|
||||
}
|
||||
|
||||
|
||||
// division search by 5,000
|
||||
if($use_division)
|
||||
{
|
||||
|
|
@ -1512,18 +1512,18 @@ class DocumentModel extends Document
|
|||
$args->sort_index = 'list_order';
|
||||
$args->division = (int)Context::get('division');
|
||||
$args->last_division = (int)Context::get('last_division');
|
||||
|
||||
|
||||
$division_args = new stdClass;
|
||||
$division_args->module_srl = $args->module_srl;
|
||||
$division_args->exclude_module_srl = $args->exclude_module_srl;
|
||||
|
||||
|
||||
// get start point of first division
|
||||
if(Context::get('division') === null)
|
||||
{
|
||||
$division_output = executeQuery('document.getDocumentDivision', $division_args)->data;
|
||||
$args->division = $division_output ? $division_output->list_order : 0;
|
||||
}
|
||||
|
||||
|
||||
// get end point of the division
|
||||
if(Context::get('last_division') === null && $args->division)
|
||||
{
|
||||
|
|
@ -1532,11 +1532,11 @@ class DocumentModel extends Document
|
|||
$division_output = executeQuery('document.getDocumentDivision', $division_args)->data;
|
||||
$args->last_division = $division_output ? $division_output->list_order : 0;
|
||||
}
|
||||
|
||||
|
||||
Context::set('division', $args->division);
|
||||
Context::set('last_division', $args->last_division);
|
||||
}
|
||||
|
||||
|
||||
// add default prefix
|
||||
if($args->sort_index && strpos($args->sort_index, '.') === false)
|
||||
{
|
||||
|
|
@ -1581,11 +1581,11 @@ class DocumentModel extends Document
|
|||
$args->list_count = $count;
|
||||
$output = executeQuery('document.getDocumentListByMemberSrl', $args, $columnList);
|
||||
$document_list = $output->data;
|
||||
|
||||
|
||||
if(!$document_list) return array();
|
||||
if(!is_array($document_list)) $document_list = array($document_list);
|
||||
|
||||
return $document_list;
|
||||
return $document_list;
|
||||
}
|
||||
|
||||
public static function getDocumentUpdateLog($document_srl)
|
||||
|
|
|
|||
|
|
@ -53,15 +53,15 @@ class DocumentView extends Document
|
|||
if(!checkCSRF())
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\SecurityViolation;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$content = Context::get('content');
|
||||
|
||||
|
||||
if(Context::get('logged_info')->is_admin != 'Y')
|
||||
{
|
||||
$content = removeHackTag($content);
|
||||
}
|
||||
|
||||
|
||||
// Editor converter
|
||||
$obj = new stdClass;
|
||||
$obj->content = $content;
|
||||
|
|
@ -69,7 +69,7 @@ class DocumentView extends Document
|
|||
$content = getModel('editor')->converter($obj, 'document');
|
||||
$content = sprintf('<div class="document_0_%d rhymix_content xe_content">%s</div>', Context::get('logged_info')->member_srl, $content);
|
||||
Context::set('content', $content);
|
||||
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('preview_page');
|
||||
Context::set('layout', 'none');
|
||||
|
|
@ -107,7 +107,7 @@ class DocumentView extends Document
|
|||
// Set target module info
|
||||
$target_mid = Context::getRequestVars()->mid ?? '';
|
||||
$module_srl = intval(Context::get('module_srl'));
|
||||
|
||||
|
||||
// if target mid is provided
|
||||
if($target_mid && $target_mid === Context::get('mid'))
|
||||
{
|
||||
|
|
@ -134,7 +134,7 @@ class DocumentView extends Document
|
|||
$module_info = ModuleModel::getModuleInfoByModuleSrl($module_srl);
|
||||
$module_srl = $module_info ? $module_info->module_srl : 0;
|
||||
}
|
||||
|
||||
|
||||
Context::set('module_srl', $module_srl);
|
||||
Context::set('mid', $module_info ? $module_info->mid : '');
|
||||
Context::set('browser_title', $module_info ? $module_info->browser_title : '');
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class editorAdminController extends editor
|
|||
{
|
||||
$oModuleController = getController('module');
|
||||
$configVars = Context::getRequestVars();
|
||||
|
||||
|
||||
$config = new stdClass;
|
||||
$config->editor_skin = $configVars->editor_skin;
|
||||
$config->editor_colorset = $configVars->editor_colorset;
|
||||
|
|
@ -166,7 +166,7 @@ class editorAdminController extends editor
|
|||
$config->mobile_comment_editor_height = $configVars->mobile_comment_editor_height;
|
||||
$config->mobile_comment_editor_toolbar = $configVars->mobile_comment_editor_toolbar;
|
||||
$config->mobile_comment_editor_toolbar_hide = $configVars->mobile_comment_editor_toolbar_hide === 'Y' ? 'Y' : 'N';
|
||||
|
||||
|
||||
if ($configVars->font_defined === 'Y')
|
||||
{
|
||||
$config->font_defined = 'Y';
|
||||
|
|
@ -177,7 +177,7 @@ class editorAdminController extends editor
|
|||
$config->font_defined = $configVars->font_defined = 'N';
|
||||
$config->content_font = $configVars->content_font;
|
||||
}
|
||||
|
||||
|
||||
if ($configVars->additional_css)
|
||||
{
|
||||
$additional_css = array_map('trim', explode("\n", $configVars->additional_css));
|
||||
|
|
@ -188,7 +188,7 @@ class editorAdminController extends editor
|
|||
{
|
||||
$config->additional_css = array();
|
||||
}
|
||||
|
||||
|
||||
if ($configVars->additional_mobile_css)
|
||||
{
|
||||
$additional_mobile_css = array_map('trim', explode("\n", $configVars->additional_mobile_css));
|
||||
|
|
@ -199,7 +199,7 @@ class editorAdminController extends editor
|
|||
{
|
||||
$config->additional_mobile_css = array();
|
||||
}
|
||||
|
||||
|
||||
if ($configVars->additional_plugins)
|
||||
{
|
||||
$additional_plugins = array_map('trim', explode(',', $configVars->additional_plugins));
|
||||
|
|
@ -210,7 +210,7 @@ class editorAdminController extends editor
|
|||
{
|
||||
$config->additional_plugins = array();
|
||||
}
|
||||
|
||||
|
||||
if ($configVars->remove_plugins)
|
||||
{
|
||||
$remove_plugins = array_map('trim', explode(',', $configVars->remove_plugins));
|
||||
|
|
@ -221,7 +221,7 @@ class editorAdminController extends editor
|
|||
{
|
||||
$config->remove_plugins = array();
|
||||
}
|
||||
|
||||
|
||||
$config->content_font_size = trim($configVars->content_font_size);
|
||||
$config->content_font_size = ctype_digit($config->content_font_size) ? ($config->content_font_size . 'px') : $config->content_font_size;
|
||||
$config->content_line_height = trim($configVars->content_line_height);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class editorAdminView extends editor
|
|||
$editor_config->$key = $val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get skin info
|
||||
$editor_skin_list = array();
|
||||
$skin_dir_list = FileHandler::readDir($this->module_path . 'skins');
|
||||
|
|
@ -46,7 +46,7 @@ class editorAdminView extends editor
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin);
|
||||
foreach ($skin_info->colorset ?: [] as $colorset)
|
||||
{
|
||||
|
|
@ -81,7 +81,7 @@ class editorAdminView extends editor
|
|||
$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Context::set('editor_config', $editor_config);
|
||||
Context::set('editor_skin_list', $editor_skin_list);
|
||||
Context::set('component_list', $component_list);
|
||||
|
|
@ -108,7 +108,7 @@ class editorAdminView extends editor
|
|||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
Context::set('component', $component);
|
||||
|
||||
|
||||
// Get a group list to set a group
|
||||
$group_list = MemberModel::getGroups(0);
|
||||
Context::set('group_list', $group_list);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* @class editorAPI
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* @brief
|
||||
* @brief
|
||||
*/
|
||||
class editorAPI extends editor
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* @class editor
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* @brief high class of the editor odule
|
||||
* @brief high class of the editor odule
|
||||
*/
|
||||
class editor extends ModuleObject
|
||||
{
|
||||
|
|
@ -17,7 +17,7 @@ class editor extends ModuleObject
|
|||
'default_paragraph_spacing' => '0',
|
||||
'default_word_break' => 'normal',
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Default editor config
|
||||
*/
|
||||
|
|
@ -58,7 +58,7 @@ class editor extends ModuleObject
|
|||
'additional_plugins' => array(),
|
||||
'remove_plugins' => array('liststyle', 'tabletools', 'tableselection', 'contextmenu', 'exportpdf'),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Implement if additional tasks are necessary when installing
|
||||
*/
|
||||
|
|
@ -104,7 +104,7 @@ class editor extends ModuleObject
|
|||
// 2009. 06. 19 Remove unused trigger
|
||||
if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true;
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
|
||||
return false;
|
||||
|
|
@ -117,7 +117,7 @@ class editor extends ModuleObject
|
|||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleController = getController('module');
|
||||
|
||||
|
||||
// XEVE-17-030
|
||||
if(!$oDB->isColumnExists('editor_autosave', 'certify_key'))
|
||||
{
|
||||
|
|
@ -127,23 +127,23 @@ class editor extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex('editor_autosave', 'idx_certify_key', 'certify_key');
|
||||
}
|
||||
|
||||
|
||||
// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
|
||||
if(!ModuleModel::getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
|
||||
if(!ModuleModel::getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
|
||||
$oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
|
||||
if(!ModuleModel::getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
|
||||
if(!ModuleModel::getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'))
|
||||
$oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
|
||||
// 2007. 10. Add an editor trigger on the module addition setup
|
||||
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'))
|
||||
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
|
||||
// 2009. 04. 14 Add a trigger from compiled codes of the editor component
|
||||
if(!ModuleModel::getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'))
|
||||
if(!ModuleModel::getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'))
|
||||
$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
|
||||
// 2009. 06. 19 Remove unused trigger
|
||||
if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'))
|
||||
if(ModuleModel::getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'))
|
||||
$oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before');
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after');
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class editorController extends editor
|
|||
{
|
||||
// Get request vars
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
|
||||
// To configure many of modules at once
|
||||
$target_module_srl = $vars->target_module_srl;
|
||||
$target_module_srl = array_map('trim', explode(',', $target_module_srl));
|
||||
|
|
@ -119,7 +119,7 @@ class editorController extends editor
|
|||
{
|
||||
$config->default_editor_settings = 'N';
|
||||
}
|
||||
|
||||
|
||||
// Apply module-specific editor settings.
|
||||
$config->editor_skin = $vars->editor_skin;
|
||||
$config->editor_colorset = $vars->editor_colorset;
|
||||
|
|
@ -152,7 +152,7 @@ class editorController extends editor
|
|||
$config->font_defined = $vars->font_defined = 'N';
|
||||
$config->content_font = $vars->content_font;
|
||||
}
|
||||
|
||||
|
||||
$config->content_font_size = trim($vars->content_font_size);
|
||||
$config->enable_autosave = $vars->enable_autosave ?: 'Y';
|
||||
$config->auto_dark_mode = $vars->auto_dark_mode ?: 'Y';
|
||||
|
|
@ -217,7 +217,7 @@ class editorController extends editor
|
|||
{
|
||||
$editor_config = getModel('module')->getModuleConfig('editor');
|
||||
}
|
||||
|
||||
|
||||
if ($editor_config)
|
||||
{
|
||||
$default_font_config = self::$default_font_config;
|
||||
|
|
@ -457,7 +457,7 @@ class editorController extends editor
|
|||
{
|
||||
$xml_info->mid_list = $extra_vars->mid_list;
|
||||
}
|
||||
|
||||
|
||||
// Check the configuration of the editor component
|
||||
if(!empty($xml_info->extra_vars))
|
||||
{
|
||||
|
|
@ -469,7 +469,7 @@ class editorController extends editor
|
|||
}
|
||||
|
||||
$component_list->{$component_name} = $xml_info;
|
||||
|
||||
|
||||
// Get buttons, icons, images
|
||||
$icon_file = RX_BASEDIR . 'modules/editor/components/'.$component_name.'/icon.gif';
|
||||
$component_icon_file = RX_BASEDIR . 'modules/editor/components/'.$component_name.'/component_icon.gif';
|
||||
|
|
@ -500,7 +500,7 @@ class editorController extends editor
|
|||
{
|
||||
Rhymix\Framework\Cache::set('editor:components:all', $component_list, 0, true);
|
||||
}
|
||||
|
||||
|
||||
return $component_list;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class editorModel extends editor
|
|||
*/
|
||||
protected static $_module_config = array();
|
||||
protected static $_loaded_component_list = array();
|
||||
|
||||
|
||||
/**
|
||||
* @brief Return the editor
|
||||
*
|
||||
|
|
@ -45,7 +45,7 @@ class editorModel extends editor
|
|||
{
|
||||
$editor_config = new stdClass;
|
||||
}
|
||||
|
||||
|
||||
// Fill in some other values.
|
||||
$grant_vars = array(
|
||||
'enable_html_grant',
|
||||
|
|
@ -64,10 +64,10 @@ class editorModel extends editor
|
|||
$editor_config->{$var} = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Load the default config for editor module.
|
||||
$editor_default_config = ModuleModel::getModuleConfig('editor') ?: new stdClass;
|
||||
|
||||
|
||||
// Check whether we should use the default config.
|
||||
if(!isset($editor_config->default_editor_settings) || $editor_config->default_editor_settings !== 'Y')
|
||||
{
|
||||
|
|
@ -80,7 +80,7 @@ class editorModel extends editor
|
|||
{
|
||||
$editor_config->default_editor_settings = 'Y';
|
||||
}
|
||||
|
||||
|
||||
// Apply the default config for missing values.
|
||||
foreach (self::$default_editor_config as $key => $val)
|
||||
{
|
||||
|
|
@ -89,7 +89,7 @@ class editorModel extends editor
|
|||
$editor_config->$key = isset($editor_default_config->$key) ? $editor_default_config->$key : $val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $editor_config;
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ class editorModel extends editor
|
|||
public static function getSkinConfig($skin_name)
|
||||
{
|
||||
$skin_config = new stdClass;
|
||||
|
||||
|
||||
if($skin_info = ModuleModel::loadSkinInfo('./modules/editor', $skin_name))
|
||||
{
|
||||
foreach ($skin_info->extra_vars as $val)
|
||||
|
|
@ -107,7 +107,7 @@ class editorModel extends editor
|
|||
$skin_config->{$val->name} = $val->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $skin_config;
|
||||
}
|
||||
|
||||
|
|
@ -120,12 +120,12 @@ class editorModel extends editor
|
|||
{
|
||||
// Load language files.
|
||||
Context::loadLang('./modules/editor/lang');
|
||||
|
||||
|
||||
// Initialize options.
|
||||
if (!is_object($option))
|
||||
{
|
||||
$option = new stdClass;
|
||||
|
||||
|
||||
}
|
||||
// Set editor sequence and upload options.
|
||||
if ($upload_target_srl)
|
||||
|
|
@ -140,7 +140,7 @@ class editorModel extends editor
|
|||
Context::set('allow_fileupload', $option->allow_fileupload = toBool($option->allow_fileupload));
|
||||
Context::set('upload_target_srl', $upload_target_srl);
|
||||
Context::set('editor_sequence', $option->editor_sequence);
|
||||
|
||||
|
||||
// Check that the skin exist.
|
||||
if (!$option->editor_skin)
|
||||
{
|
||||
|
|
@ -173,7 +173,7 @@ class editorModel extends editor
|
|||
Context::set('editor_toolbar', $option->editor_toolbar);
|
||||
Context::set('editor_toolbar_hide', toBool($option->editor_toolbar_hide));
|
||||
Context::set('module_type', $option->module_type);
|
||||
|
||||
|
||||
// Default font setting
|
||||
Context::set('content_font', $option->content_font);
|
||||
Context::set('content_font_size', $option->content_font_size);
|
||||
|
|
@ -185,13 +185,13 @@ class editorModel extends editor
|
|||
Context::set('editor_additional_css', $option->additional_css);
|
||||
Context::set('editor_additional_plugins', $option->additional_plugins);
|
||||
Context::set('editor_remove_plugins', $option->remove_plugins);
|
||||
|
||||
|
||||
// Set the primary key valueof the document or comments
|
||||
Context::set('editor_primary_key_name', $option->primary_key_name);
|
||||
|
||||
|
||||
// Set content column name to sync contents
|
||||
Context::set('editor_content_key_name', $option->content_key_name);
|
||||
|
||||
|
||||
// Set autosave (do not use if the post is edited)
|
||||
$option->enable_autosave = toBool($option->enable_autosave) && !Context::get($option->primary_key_name);
|
||||
if ($option->enable_autosave)
|
||||
|
|
@ -199,12 +199,12 @@ class editorModel extends editor
|
|||
Context::set('saved_doc', self::getSavedDoc($upload_target_srl));
|
||||
}
|
||||
Context::set('enable_autosave', $option->enable_autosave);
|
||||
|
||||
|
||||
// Set allow html and focus
|
||||
Context::set('allow_html', ($option->allow_html === false || $option->allow_html === 'N') ? false : true);
|
||||
Context::set('editor_focus', toBool($option->editor_focus));
|
||||
Context::set('editor_auto_dark_mode', $option->auto_dark_mode !== 'N');
|
||||
|
||||
|
||||
// Load editor components.
|
||||
if($option->enable_component)
|
||||
{
|
||||
|
|
@ -241,7 +241,7 @@ class editorModel extends editor
|
|||
{
|
||||
$file_config->allowed_chunk_size = floor($file_config->allowed_chunk_size / 65536) * 65536;
|
||||
}
|
||||
|
||||
|
||||
// Do not allow chunked uploads in IE < 10, Android browser, and Opera
|
||||
$browser = Rhymix\Framework\UA::getBrowserInfo();
|
||||
if (($browser->browser === 'IE' && version_compare($browser->version, '10', '<')) || $browser->browser === 'Android' || $browser->browser === 'Opera')
|
||||
|
|
@ -268,7 +268,7 @@ class editorModel extends editor
|
|||
// Compile and return the editor skin template.
|
||||
$tpl_path = Context::get('editor_path');
|
||||
Context::loadLang($tpl_path.'lang');
|
||||
|
||||
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
return $oTemplate->compile($tpl_path, 'editor.html');
|
||||
}
|
||||
|
|
@ -287,7 +287,7 @@ class editorModel extends editor
|
|||
|
||||
// Check mobile status
|
||||
$is_mobile = Mobile::isFromMobilePhone() || \Rhymix\Framework\UA::isMobile();
|
||||
|
||||
|
||||
// Initialize options
|
||||
$option = new stdClass();
|
||||
$option->module_type = $type;
|
||||
|
|
@ -335,7 +335,7 @@ class editorModel extends editor
|
|||
$option->additional_css = $option->additional_mobile_css;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check a group_list of the currently logged-in user for permission check
|
||||
if(Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -346,7 +346,7 @@ class editorModel extends editor
|
|||
{
|
||||
$group_list = array();
|
||||
}
|
||||
|
||||
|
||||
// Permission check for file upload
|
||||
if($module_srl)
|
||||
{
|
||||
|
|
@ -367,7 +367,7 @@ class editorModel extends editor
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Permission check for using default components
|
||||
if ($logged_info->is_admin === 'Y' || !count($option->enable_default_component_grant))
|
||||
{
|
||||
|
|
@ -385,7 +385,7 @@ class editorModel extends editor
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Permisshion check for using extended components
|
||||
if($logged_info->is_admin === 'Y' || !count($option->enable_component_grant))
|
||||
{
|
||||
|
|
@ -403,7 +403,7 @@ class editorModel extends editor
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// HTML editing privileges
|
||||
if($logged_info->is_admin === 'Y' || !count($option->enable_html_grant))
|
||||
{
|
||||
|
|
@ -421,7 +421,7 @@ class editorModel extends editor
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Other settings
|
||||
$option->primary_key_name = $primary_key_name;
|
||||
$option->content_key_name = $content_key_name;
|
||||
|
|
@ -468,7 +468,7 @@ class editorModel extends editor
|
|||
{
|
||||
$saved_doc = array_first($saved_doc);
|
||||
}
|
||||
|
||||
|
||||
// Return null if certify key does not match
|
||||
if($saved_doc->certify_key && !isset($auto_save_args->certify_key))
|
||||
{
|
||||
|
|
@ -683,7 +683,7 @@ class editorModel extends editor
|
|||
$xml_file = sprintf('%sinfo.xml', $component_path);
|
||||
$xml_mtime = filemtime($xml_file);
|
||||
$lang_type = Context::getLangType();
|
||||
|
||||
|
||||
// Get from cache
|
||||
$cache_key = sprintf('editor:component:%s:%s:%d', $component, $lang_type, $xml_mtime);
|
||||
$info = Rhymix\Framework\Cache::get($cache_key);
|
||||
|
|
@ -691,15 +691,15 @@ class editorModel extends editor
|
|||
{
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
// Parse XML file
|
||||
$info = Rhymix\Framework\Parsers\EditorComponentParser::loadXML($xml_file, $component, $lang_type);
|
||||
|
||||
|
||||
// Set to cache and return
|
||||
Rhymix\Framework\Cache::set($cache_key, $info, 0, true);
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return converted content
|
||||
* @param object $obj
|
||||
|
|
@ -709,7 +709,7 @@ class editorModel extends editor
|
|||
{
|
||||
$converter = null;
|
||||
$config = self::getEditorConfig($obj->module_srl);
|
||||
|
||||
|
||||
// Get editor skin
|
||||
if (in_array($type, array('document', 'comment')))
|
||||
{
|
||||
|
|
@ -720,13 +720,13 @@ class editorModel extends editor
|
|||
$converter = $obj->converter;
|
||||
$skin = $obj->editor_skin ?: $config->editor_skin;
|
||||
}
|
||||
|
||||
|
||||
// if not inserted converter, Get converter from skin
|
||||
if (!$converter)
|
||||
{
|
||||
$converter = self::getSkinConfig($skin)->converter;
|
||||
}
|
||||
|
||||
|
||||
// if not inserted converter, Check
|
||||
if (!$converter)
|
||||
{
|
||||
|
|
@ -743,7 +743,7 @@ class editorModel extends editor
|
|||
$converter = 'nl2br';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Convert
|
||||
if ($converter)
|
||||
{
|
||||
|
|
@ -751,13 +751,13 @@ class editorModel extends editor
|
|||
{
|
||||
// Remove Tag
|
||||
$obj->content = strip_tags($obj->content);
|
||||
|
||||
|
||||
// Trim space
|
||||
$obj->content = utf8_trim($obj->content);
|
||||
|
||||
|
||||
// Escape
|
||||
$obj->content = escape($obj->content, false);
|
||||
|
||||
|
||||
// Insert HTML line
|
||||
$obj->content = nl2br($obj->content);
|
||||
}
|
||||
|
|
@ -778,7 +778,7 @@ class editorModel extends editor
|
|||
$obj->content = nl2br($obj->content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $obj->content;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class editorView extends editor
|
|||
$parent_input_id = Context::get('parent_input_id');
|
||||
Context::set('parent_input_id', preg_replace('/[^a-z0-9_]/i', '', $parent_input_id));
|
||||
Context::addBodyClass('disable_debug_panel');
|
||||
|
||||
|
||||
// Load editor
|
||||
$oEditorModel = getModel('editor');
|
||||
$option = $oEditorModel->getEditorConfig();
|
||||
|
|
@ -40,7 +40,7 @@ class editorView extends editor
|
|||
$option->editor_focus = 'Y';
|
||||
$editor = $oEditorModel->getEditor(0, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
|
||||
// Set template
|
||||
$this->setLayoutPath('./common/tpl/');
|
||||
$this->setLayoutFile("default_layout");
|
||||
|
|
@ -124,7 +124,7 @@ class editorView extends editor
|
|||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new BaseObject();
|
||||
}
|
||||
|
||||
|
||||
// Get editors settings
|
||||
$oEditorModel = getModel('editor');
|
||||
$editor_config = $oEditorModel->getEditorConfig($current_module_srl);
|
||||
|
|
@ -151,7 +151,7 @@ class editorView extends editor
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$skin_info = ModuleModel::loadSkinInfo($this->module_path, $skin);
|
||||
foreach ($skin_info->colorset ?: [] as $colorset)
|
||||
{
|
||||
|
|
@ -162,7 +162,7 @@ class editorView extends editor
|
|||
|
||||
Context::set('editor_config', $editor_config);
|
||||
Context::set('editor_skin_list', $editor_skin_list);
|
||||
|
||||
|
||||
// Get a group list
|
||||
$group_list = MemberModel::getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
|
@ -195,7 +195,7 @@ class editorView extends editor
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest();
|
||||
}
|
||||
|
||||
|
||||
$skin_info = ModuleModel::loadSkinInfo($this->module_path,$skin);
|
||||
$colorset = $skin_info->colorset ?? null;
|
||||
Context::set('colorset', $colorset);
|
||||
|
|
@ -204,7 +204,7 @@ class editorView extends editor
|
|||
function dispEditorConfigPreview()
|
||||
{
|
||||
Context::set('editor', getModel('editor')->getModuleEditor(Context::get('type'), 0, 0, 'dummy_key', 'dummy_content'));
|
||||
|
||||
|
||||
$this->setLayoutFile('default_layout');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('config_preview');
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ class FileAdminController extends File
|
|||
|
||||
$oFileController->deleteFile($file_srl);
|
||||
}
|
||||
|
||||
|
||||
$this->setMessage(sprintf(lang('msg_checked_file_is_deleted'), $file_count));
|
||||
|
||||
|
||||
$redirect_url = $_SERVER['HTTP_REFERER'] ?? '';
|
||||
if (!$redirect_url || !Rhymix\Framework\URL::isInternalURL($redirect_url))
|
||||
{
|
||||
|
|
@ -94,7 +94,7 @@ class FileAdminController extends File
|
|||
$config->ffmpeg_command = escape(utf8_trim(Context::get('ffmpeg_command'))) ?: '/usr/bin/ffmpeg';
|
||||
$config->ffprobe_command = escape(utf8_trim(Context::get('ffprobe_command'))) ?: '/usr/bin/ffprobe';
|
||||
}
|
||||
|
||||
|
||||
// Check maximum file size
|
||||
if (PHP_INT_SIZE < 8)
|
||||
{
|
||||
|
|
@ -103,7 +103,7 @@ class FileAdminController extends File
|
|||
throw new Rhymix\Framework\Exception('msg_32bit_max_2047mb');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Simplify allowed_filetypes
|
||||
$config->allowed_extensions = strtr(strtolower(trim($config->allowed_filetypes)), array('*.' => '', ';' => ','));
|
||||
if ($config->allowed_extensions)
|
||||
|
|
@ -120,7 +120,7 @@ class FileAdminController extends File
|
|||
$config->allowed_extensions = array();
|
||||
$config->allowed_filetypes = '*.*';
|
||||
}
|
||||
|
||||
|
||||
// Save and redirect
|
||||
$output = getController('module')->insertModuleConfig('file', $config);
|
||||
$returnUrl = Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispFileAdminUploadConfig');
|
||||
|
|
@ -142,7 +142,7 @@ class FileAdminController extends File
|
|||
$config->allow_multimedia_direct_download = Context::get('allow_multimedia_direct_download') === 'Y' ? 'Y' : 'N';
|
||||
$config->download_short_url = Context::get('download_short_url') === 'Y' ? 'Y' : 'N';
|
||||
$config->inline_download_format = array_map('utf8_trim', Context::get('inline_download_format') ?: []);
|
||||
|
||||
|
||||
// Save and redirect
|
||||
$output = getController('module')->insertModuleConfig('file', $config);
|
||||
$returnUrl = Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispFileAdminDownloadConfig');
|
||||
|
|
@ -159,7 +159,7 @@ class FileAdminController extends File
|
|||
// Update configuration
|
||||
$config = getModel('module')->getModuleConfig('file') ?: new stdClass;
|
||||
$config->save_changelog = Context::get('save_changelog') === 'Y' ? 'Y' : 'N';
|
||||
|
||||
|
||||
// Save and redirect
|
||||
$output = getController('module')->insertModuleConfig('file', $config);
|
||||
$returnUrl = Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispFileAdminOtherConfig');
|
||||
|
|
@ -174,7 +174,7 @@ class FileAdminController extends File
|
|||
function procFileAdminInsertModuleConfig()
|
||||
{
|
||||
$config = new stdClass;
|
||||
|
||||
|
||||
// Default
|
||||
if(!Context::get('use_default_file_config'))
|
||||
{
|
||||
|
|
@ -182,7 +182,7 @@ class FileAdminController extends File
|
|||
$config->allowed_filesize = Context::get('allowed_filesize');
|
||||
$config->allowed_attach_size = Context::get('allowed_attach_size');
|
||||
$config->allowed_filetypes = Context::get('allowed_filetypes');
|
||||
|
||||
|
||||
// Check maximum file size
|
||||
if (PHP_INT_SIZE < 8)
|
||||
{
|
||||
|
|
@ -191,7 +191,7 @@ class FileAdminController extends File
|
|||
throw new Rhymix\Framework\Exception('msg_32bit_max_2047mb');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Simplify allowed_filetypes
|
||||
$config->allowed_extensions = strtr(strtolower(trim($config->allowed_filetypes)), array('*.' => '', ';' => ','));
|
||||
if ($config->allowed_extensions)
|
||||
|
|
@ -209,7 +209,7 @@ class FileAdminController extends File
|
|||
$config->allowed_filetypes = '*.*';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Image
|
||||
if(!Context::get('use_image_default_file_config'))
|
||||
{
|
||||
|
|
@ -227,7 +227,7 @@ class FileAdminController extends File
|
|||
$config->image_autorotate = Context::get('image_autorotate') === 'Y' ? true : false;
|
||||
$config->image_remove_exif_data = Context::get('image_remove_exif_data') === 'Y' ? true : false;
|
||||
}
|
||||
|
||||
|
||||
// Video
|
||||
if(!Context::get('use_video_default_file_config'))
|
||||
{
|
||||
|
|
@ -235,11 +235,11 @@ class FileAdminController extends File
|
|||
$config->video_thumbnail = Context::get('video_thumbnail') === 'Y' ? true : false;
|
||||
$config->video_mp4_gif_time = intval(Context::get('video_mp4_gif_time'));
|
||||
}
|
||||
|
||||
|
||||
// Set download groups
|
||||
$download_grant = Context::get('download_grant');
|
||||
$config->download_grant = is_array($download_grant) ? array_values($download_grant) : array($download_grant);
|
||||
|
||||
|
||||
// Update
|
||||
$oModuleController = getController('module');
|
||||
foreach(explode(',', Context::get('target_module_srl')) as $module_srl)
|
||||
|
|
@ -250,7 +250,7 @@ class FileAdminController extends File
|
|||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated', 'info');
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminContent'));
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class FileAdminModel extends File
|
|||
* - isvaild
|
||||
* - regdate
|
||||
* - ipaddress
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param object $obj Search options
|
||||
|
|
@ -72,13 +72,13 @@ class FileAdminModel extends File
|
|||
{
|
||||
$args->isvalid = $obj->isvalid;
|
||||
}
|
||||
|
||||
|
||||
// Set multimedia/common file
|
||||
if(isset($obj->direct_download) && in_array($obj->direct_download, ['Y', 'N']))
|
||||
{
|
||||
$args->direct_download = $obj->direct_download;
|
||||
}
|
||||
|
||||
|
||||
// Set variables
|
||||
$args->sort_index = $obj->sort_index ?? null;
|
||||
$args->order_type = $obj->order_type ?? 'desc';
|
||||
|
|
@ -97,7 +97,7 @@ class FileAdminModel extends File
|
|||
{
|
||||
$output = executeQueryArray('file.getFileList', $args, $columnList);
|
||||
}
|
||||
|
||||
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool() || !count($output->data))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class FileAdminView extends File
|
|||
// Get a list
|
||||
$oFileAdminModel = getAdminModel('file');
|
||||
$output = $oFileAdminModel->getFileList($args);
|
||||
|
||||
|
||||
// Get the document for looping a list
|
||||
if($output->data)
|
||||
{
|
||||
|
|
@ -60,7 +60,7 @@ class FileAdminView extends File
|
|||
// Find and update if upload_target_type doesn't exist
|
||||
if(!$file->upload_target_type)
|
||||
{
|
||||
// Pass if upload_target_type is already found
|
||||
// Pass if upload_target_type is already found
|
||||
if(isset($document_list[$target_srl]))
|
||||
{
|
||||
$file->upload_target_type = 'doc';
|
||||
|
|
@ -223,7 +223,7 @@ class FileAdminView extends File
|
|||
$config = $oFileModel->getFileConfig();
|
||||
Context::set('config', $config);
|
||||
Context::set('is_ffmpeg', function_exists('exec') && Rhymix\Framework\Storage::isExecutable($config->ffmpeg_command) && Rhymix\Framework\Storage::isExecutable($config->ffprobe_command));
|
||||
|
||||
|
||||
// Set a template file
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('upload_config');
|
||||
|
|
@ -239,7 +239,7 @@ class FileAdminView extends File
|
|||
$oFileModel = getModel('file');
|
||||
$config = $oFileModel->getFileConfig();
|
||||
Context::set('config',$config);
|
||||
|
||||
|
||||
// Set a template file
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('download_config');
|
||||
|
|
@ -255,7 +255,7 @@ class FileAdminView extends File
|
|||
$oFileModel = getModel('file');
|
||||
$config = $oFileModel->getFileConfig();
|
||||
Context::set('config',$config);
|
||||
|
||||
|
||||
// Set a template file
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('other_config');
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ class File extends ModuleObject
|
|||
{
|
||||
// Register action forward (to use in administrator mode)
|
||||
$oModuleController = getController('module');
|
||||
|
||||
|
||||
// Generate a directory for the file module
|
||||
FileHandler::makeDir('./files/attach/images');
|
||||
FileHandler::makeDir('./files/attach/binaries');
|
||||
|
||||
|
||||
// 2007. 10. 17 Create a trigger to insert, update, delete documents and comments
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'file', 'controller', 'triggerDeleteAttached', 'after');
|
||||
$oModuleController->insertTrigger('comment.deleteComment', 'file', 'controller', 'triggerCommentDeleteAttached', 'after');
|
||||
|
|
@ -45,12 +45,12 @@ class File extends ModuleObject
|
|||
if($oModuleModel->getTrigger('document.insertDocument', 'file', 'controller', 'triggerAttachFiles', 'after')) return true;
|
||||
if($oModuleModel->getTrigger('document.updateDocument', 'file', 'controller', 'triggerCheckAttached', 'before')) return true;
|
||||
if($oModuleModel->getTrigger('document.updateDocument', 'file', 'controller', 'triggerAttachFiles', 'after')) return true;
|
||||
|
||||
|
||||
if($oModuleModel->getTrigger('comment.insertComment', 'file', 'controller', 'triggerCommentCheckAttached', 'before')) return true;
|
||||
if($oModuleModel->getTrigger('comment.insertComment', 'file', 'controller', 'triggerCommentAttachFiles', 'after')) return true;
|
||||
if($oModuleModel->getTrigger('comment.updateComment', 'file', 'controller', 'triggerCommentCheckAttached', 'before')) return true;
|
||||
if($oModuleModel->getTrigger('comment.updateComment', 'file', 'controller', 'triggerCommentAttachFiles', 'after')) return true;
|
||||
|
||||
|
||||
// 2007. 10. 17 Create a trigger to insert, update, delete documents and comments
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'file', 'controller', 'triggerDeleteAttached', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('comment.deleteComment', 'file', 'controller', 'triggerCommentDeleteAttached', 'after')) return true;
|
||||
|
|
@ -63,11 +63,11 @@ class File extends ModuleObject
|
|||
// A column to determine a target type
|
||||
if(!$oDB->isColumnExists('files', 'upload_target_type')) return true;
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'file', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
|
||||
if(!$oDB->isColumnExists('files', 'cover_image')) return true;
|
||||
|
||||
|
||||
if(!$oModuleModel->getTrigger('document.moveDocumentModule', 'file', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
return true;
|
||||
|
|
@ -165,7 +165,7 @@ class File extends ModuleObject
|
|||
{
|
||||
$oModuleController->deleteTrigger('comment.updateComment', 'file', 'controller', 'triggerCommentAttachFiles', 'after');
|
||||
}
|
||||
|
||||
|
||||
// 2007. 10. 17 Create a trigger to insert, update, delete documents and comments
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'file', 'controller', 'triggerDeleteAttached', 'after'))
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'file', 'controller', 'triggerDeleteAttached', 'after');
|
||||
|
|
@ -184,14 +184,14 @@ class File extends ModuleObject
|
|||
// A column to determine a target type
|
||||
if(!$oDB->isColumnExists('files', 'upload_target_type')) $oDB->addColumn('files', 'upload_target_type', 'char', '3');
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'file', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'file', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists('files', 'cover_image')) $oDB->addColumn('files', 'cover_image', 'char', '1', 'N');
|
||||
|
||||
|
||||
if(!$oModuleModel->getTrigger('document.moveDocumentModule', 'file', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('document.moveDocumentModule', 'file', 'controller', 'triggerMoveDocument', 'after');
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ class FileController extends File
|
|||
// Basic variables setting
|
||||
$editor_sequence = Context::get('editor_sequence');
|
||||
$module_srl = $this->module_srl;
|
||||
|
||||
|
||||
// Exit a session if there is neither upload permission nor information
|
||||
if(!$_SESSION['upload_info'][$editor_sequence]->enabled)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// Get upload_target_srl
|
||||
$upload_target_srl = intval(Context::get('uploadTargetSrl')) ?: intval(Context::get('upload_target_srl'));
|
||||
if (!$upload_target_srl)
|
||||
|
|
@ -52,7 +52,7 @@ class FileController extends File
|
|||
$upload_target_srl = getNextSequence();
|
||||
$_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl;
|
||||
}
|
||||
|
||||
|
||||
// Handle chunking
|
||||
if (preg_match('!^bytes (\d+)-(\d+)/(\d+)$!', $_SERVER['HTTP_CONTENT_RANGE'], $matches))
|
||||
{
|
||||
|
|
@ -66,7 +66,7 @@ class FileController extends File
|
|||
}
|
||||
$this->add('chunk_current_size', $chunk_size);
|
||||
$this->add('chunk_uploaded_size', $chunk_start);
|
||||
|
||||
|
||||
// Check existing chunks
|
||||
$temp_key = hash_hmac('sha1', sprintf('%d:%d:%d:%s:%s', $editor_sequence, $upload_target_srl, $module_srl, $file_info['name'], session_id()), config('crypto.authentication_key'));
|
||||
$temp_filename = RX_BASEDIR . 'files/attach/chunks/' . $temp_key;
|
||||
|
|
@ -82,7 +82,7 @@ class FileController extends File
|
|||
$this->add('chunk_status', 12);
|
||||
throw new Rhymix\Framework\Exception('msg_upload_invalid_chunk');
|
||||
}
|
||||
|
||||
|
||||
// Check size limit
|
||||
$is_admin = (Context::get('logged_info')->is_admin === 'Y');
|
||||
if (!$is_admin)
|
||||
|
|
@ -102,7 +102,7 @@ class FileController extends File
|
|||
throw new Rhymix\Framework\Exception('msg_exceeds_limit_size');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Append to chunk
|
||||
$fp = fopen($file_info['tmp_name'], 'r');
|
||||
$success = Rhymix\Framework\Storage::write($temp_filename, $fp, 'a');
|
||||
|
|
@ -135,14 +135,14 @@ class FileController extends File
|
|||
{
|
||||
$this->add('chunk_status', -1);
|
||||
}
|
||||
|
||||
|
||||
// Save the file
|
||||
$output = $this->insertFile($file_info, $module_srl, $upload_target_srl);
|
||||
if($output->error != '0')
|
||||
{
|
||||
throw new Rhymix\Framework\Exception($output->message);
|
||||
}
|
||||
|
||||
|
||||
// Create the response
|
||||
Context::setResponseMethod('JSON');
|
||||
$this->add('file_srl', $output->get('file_srl'));
|
||||
|
|
@ -303,7 +303,7 @@ class FileController extends File
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\TargetNotFound('msg_file_not_found');
|
||||
}
|
||||
|
||||
|
||||
// Not allow the file outlink
|
||||
$file_module_config = FileModel::getFileConfig($file_obj->module_srl);
|
||||
if($file_module_config->allow_outlink == 'N' && $_SERVER["HTTP_REFERER"])
|
||||
|
|
@ -355,13 +355,13 @@ class FileController extends File
|
|||
throw new Rhymix\Framework\Exceptions\NotPermitted('msg_not_allowed_outlink');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if the file is downloadable
|
||||
if(!FileModel::isDownloadable($file_obj))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted('msg_not_permitted_download');
|
||||
}
|
||||
|
||||
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('file.downloadFile', 'before', $file_obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -389,7 +389,7 @@ class FileController extends File
|
|||
$file_key_data = sprintf('%d:%d:%s:%s', $file_obj->file_srl, $file_key_timestamp, $file_obj->uploaded_filename, \RX_CLIENT_IP);
|
||||
$file_key_sig = \Rhymix\Framework\Security::createSignature($file_key_data);
|
||||
$file_key = dechex($file_key_timestamp) . $file_key_sig;
|
||||
|
||||
|
||||
// Use short URL or long URL
|
||||
if ($file_module_config->download_short_url === 'Y' && config('use_rewrite'))
|
||||
{
|
||||
|
|
@ -399,7 +399,7 @@ class FileController extends File
|
|||
{
|
||||
$url = getNotEncodedUrl('', 'module', 'file', 'act', 'procFileOutput', 'file_srl', $file_srl, 'file_key', $file_key, 'force_download', Context::get('force_download') === 'Y' ? 'Y' : null);
|
||||
}
|
||||
|
||||
|
||||
header('X-Robots-Tag: noindex');
|
||||
header('Location: ' . $url);
|
||||
Context::close();
|
||||
|
|
@ -412,7 +412,7 @@ class FileController extends File
|
|||
$file_srl = Context::get('file_srl');
|
||||
$file_key = Context::get('file_key');
|
||||
$filename_arg = Context::get('filename');
|
||||
|
||||
|
||||
$columnList = array('source_filename', 'uploaded_filename', 'file_size');
|
||||
$file_obj = FileModel::getFile($file_srl, $columnList);
|
||||
$file_config = FileModel::getFileConfig($file_obj->module_srl ?: null);
|
||||
|
|
@ -435,13 +435,13 @@ class FileController extends File
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
// Check filename if given
|
||||
if ($filename_arg !== null && $filename_arg !== $filename)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\TargetNotFound('msg_file_not_found');
|
||||
}
|
||||
|
||||
|
||||
// Check if file exists
|
||||
$uploaded_filename = $file_obj->uploaded_filename;
|
||||
if(!file_exists($uploaded_filename))
|
||||
|
|
@ -453,7 +453,7 @@ class FileController extends File
|
|||
if(isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim(trim($_SERVER['HTTP_IF_NONE_MATCH']), '\'"') === $etag)
|
||||
{
|
||||
header('HTTP/1.1 304 Not Modified');
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
// If client sent an If-Modified-Since header with a recent modification date, do not download again
|
||||
|
|
@ -532,19 +532,19 @@ class FileController extends File
|
|||
{
|
||||
$download_type = 'attachment';
|
||||
}
|
||||
|
||||
|
||||
// Clear buffer
|
||||
while(ob_get_level()) ob_end_clean();
|
||||
|
||||
|
||||
// Set filename headers
|
||||
header('Content-Type: ' . $mime_type);
|
||||
header('Content-Disposition: ' . $download_type . $filename_param);
|
||||
|
||||
|
||||
// Set cache headers
|
||||
header('Cache-Control: private; max-age=3600');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
header('Pragma: ');
|
||||
|
||||
|
||||
// Set other headers
|
||||
header('Content-Length: ' . $range_length);
|
||||
header('Accept-Ranges: bytes');
|
||||
|
|
@ -610,13 +610,13 @@ class FileController extends File
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !== 'Y' && !ModuleModel::isSiteAdmin($logged_info))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$fileSrls = Context::get('file_srls');
|
||||
if($fileSrls) $fileSrlList = explode(',', $fileSrls);
|
||||
|
||||
|
|
@ -692,7 +692,7 @@ class FileController extends File
|
|||
{
|
||||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl) return;
|
||||
|
||||
|
||||
return $this->deleteModuleFiles($module_srl);
|
||||
}
|
||||
|
||||
|
|
@ -723,7 +723,7 @@ class FileController extends File
|
|||
}
|
||||
$_SESSION['upload_info'][$editor_sequence]->enabled = true;
|
||||
$_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl;
|
||||
|
||||
|
||||
return $editor_sequence;
|
||||
}
|
||||
|
||||
|
|
@ -788,13 +788,13 @@ class FileController extends File
|
|||
$trigger_obj->upload_target_srl = $upload_target_srl;
|
||||
$output = ModuleHandler::triggerCall('file.insertFile', 'before', $trigger_obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
||||
// A workaround for Firefox upload bug
|
||||
if(preg_match('/^=\?UTF-8\?B\?(.+)\?=$/i', $file_info['name'], $match))
|
||||
{
|
||||
$file_info['name'] = base64_decode(strtr($match[1], ':', '/'));
|
||||
}
|
||||
|
||||
|
||||
// Set base information
|
||||
$file_info['name'] = Rhymix\Framework\Filters\FilenameFilter::clean($file_info['name']);
|
||||
$file_info['type'] = $file_info['original_type'] = Rhymix\Framework\MIME::getContentType($file_info['tmp_name']);
|
||||
|
|
@ -804,7 +804,7 @@ class FileController extends File
|
|||
$file_info['duration'] = null;
|
||||
$file_info['thumbnail'] = null;
|
||||
$file_info['converted'] = false;
|
||||
|
||||
|
||||
// Correct extension
|
||||
if($file_info['extension'])
|
||||
{
|
||||
|
|
@ -818,10 +818,10 @@ class FileController extends File
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get file module configuration
|
||||
$config = FileModel::getFileConfig($module_srl);
|
||||
|
||||
|
||||
// Check file extension
|
||||
if(!$manual_insert && !$this->user->isAdmin())
|
||||
{
|
||||
|
|
@ -830,7 +830,7 @@ class FileController extends File
|
|||
throw new Rhymix\Framework\Exception('msg_not_allowed_filetype');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust
|
||||
if(!$manual_insert)
|
||||
{
|
||||
|
|
@ -839,14 +839,14 @@ class FileController extends File
|
|||
{
|
||||
$file_info = $this->adjustUploadedImage($file_info, $config);
|
||||
}
|
||||
|
||||
|
||||
// video
|
||||
if(in_array($file_info['extension'], ['mp4', 'webm', 'ogv']))
|
||||
{
|
||||
$file_info = $this->adjustUploadedVideo($file_info, $config);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check file size
|
||||
if(!$manual_insert && !$this->user->isAdmin())
|
||||
{
|
||||
|
|
@ -857,7 +857,7 @@ class FileController extends File
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_exceeds_limit_size');
|
||||
}
|
||||
|
||||
|
||||
$size_args = new stdClass;
|
||||
$size_args->upload_target_srl = $upload_target_srl;
|
||||
$output = executeQuery('file.getAttachedFileSize', $size_args);
|
||||
|
|
@ -866,7 +866,7 @@ class FileController extends File
|
|||
throw new Rhymix\Framework\Exception('msg_exceeds_limit_size');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass;
|
||||
$args->file_srl = getNextSequence();
|
||||
$args->regdate = date('YmdHis');
|
||||
|
|
@ -880,20 +880,20 @@ class FileController extends File
|
|||
$args->width = $file_info['width'];
|
||||
$args->height = $file_info['height'];
|
||||
$args->duration = $file_info['duration'];
|
||||
|
||||
|
||||
// Set original type
|
||||
$args->original_type = null;
|
||||
if($file_info['type'] !== $file_info['original_type'])
|
||||
{
|
||||
$args->original_type = $file_info['original_type'];
|
||||
}
|
||||
|
||||
|
||||
// Add changed extension
|
||||
if($file_info['extension'] && $file_info['extension'] !== $file_info['original_extension'])
|
||||
{
|
||||
$args->source_filename .= '.' . $file_info['extension'];
|
||||
}
|
||||
|
||||
|
||||
// Set storage path by checking if the attachement is an image or other kinds of file
|
||||
if($direct = Rhymix\Framework\Filters\FilenameFilter::isDirectDownload($args->source_filename))
|
||||
{
|
||||
|
|
@ -903,7 +903,7 @@ class FileController extends File
|
|||
{
|
||||
$storage_path = $this->getStoragePath('binaries', $args->file_srl, $module_srl, $upload_target_srl, $args->regdate);
|
||||
}
|
||||
|
||||
|
||||
if($config->allow_multimedia_direct_download !== 'N')
|
||||
{
|
||||
$args->direct_download = $direct ? 'Y' : 'N';
|
||||
|
|
@ -912,13 +912,13 @@ class FileController extends File
|
|||
{
|
||||
$args->direct_download = Rhymix\Framework\Filters\FilenameFilter::isDirectDownload($args->source_filename, false) ? 'Y' : 'N';
|
||||
}
|
||||
|
||||
|
||||
// Create a directory
|
||||
if(!Rhymix\Framework\Storage::isDirectory($storage_path) && !Rhymix\Framework\Storage::createDirectory($storage_path))
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_not_permitted_create');
|
||||
}
|
||||
|
||||
|
||||
// Set move type and uploaded filename
|
||||
$move_type = $manual_insert ? 'copy' : '';
|
||||
if($file_info['converted'] || starts_with(RX_BASEDIR . 'files/attach/chunks/', $file_info['tmp_name']))
|
||||
|
|
@ -931,7 +931,7 @@ class FileController extends File
|
|||
{
|
||||
$uploaded_filename = $storage_path . Rhymix\Framework\Security::getRandom(32, 'hex') . $extension;
|
||||
}
|
||||
|
||||
|
||||
// Move the uploaded file
|
||||
if(!Rhymix\Framework\Storage::moveUploadedFile($file_info['tmp_name'], $uploaded_filename, $move_type))
|
||||
{
|
||||
|
|
@ -939,7 +939,7 @@ class FileController extends File
|
|||
}
|
||||
$args->uploaded_filename = './' . substr($uploaded_filename, strlen(RX_BASEDIR));
|
||||
$args->file_size = @filesize($uploaded_filename);
|
||||
|
||||
|
||||
// Move the generated thumbnail image
|
||||
if($file_info['thumbnail'])
|
||||
{
|
||||
|
|
@ -953,10 +953,10 @@ class FileController extends File
|
|||
$args->thumbnail_filename = './' . substr($thumbnail_filename, strlen(RX_BASEDIR));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
// Insert file information
|
||||
$output = executeQuery('file.insertFile', $args);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -965,7 +965,7 @@ class FileController extends File
|
|||
$this->deleteFile(array($args));
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Insert changelog
|
||||
if($config->save_changelog === 'Y')
|
||||
{
|
||||
|
|
@ -983,14 +983,14 @@ class FileController extends File
|
|||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('file.insertFile', 'after', $args);
|
||||
|
||||
|
||||
$_SESSION['__XE_UPLOADING_FILES_INFO__'][$args->file_srl] = true;
|
||||
|
||||
|
||||
$output->add('file_srl', $args->file_srl);
|
||||
$output->add('file_size', $args->file_size);
|
||||
$output->add('sid', $args->sid);
|
||||
|
|
@ -1000,10 +1000,10 @@ class FileController extends File
|
|||
$output->add('uploaded_filename', $args->uploaded_filename);
|
||||
$output->add('thumbnail_filename', $args->thumbnail_filename);
|
||||
$output->add('original_type', $args->original_type);
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adjust uploaded image
|
||||
*/
|
||||
|
|
@ -1014,11 +1014,11 @@ class FileController extends File
|
|||
{
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
|
||||
// Set image size
|
||||
$file_info['width'] = $image_info['width'];
|
||||
$file_info['height'] = $image_info['height'];
|
||||
|
||||
|
||||
// Set base information
|
||||
$force = false;
|
||||
$adjusted = [
|
||||
|
|
@ -1029,7 +1029,7 @@ class FileController extends File
|
|||
'rotate' => 0,
|
||||
];
|
||||
$is_animated = Rhymix\Framework\Image::isAnimatedGIF($file_info['tmp_name']);
|
||||
|
||||
|
||||
// Adjust image type
|
||||
if ($config->image_autoconv['gif2mp4'] && $is_animated && function_exists('exec') && Rhymix\Framework\Storage::isExecutable($config->ffmpeg_command))
|
||||
{
|
||||
|
|
@ -1047,7 +1047,7 @@ class FileController extends File
|
|||
{
|
||||
$adjusted['type'] = 'jpg';
|
||||
}
|
||||
|
||||
|
||||
// Adjust image rotation
|
||||
if ($config->image_autorotate && $image_info['type'] === 'jpg')
|
||||
{
|
||||
|
|
@ -1062,7 +1062,7 @@ class FileController extends File
|
|||
$adjusted['rotate'] = $rotate;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust image size
|
||||
if ($config->max_image_size_action && ($config->max_image_width || $config->max_image_height) && (!$this->user->isAdmin() || $config->max_image_size_admin === 'Y'))
|
||||
{
|
||||
|
|
@ -1081,7 +1081,7 @@ class FileController extends File
|
|||
$resize_height = $config->max_image_height;
|
||||
$exceeded++;
|
||||
}
|
||||
|
||||
|
||||
if ($exceeded)
|
||||
{
|
||||
// Block upload
|
||||
|
|
@ -1101,7 +1101,7 @@ class FileController extends File
|
|||
}
|
||||
throw new Rhymix\Framework\Exception($message);
|
||||
}
|
||||
|
||||
|
||||
$adjusted['width'] = (int)$resize_width;
|
||||
$adjusted['height'] = (int)$resize_height;
|
||||
if (!$is_animated && $adjusted['type'] === $image_info['type'] && $config->max_image_size_same_format !== 'Y')
|
||||
|
|
@ -1110,7 +1110,7 @@ class FileController extends File
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set force for remove EXIF data
|
||||
if($config->image_remove_exif_data && $image_info['type'] === 'jpg' && function_exists('exif_read_data'))
|
||||
{
|
||||
|
|
@ -1123,7 +1123,7 @@ class FileController extends File
|
|||
$force = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Convert image if adjusted
|
||||
if (
|
||||
$force ||
|
||||
|
|
@ -1134,13 +1134,13 @@ class FileController extends File
|
|||
)
|
||||
{
|
||||
$output_name = $file_info['tmp_name'] . '.converted.' . $adjusted['type'];
|
||||
|
||||
|
||||
// Generate an output file
|
||||
if ($adjusted['type'] === 'mp4')
|
||||
{
|
||||
$adjusted['width'] -= $adjusted['width'] % 2;
|
||||
$adjusted['height'] -= $adjusted['height'] % 2;
|
||||
|
||||
|
||||
// Convert using ffmpeg
|
||||
$command = \RX_WINDOWS ? escapeshellarg($config->ffmpeg_command) : $config->ffmpeg_command;
|
||||
$command .= ' -nostdin -i ' . escapeshellarg($file_info['tmp_name']);
|
||||
|
|
@ -1149,7 +1149,7 @@ class FileController extends File
|
|||
$command .= ' ' . escapeshellarg($output_name);
|
||||
@exec($command, $output, $return_var);
|
||||
$result = $return_var === 0 ? true : false;
|
||||
|
||||
|
||||
// Generate a thumbnail image
|
||||
if ($result)
|
||||
{
|
||||
|
|
@ -1164,7 +1164,7 @@ class FileController extends File
|
|||
{
|
||||
$result = FileHandler::createImageFile($file_info['tmp_name'], $output_name, $adjusted['width'], $adjusted['height'], $adjusted['type'], 'fill', $adjusted['quality'], $adjusted['rotate']);
|
||||
}
|
||||
|
||||
|
||||
// Change to information in the output file
|
||||
if ($result)
|
||||
{
|
||||
|
|
@ -1177,10 +1177,10 @@ class FileController extends File
|
|||
$file_info['converted'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adjust uploaded video
|
||||
*/
|
||||
|
|
@ -1190,7 +1190,7 @@ class FileController extends File
|
|||
{
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
|
||||
// Analyze video file
|
||||
$command = \RX_WINDOWS ? escapeshellarg($config->ffprobe_command) : $config->ffprobe_command;
|
||||
$command .= ' -v quiet -print_format json -show_streams';
|
||||
|
|
@ -1200,7 +1200,7 @@ class FileController extends File
|
|||
{
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
|
||||
// Get stream information
|
||||
$stream_info = [];
|
||||
foreach ($output['streams'] as $info)
|
||||
|
|
@ -1211,12 +1211,12 @@ class FileController extends File
|
|||
{
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
|
||||
// Set video size
|
||||
$file_info['width'] = (int)$stream_info['video']['width'];
|
||||
$file_info['height'] = (int)$stream_info['video']['height'];
|
||||
$file_info['duration'] = (int)$stream_info['video']['duration'];
|
||||
|
||||
|
||||
// MP4
|
||||
if ($file_info['extension'] === 'mp4')
|
||||
{
|
||||
|
|
@ -1226,7 +1226,7 @@ class FileController extends File
|
|||
$file_info['original_type'] = 'image/gif';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Generate a thumbnail image
|
||||
if ($config->video_thumbnail)
|
||||
{
|
||||
|
|
@ -1240,10 +1240,10 @@ class FileController extends File
|
|||
$file_info['thumbnail'] = $thumbnail_name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete the attachment
|
||||
*
|
||||
|
|
@ -1277,16 +1277,16 @@ class FileController extends File
|
|||
{
|
||||
$file_list = explode(',', $file_list);
|
||||
}
|
||||
|
||||
|
||||
if(empty($file_list))
|
||||
{
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
|
||||
$config = FileModel::getFileConfig();
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
foreach($file_list as $file)
|
||||
{
|
||||
if(!is_object($file))
|
||||
|
|
@ -1297,16 +1297,16 @@ class FileController extends File
|
|||
}
|
||||
$file = FileModel::getFile($file_srl);
|
||||
}
|
||||
|
||||
|
||||
if(empty($file->file_srl))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('file.deleteFile', 'before', $file);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
||||
// Remove from the DB
|
||||
$output = executeQuery('file.deleteFile', $file);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -1314,7 +1314,7 @@ class FileController extends File
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
if($config->save_changelog === 'Y')
|
||||
{
|
||||
$clargs = new stdClass;
|
||||
|
|
@ -1329,16 +1329,16 @@ class FileController extends File
|
|||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If successfully deleted, remove the file
|
||||
Rhymix\Framework\Storage::delete(FileHandler::getRealPath($file->uploaded_filename));
|
||||
|
||||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('file.deleteFile', 'after', $file);
|
||||
|
||||
|
||||
// Remove empty directories
|
||||
Rhymix\Framework\Storage::deleteEmptyDirectory(dirname(FileHandler::getRealPath($file->uploaded_filename)), true);
|
||||
|
||||
|
||||
// Remove thumbnail
|
||||
if ($file->thumbnail_filename)
|
||||
{
|
||||
|
|
@ -1346,11 +1346,11 @@ class FileController extends File
|
|||
Rhymix\Framework\Storage::deleteEmptyDirectory(dirname(FileHandler::getRealPath($file->thumbnail_filename)), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete all attachments of a particular document
|
||||
*
|
||||
|
|
@ -1361,17 +1361,17 @@ class FileController extends File
|
|||
{
|
||||
// Get a list of attachements
|
||||
$file_list = FileModel::getFiles($upload_target_srl);
|
||||
|
||||
|
||||
// Success returned if no attachement exists
|
||||
if(empty($file_list))
|
||||
{
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
|
||||
// Delete the file
|
||||
return $this->deleteFile($file_list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete the attachment of a particular module
|
||||
*
|
||||
|
|
@ -1388,11 +1388,11 @@ class FileController extends File
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Delete the file
|
||||
return $this->deleteFile($file_list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Move an attachement to the other document
|
||||
*
|
||||
|
|
@ -1413,11 +1413,11 @@ class FileController extends File
|
|||
$config = FileModel::getFileConfig($module_srl);
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
foreach($file_list as $i => $file_info)
|
||||
{
|
||||
$old_file = $file_info->uploaded_filename;
|
||||
|
||||
|
||||
// Determine the file path by checking if the file is an image or other kinds
|
||||
if (Rhymix\Framework\Filters\FilenameFilter::isDirectDownload($file_info->source_filename))
|
||||
{
|
||||
|
|
@ -1432,19 +1432,19 @@ class FileController extends File
|
|||
$random_filename = basename($file_info->uploaded_filename) ?: Rhymix\Framework\Security::getRandom(32, 'hex');
|
||||
$new_file = $path . $random_filename;
|
||||
}
|
||||
|
||||
|
||||
// Pass if a target document to move is same
|
||||
if($old_file === $new_file) continue;
|
||||
|
||||
|
||||
// Create a directory
|
||||
FileHandler::makeDir($path);
|
||||
|
||||
|
||||
// Move the file
|
||||
FileHandler::rename($old_file, $new_file);
|
||||
|
||||
|
||||
// Delete old path
|
||||
Rhymix\Framework\Storage::deleteEmptyDirectory(dirname(FileHandler::getRealPath($old_file)), true);
|
||||
|
||||
|
||||
// Update DB information
|
||||
$args = new stdClass;
|
||||
$args->file_srl = $file_info->file_srl;
|
||||
|
|
@ -1452,7 +1452,7 @@ class FileController extends File
|
|||
$args->module_srl = $file_info->module_srl;
|
||||
$args->upload_target_srl = $target_srl;
|
||||
$output = executeQuery('file.updateFile', $args);
|
||||
|
||||
|
||||
if($config->save_changelog === 'Y')
|
||||
{
|
||||
$clargs = new stdClass;
|
||||
|
|
@ -1469,18 +1469,18 @@ class FileController extends File
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
|
||||
function copyFile($source_file, $module_srl, $upload_target_srl, &$content = null)
|
||||
{
|
||||
$file_info = array();
|
||||
$file_info['name'] = $source_file->source_filename;
|
||||
$file_info['tmp_name'] = $source_file->uploaded_filename;
|
||||
$copied_file = $this->insertFile($file_info, $module_srl, $upload_target_srl, 0, true);
|
||||
|
||||
|
||||
if($content)
|
||||
{
|
||||
// if image/video files
|
||||
|
|
@ -1497,23 +1497,23 @@ class FileController extends File
|
|||
$content = str_replace('sid=' . $source_file->sid, 'sid=' . $copied_file->get('sid'), $content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $copied_file;
|
||||
}
|
||||
|
||||
|
||||
function copyFiles($source_file_list, $module_srl, $upload_target_srl, &$content = null)
|
||||
{
|
||||
if(!is_array($source_file_list))
|
||||
{
|
||||
$source_file_list = FileModel::getFiles($source_file_list, array(), 'file_srl', true);
|
||||
}
|
||||
|
||||
|
||||
foreach($source_file_list as $source_file)
|
||||
{
|
||||
$this->copyFile($source_file, $module_srl, $upload_target_srl, $content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function procFileSetCoverImage()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
|
@ -1535,7 +1535,7 @@ class FileController extends File
|
|||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
$args->cover_image = 'N';
|
||||
$output = executeQuery('file.updateClearCoverImage', $args);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -1565,10 +1565,10 @@ class FileController extends File
|
|||
$thumbnail_path = sprintf('files/thumbnails/%s', getNumberingPath($upload_target_srl, 3));
|
||||
Filehandler::removeFilesInDir($thumbnail_path);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine storage path based on file.folder_structure configuration.
|
||||
*
|
||||
*
|
||||
* @param string $file_type images or binary
|
||||
* @param int $file_srl
|
||||
* @param int $module_srl
|
||||
|
|
@ -1584,13 +1584,13 @@ class FileController extends File
|
|||
$module_srl = intval($module_srl);
|
||||
$upload_target_srl = $upload_target_srl ?: $file_srl;
|
||||
$regdate = $regdate ?: date('YmdHis');
|
||||
|
||||
|
||||
// 시스템 설정 참고 (기존 사용자는 1, 신규 설치시 2가 기본값임)
|
||||
$folder_structure = config('file.folder_structure');
|
||||
|
||||
|
||||
// 기본 경로 지정
|
||||
$prefix = $absolute_path ? \RX_BASEDIR : './';
|
||||
|
||||
|
||||
// 2: 년월일 단위로 정리
|
||||
if ($folder_structure == 2)
|
||||
{
|
||||
|
|
@ -1603,7 +1603,7 @@ class FileController extends File
|
|||
return sprintf('%sfiles/attach/%s/%d/%s', $prefix, $file_type, $module_srl, $components);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find the attachment where a key is upload_target_srl and then return java script code
|
||||
*
|
||||
|
|
@ -1616,34 +1616,34 @@ class FileController extends File
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
function triggerMoveDocument($obj)
|
||||
{
|
||||
$obj->upload_target_srls = $obj->document_srls;
|
||||
executeQuery('file.updateFileModule', $obj);
|
||||
executeQuery('file.updateFileModuleComment', $obj);
|
||||
}
|
||||
|
||||
|
||||
function triggerAddCopyDocument(&$obj)
|
||||
{
|
||||
if(!$obj->source->uploaded_count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->copyFiles($obj->source->document_srl, $obj->copied->module_srl, $obj->copied->document_srl, $obj->copied->content);
|
||||
}
|
||||
|
||||
|
||||
function triggerAddCopyCommentByDocument(&$obj)
|
||||
{
|
||||
if(!$obj->source->uploaded_count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->copyFiles($obj->source->comment_srl, $obj->copied->module_srl, $obj->copied->comment_srl, $obj->copied->content);
|
||||
}
|
||||
|
||||
|
||||
function triggerCopyModule(&$obj)
|
||||
{
|
||||
$fileConfig = ModuleModel::getModulePartConfig('file', $obj->originModuleSrl);
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ class FileModel extends File
|
|||
{
|
||||
$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
|
||||
}
|
||||
|
||||
|
||||
// Get uploaded files
|
||||
if($upload_target_srl)
|
||||
{
|
||||
$oDocument = DocumentModel::getDocument($upload_target_srl);
|
||||
|
||||
|
||||
// Check permissions of the comment
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
|
|
@ -51,13 +51,13 @@ class FileModel extends File
|
|||
$oDocument = DocumentModel::getDocument($oComment->get('document_srl'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check permissions of the document
|
||||
if($oDocument->isExists() && !$oDocument->isAccessible())
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// Check permissions of the module
|
||||
if($module_srl = isset($oComment) ? $oComment->get('module_srl') : $oDocument->get('module_srl'))
|
||||
{
|
||||
|
|
@ -72,7 +72,7 @@ class FileModel extends File
|
|||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set file list
|
||||
foreach(self::getFiles($upload_target_srl) as $file_info)
|
||||
{
|
||||
|
|
@ -94,18 +94,18 @@ class FileModel extends File
|
|||
{
|
||||
$obj->download_url = self::getDirectFileUrl($file_info->download_url);
|
||||
}
|
||||
|
||||
|
||||
$file_list[] = $obj;
|
||||
$attached_size += $file_info->file_size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set output
|
||||
$this->add('files', $file_list);
|
||||
$this->add('attached_size', FileHandler::filesize($attached_size));
|
||||
$this->add('editor_sequence', $editor_sequence);
|
||||
$this->add('upload_target_srl', $upload_target_srl);
|
||||
|
||||
|
||||
// Set upload config
|
||||
$upload_config = self::getUploadConfig();
|
||||
if($this->user->isAdmin())
|
||||
|
|
@ -120,13 +120,13 @@ class FileModel extends File
|
|||
$this->add('allowed_attach_size', FileHandler::filesize($upload_config->allowed_attach_size * 1024 * 1024));
|
||||
$this->add('allowed_extensions', $upload_config->allowed_extensions);
|
||||
}
|
||||
|
||||
|
||||
// for compatibility
|
||||
$this->add('allowed_filetypes', $upload_config->allowed_filetypes);
|
||||
$this->add('upload_status', self::getUploadStatus($attached_size));
|
||||
$this->add('left_size', $upload_config->allowed_attach_size * 1024 * 1024 - $attached_size);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the file is downloadable
|
||||
*
|
||||
|
|
@ -144,13 +144,13 @@ class FileModel extends File
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Check the validity
|
||||
if($file_info->isvalid !== 'Y')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Check download groups
|
||||
$config = self::getFileConfig($file_info->module_srl);
|
||||
if($config->download_groups)
|
||||
|
|
@ -177,10 +177,10 @@ class FileModel extends File
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the file is deletable
|
||||
*
|
||||
|
|
@ -202,7 +202,7 @@ class FileModel extends File
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Check permissions of the module
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($file_info->module_srl);
|
||||
if(empty($module_info->module_srl))
|
||||
|
|
@ -214,24 +214,24 @@ class FileModel extends File
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Check permissions of the document
|
||||
$oDocument = DocumentModel::getDocument($file_info->upload_target_srl);
|
||||
if($oDocument->isExists() && $oDocument->isGranted())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Check permissions of the comment
|
||||
$oComment = CommentModel::getComment($file_info->upload_target_srl);
|
||||
if($oComment->isExists() && $oComment->isGranted())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return number of attachments which belongs to a specific document
|
||||
*
|
||||
|
|
@ -266,7 +266,7 @@ class FileModel extends File
|
|||
return sprintf('index.php?module=%s&act=%s&file_srl=%s&sid=%s', 'file', 'procFileDownload', $file_srl, $sid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return direct download file url
|
||||
*
|
||||
|
|
@ -277,7 +277,7 @@ class FileModel extends File
|
|||
{
|
||||
return \RX_BASEURL . ltrim($path, './');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get file configurations
|
||||
*
|
||||
|
|
@ -296,7 +296,7 @@ class FileModel extends File
|
|||
$config->$key = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Default setting if not exists
|
||||
$config->allowed_filesize = $config->allowed_filesize ?? '2';
|
||||
$config->allowed_attach_size = $config->allowed_attach_size ?? '3';
|
||||
|
|
@ -310,7 +310,7 @@ class FileModel extends File
|
|||
$config->video_mp4_gif_time = $config->video_mp4_gif_time ?? 0;
|
||||
$config->ffmpeg_command = $config->ffmpeg_command ?? '/usr/bin/ffmpeg';
|
||||
$config->ffprobe_command = $config->ffprobe_command ?? '/usr/bin/ffprobe';
|
||||
|
||||
|
||||
// Set allowed_extensions
|
||||
if(!isset($config->allowed_extensions))
|
||||
{
|
||||
|
|
@ -323,10 +323,10 @@ class FileModel extends File
|
|||
}, explode(';', $config->allowed_filetypes));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set download_groups
|
||||
$config->download_groups = is_array($config->download_grant) ? array_filter($config->download_grant) : [];
|
||||
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
|
@ -388,7 +388,7 @@ class FileModel extends File
|
|||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
$fileList = array();
|
||||
foreach ($output->data as $file)
|
||||
{
|
||||
|
|
@ -435,7 +435,7 @@ class FileModel extends File
|
|||
{
|
||||
$allowed_filesize = min($file_config->allowed_filesize * 1024 * 1024, FileHandler::returnBytes(ini_get('upload_max_filesize')), FileHandler::returnBytes(ini_get('post_max_size')));
|
||||
}
|
||||
|
||||
|
||||
// Display upload status
|
||||
$upload_status = sprintf(
|
||||
'%s : %s/ %s<br /> %s : %s (%s : %s)',
|
||||
|
|
@ -452,7 +452,7 @@ class FileModel extends File
|
|||
|
||||
/**
|
||||
* method for compatibility
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public static function getFileModuleConfig($module_srl)
|
||||
|
|
@ -462,7 +462,7 @@ class FileModel extends File
|
|||
|
||||
/**
|
||||
* method for compatibility
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public static function getFileGrant($file_info, $member_info)
|
||||
|
|
|
|||
|
|
@ -33,16 +33,16 @@ class FileView extends File
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get file configurations of the module
|
||||
$config = FileModel::getFileConfig($current_module_srl);
|
||||
Context::set('config', $config);
|
||||
Context::set('is_ffmpeg', function_exists('exec') && Rhymix\Framework\Storage::isExecutable($config->ffmpeg_command) && Rhymix\Framework\Storage::isExecutable($config->ffprobe_command));
|
||||
|
||||
|
||||
// Get a permission for group setting
|
||||
$group_list = MemberModel::getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
|
||||
// Set a template file
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path . 'tpl', 'file_module_config');
|
||||
|
|
|
|||
|
|
@ -43,16 +43,16 @@ class installAdminController extends install
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Session::close();
|
||||
|
||||
|
||||
$output = $oModule->moduleUpdate();
|
||||
if($output instanceof BaseObject && !$output->toBool())
|
||||
{
|
||||
Rhymix\Framework\Session::start();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$oModuleController = getController('module');
|
||||
$output = $oModuleController->registerActionForwardRoutes($module_name);
|
||||
if($output instanceof BaseObject && !$output->toBool())
|
||||
|
|
@ -60,7 +60,7 @@ class installAdminController extends install
|
|||
Rhymix\Framework\Session::start();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Session::start();
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class install extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +28,7 @@ class install extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class installController extends install
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_already_installed');
|
||||
}
|
||||
|
||||
|
||||
// Increase time limit.
|
||||
@set_time_limit(0);
|
||||
}
|
||||
|
|
@ -31,13 +31,13 @@ class installController extends install
|
|||
{
|
||||
// Get DB config variables.
|
||||
$config = Context::gets('db_type', 'db_host', 'db_port', 'db_user', 'db_pass', 'db_database', 'db_prefix');
|
||||
|
||||
|
||||
// Disallow installation using the root account.
|
||||
if (trim($config->db_user) === 'root' && !preg_match('/Development Server$/', $_SERVER['SERVER_SOFTWARE']))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_dbroot_disallowed');
|
||||
}
|
||||
|
||||
|
||||
// Create a temporary setting object.
|
||||
Rhymix\Framework\Config::set('db.master', array(
|
||||
'type' => $config->db_type,
|
||||
|
|
@ -48,7 +48,7 @@ class installController extends install
|
|||
'database' => $config->db_database,
|
||||
'prefix' => $config->db_prefix ? (rtrim($config->db_prefix, '_') . '_') : '',
|
||||
));
|
||||
|
||||
|
||||
// Check connection to the DB.
|
||||
$oDB = DB::getInstance();
|
||||
$output = $oDB->getError();
|
||||
|
|
@ -56,7 +56,7 @@ class installController extends install
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Check MySQL server capabilities.
|
||||
if(stripos($config->db_type, 'mysql') !== false)
|
||||
{
|
||||
|
|
@ -70,12 +70,12 @@ class installController extends install
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if utf8mb4 is supported.
|
||||
$oDB->charset = $oDB->getBestSupportedCharset();
|
||||
$config->db_charset = $oDB->charset;
|
||||
}
|
||||
|
||||
|
||||
// Check if tables already exist.
|
||||
$table_check = array('documents', 'comments', 'modules', 'sites');
|
||||
foreach ($table_check as $table_name)
|
||||
|
|
@ -85,10 +85,10 @@ class installController extends install
|
|||
throw new Rhymix\Framework\Exception('msg_table_already_exists');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Save DB config in session.
|
||||
$_SESSION['db_config'] = $config;
|
||||
|
||||
|
||||
// Continue the installation.
|
||||
if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON')))
|
||||
{
|
||||
|
|
@ -107,7 +107,7 @@ class installController extends install
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_already_installed');
|
||||
}
|
||||
|
||||
|
||||
// Get install parameters.
|
||||
$config = Rhymix\Framework\Config::getDefaults();
|
||||
if ($install_config)
|
||||
|
|
@ -147,23 +147,23 @@ class installController extends install
|
|||
$time_zone = Context::get('time_zone');
|
||||
$user_info = Context::gets('email_address', 'password', 'nick_name', 'user_id');
|
||||
}
|
||||
|
||||
|
||||
// Fix the database table prefix.
|
||||
$config['db']['master']['prefix'] = rtrim($config['db']['master']['prefix'], '_');
|
||||
if ($config['db']['master']['prefix'] !== '')
|
||||
{
|
||||
$config['db']['master']['prefix'] .= '_';
|
||||
}
|
||||
|
||||
|
||||
// Create new crypto keys.
|
||||
$config['crypto']['encryption_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum');
|
||||
$config['crypto']['authentication_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum');
|
||||
$config['crypto']['session_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum');
|
||||
|
||||
|
||||
// Set the default language.
|
||||
$config['locale']['default_lang'] = Context::getLangType();
|
||||
$config['locale']['enabled_lang'] = array($config['locale']['default_lang']);
|
||||
|
||||
|
||||
// Set the default time zone.
|
||||
if (strpos($time_zone, '/') !== false)
|
||||
{
|
||||
|
|
@ -183,7 +183,7 @@ class installController extends install
|
|||
$config['locale']['default_timezone'] = 'Etc/GMT' . ($user_timezone > 0 ? '-' : '+') . abs($user_timezone);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set the internal time zone.
|
||||
if ($config['locale']['default_timezone'] === 'Asia/Seoul')
|
||||
{
|
||||
|
|
@ -197,24 +197,24 @@ class installController extends install
|
|||
{
|
||||
$config['locale']['internal_timezone'] = 0;
|
||||
}
|
||||
|
||||
|
||||
// Set the default URL.
|
||||
$config['url']['default'] = Context::getRequestUri();
|
||||
|
||||
|
||||
// Set the default umask.
|
||||
$config['file']['umask'] = Rhymix\Framework\Storage::recommendUmask();
|
||||
|
||||
|
||||
// Load the new configuration.
|
||||
Rhymix\Framework\Config::setAll($config);
|
||||
Context::loadDBInfo($config);
|
||||
|
||||
|
||||
// Check DB.
|
||||
$oDB = DB::getInstance();
|
||||
if (!$oDB->isConnected())
|
||||
{
|
||||
return $oDB->getError();
|
||||
}
|
||||
|
||||
|
||||
// Assign a temporary administrator while installing.
|
||||
foreach ($user_info as $key => $val)
|
||||
{
|
||||
|
|
@ -222,7 +222,7 @@ class installController extends install
|
|||
}
|
||||
$user_info->is_admin = 'Y';
|
||||
Context::set('logged_info', $user_info);
|
||||
|
||||
|
||||
// Install all the modules.
|
||||
try
|
||||
{
|
||||
|
|
@ -235,7 +235,7 @@ class installController extends install
|
|||
$oDB->rollback();
|
||||
throw new Rhymix\Framework\Exception($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
// Execute the install script.
|
||||
$scripts = FileHandler::readDir(RX_BASEDIR . 'modules/install/script', '/(\.php)$/');
|
||||
if(count($scripts))
|
||||
|
|
@ -247,7 +247,7 @@ class installController extends install
|
|||
$output = include($script_path . $script);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Apply site lock.
|
||||
if (Context::get('use_sitelock') === 'Y')
|
||||
{
|
||||
|
|
@ -256,23 +256,23 @@ class installController extends install
|
|||
Rhymix\Framework\Config::set('lock.message', 'This site is locked.');
|
||||
Rhymix\Framework\Config::set('lock.allow', array('127.0.0.1', $user_ip_range));
|
||||
}
|
||||
|
||||
|
||||
// Use APC cache if available.
|
||||
if (function_exists('apcu_exists'))
|
||||
{
|
||||
Rhymix\Framework\Config::set('cache.type', 'apc');
|
||||
}
|
||||
|
||||
|
||||
// Save the new configuration.
|
||||
Rhymix\Framework\Config::save();
|
||||
|
||||
|
||||
// Unset temporary session variables.
|
||||
unset($_SESSION['use_rewrite']);
|
||||
unset($_SESSION['db_config']);
|
||||
|
||||
|
||||
// Redirect to the home page.
|
||||
$this->setMessage('msg_install_completed');
|
||||
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : RX_BASEURL;
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
return new BaseObject();
|
||||
|
|
@ -315,13 +315,13 @@ class installController extends install
|
|||
{
|
||||
$checklist['permission'] = false;
|
||||
}
|
||||
|
||||
|
||||
// Check session availability
|
||||
$license_agreement_time = intval(trim(FileHandler::readFile($this->flagLicenseAgreement)));
|
||||
if(isset($_SESSION['license_agreement']) && (!$license_agreement_time || ($license_agreement_time == $_SESSION['license_agreement'])))
|
||||
{
|
||||
$sess_autostart = intval(ini_get('session.auto_start'));
|
||||
|
||||
|
||||
if($sess_autostart === 0)
|
||||
{
|
||||
$checklist['session'] = true;
|
||||
|
|
@ -425,7 +425,7 @@ class installController extends install
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_must_accept_license_agreement');
|
||||
}
|
||||
|
||||
|
||||
$license_agreement_time = time();
|
||||
$_SESSION['license_agreement'] = $license_agreement_time;
|
||||
FileHandler::writeFile($this->flagLicenseAgreement, $license_agreement_time . PHP_EOL);
|
||||
|
|
@ -465,13 +465,13 @@ class installController extends install
|
|||
{
|
||||
// Get module name
|
||||
$module = basename($module_path);
|
||||
|
||||
|
||||
// Only install default modules at this time
|
||||
if (!Context::isDefaultPlugin($module, 'module'))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Try to group modules by category
|
||||
$xml_info = ModuleModel::getModuleInfoXml($module);
|
||||
if (!$xml_info)
|
||||
|
|
@ -480,14 +480,14 @@ class installController extends install
|
|||
}
|
||||
$modules[$xml_info->category ?: 'other'][] = $module;
|
||||
}
|
||||
|
||||
|
||||
// Install "module" module in advance
|
||||
$this->installModule('module','./modules/module');
|
||||
$this->updateModule('module');
|
||||
|
||||
|
||||
// Determine the order of module installation depending on category
|
||||
$install_step = array('system','content','member');
|
||||
|
||||
|
||||
// Install all the remaining modules
|
||||
foreach($install_step as $category)
|
||||
{
|
||||
|
|
@ -502,7 +502,7 @@ class installController extends install
|
|||
unset($modules[$category]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Install all the remaining modules
|
||||
if(count($modules))
|
||||
{
|
||||
|
|
@ -544,16 +544,16 @@ class installController extends install
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$table_name = $matches[1];
|
||||
if(isset($schema_sorted[$table_name]) || $oDB->isTableExists($table_name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$schema_sorted[$table_name] = $filename;
|
||||
}
|
||||
|
||||
|
||||
$schema_sorted = Rhymix\Framework\Parsers\DBTableParser::resolveDependency($schema_sorted);
|
||||
foreach ($schema_sorted as $table_name => $filename)
|
||||
{
|
||||
|
|
@ -563,7 +563,7 @@ class installController extends install
|
|||
throw new Exception(lang('msg_create_table_failed') . ': ' . $table_name . ': ' . $oDB->getError()->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create a table and module instance and then execute install() method
|
||||
$oModule = ModuleModel::getModuleInstallClass($module);
|
||||
if($oModule && method_exists($oModule, 'moduleInstall'))
|
||||
|
|
@ -572,10 +572,10 @@ class installController extends install
|
|||
}
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update a module if necessary.
|
||||
*
|
||||
*
|
||||
* @param string $module
|
||||
* @return mixed
|
||||
*/
|
||||
|
|
@ -590,10 +590,10 @@ class installController extends install
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Placeholder for third-party apps that try to manipulate system configuration.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function makeConfigFile()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class installModel extends install
|
|||
|
||||
function getInstallFTPList()
|
||||
{
|
||||
if(!($ftp_info = Context::getRequestVars()) || !$ftp_info->ftp_user || !$ftp_info->ftp_password)
|
||||
if(!($ftp_info = Context::getRequestVars()) || !$ftp_info->ftp_user || !$ftp_info->ftp_password)
|
||||
{
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
|
@ -57,17 +57,17 @@ class installModel extends install
|
|||
if(!$connection) return $this->setError(sprintf(lang('msg_ftp_not_connected'), 'host'));
|
||||
if(! @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
|
||||
{
|
||||
ftp_close($connection);
|
||||
ftp_close($connection);
|
||||
return $this->setError('msg_ftp_invalid_auth_info');
|
||||
}
|
||||
|
||||
if($ftp_info->ftp_pasv != "N")
|
||||
if($ftp_info->ftp_pasv != "N")
|
||||
{
|
||||
ftp_pasv($connection, true);
|
||||
}
|
||||
|
||||
$_list = ftp_rawlist($connection, $this->pwd);
|
||||
ftp_close($connection);
|
||||
ftp_close($connection);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -92,7 +92,7 @@ class installModel extends install
|
|||
{
|
||||
foreach($_list as $k => $v)
|
||||
{
|
||||
$src = new stdClass();
|
||||
$src = new stdClass();
|
||||
$src->data = $v;
|
||||
$res = Context::convertEncoding($src);
|
||||
$v = $res->data;
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@ class installView extends install
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('msg_already_installed');
|
||||
}
|
||||
|
||||
|
||||
// Set the browser title.
|
||||
Context::setBrowserTitle(lang('introduce_title'));
|
||||
|
||||
|
||||
// Specify the template path.
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
|
||||
|
||||
// Check the environment.
|
||||
$oInstallController = getController('install');
|
||||
self::$checkEnv = $oInstallController->checkInstallEnv();
|
||||
|
|
@ -46,7 +46,7 @@ class installView extends install
|
|||
if (file_exists(RX_BASEDIR . 'config/install.config.php'))
|
||||
{
|
||||
include RX_BASEDIR . 'config/install.config.php';
|
||||
|
||||
|
||||
if (isset($install_config) && is_array($install_config))
|
||||
{
|
||||
$oInstallController = getController('install');
|
||||
|
|
@ -61,7 +61,7 @@ class installView extends install
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Otherwise, display the license agreement screen.
|
||||
Context::set('lang_type', Context::getLangType());
|
||||
$this->setTemplateFile('license_agreement');
|
||||
|
|
@ -75,7 +75,7 @@ class installView extends install
|
|||
// Create a temporary file for mod_rewrite check.
|
||||
self::$rewriteCheckString = Rhymix\Framework\Security::getRandom(32);
|
||||
FileHandler::writeFile(RX_BASEDIR . self::$rewriteCheckFilePath, self::$rewriteCheckString);
|
||||
|
||||
|
||||
// Check if the web server is nginx.
|
||||
Context::set('use_nginx', stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false);
|
||||
$this->setTemplateFile('check_env');
|
||||
|
|
@ -91,16 +91,16 @@ class installView extends install
|
|||
{
|
||||
return $this->dispInstallCheckEnv();
|
||||
}
|
||||
|
||||
|
||||
// Delete mod_rewrite check file
|
||||
FileHandler::removeFile(RX_BASEDIR . self::$rewriteCheckFilePath);
|
||||
|
||||
|
||||
// Save mod_rewrite check status.
|
||||
if(Context::get('rewrite') === 'Y')
|
||||
{
|
||||
Context::set('use_rewrite', $_SESSION['use_rewrite'] = 'Y');
|
||||
}
|
||||
|
||||
|
||||
Context::set('error_return_url', getNotEncodedUrl('', 'act', Context::get('act')));
|
||||
$this->setTemplateFile('db_config');
|
||||
}
|
||||
|
|
@ -115,19 +115,19 @@ class installView extends install
|
|||
{
|
||||
return $this->dispInstallCheckEnv();
|
||||
}
|
||||
|
||||
|
||||
// Get list of time zones.
|
||||
Context::set('timezones', Rhymix\Framework\DateTime::getTimezoneList());
|
||||
|
||||
|
||||
// Automatically select a time zone for the user.
|
||||
Context::set('selected_timezone', $this->detectUserTimeZone());
|
||||
|
||||
|
||||
// Always use SSL if installing via SSL.
|
||||
Context::set('use_ssl', RX_SSL ? 'always' : 'none');
|
||||
Context::set('sitelock_ip_range', $this->detectUserIPRange());
|
||||
$this->setTemplateFile('other_config');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Detect the IP range of the user.
|
||||
*/
|
||||
|
|
@ -148,7 +148,7 @@ class installView extends install
|
|||
return RX_CLIENT_IP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Detect best time zone for the user.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class layoutAdminController extends layout
|
|||
/**
|
||||
* Create a new layout
|
||||
* Insert a title into "layouts" table in order to create a layout
|
||||
* @deprecated
|
||||
* @deprecated
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
*/
|
||||
function procLayoutAdminInsert()
|
||||
|
|
@ -65,7 +65,7 @@ class layoutAdminController extends layout
|
|||
* Initiate if it is faceoff layout
|
||||
* @param int $layout_srl
|
||||
* @param string $layout_name
|
||||
* @return void
|
||||
* @return void
|
||||
*/
|
||||
function initLayout($layout_srl, $layout_name)
|
||||
{
|
||||
|
|
@ -278,12 +278,12 @@ class layoutAdminController extends layout
|
|||
|
||||
$layout_file = $oLayoutModel->getUserLayoutHtml($layout_srl);
|
||||
FileHandler::removeFile($layout_file);
|
||||
|
||||
|
||||
// Delete Layout
|
||||
$args = new stdClass();
|
||||
$args->layout_srl = $layout_srl;
|
||||
$output = executeQuery("layout.deleteLayout", $args);
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete('layout:' . $args->layout_srl);
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -390,7 +390,7 @@ class layoutAdminController extends layout
|
|||
$ext = substr(strrchr($filename,'.'),1);
|
||||
$filename = sprintf('%s.%s', md5($filename), $ext);
|
||||
}
|
||||
|
||||
|
||||
if(file_exists($path .'/'. $filename)) @unlink($path . $filename);
|
||||
if(!move_uploaded_file($source['tmp_name'], $path . $filename )) return false;
|
||||
return true;
|
||||
|
|
@ -693,7 +693,7 @@ class layoutAdminController extends layout
|
|||
$args->extra_vars = $output->extra_vars;
|
||||
$extra_vars = unserialize($args->extra_vars);
|
||||
$image_list = array();
|
||||
|
||||
|
||||
if($layout->extra_var_count && $extra_vars)
|
||||
{
|
||||
$reg = "/^.\/files\/attach\/images\/([0-9]+)\/(.*)/";
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class layoutAdminView extends layout
|
|||
$layout_info = $oLayoutModel->getLayoutInfo($item->layout, null, $type);
|
||||
if ($layout_info)
|
||||
{
|
||||
$layout_list[$item->layout]['title'] = $layout_info->title;
|
||||
$layout_list[$item->layout]['title'] = $layout_info->title;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* @class layout
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* high class of the layout module
|
||||
* high class of the layout module
|
||||
*/
|
||||
class layout extends ModuleObject
|
||||
{
|
||||
|
|
@ -13,7 +13,7 @@ class layout extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +31,7 @@ class layout extends ModuleObject
|
|||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -40,7 +40,7 @@ class layout extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/* End of file layout.class.php */
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class layoutModel extends layout
|
|||
unset($output->data[$no]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oLayoutAdminModel = getAdminModel('layout');
|
||||
$siteDefaultLayoutSrl = $oLayoutAdminModel->getSiteDefaultLayout($layout_type);
|
||||
if($siteDefaultLayoutSrl)
|
||||
|
|
@ -64,7 +64,7 @@ class layoutModel extends layout
|
|||
$responsiveLayoutInfo->title = lang('use_responsive_pc_layout');
|
||||
array_unshift($output->data, $responsiveLayoutInfo);
|
||||
}
|
||||
|
||||
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ class layoutModel extends layout
|
|||
$titleList[$dLayoutInfo->layout] = $dLayoutInfo->title;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($layout)
|
||||
{
|
||||
if(count($instanceList) < 1 && $downloadedList[$layout])
|
||||
|
|
@ -265,7 +265,7 @@ class layoutModel extends layout
|
|||
{
|
||||
return $layout_info;
|
||||
}
|
||||
|
||||
|
||||
// Get information from the DB
|
||||
$args = new stdClass();
|
||||
$args->layout_srl = $layout_srl;
|
||||
|
|
@ -589,7 +589,7 @@ class layoutModel extends layout
|
|||
|
||||
$count = count($extra_vars);
|
||||
$extra_var_count += $count;
|
||||
|
||||
|
||||
for($i=0;$i<$count;$i++)
|
||||
{
|
||||
unset($var, $options);
|
||||
|
|
@ -680,7 +680,7 @@ class layoutModel extends layout
|
|||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
|
||||
|
||||
|
||||
$extra_var_count = 0;
|
||||
$buff[] = '$layout_info->extra_var = new stdClass;';
|
||||
foreach($extra_var_groups as $group)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class layoutView extends layout
|
|||
|
||||
/**
|
||||
* Preview a layout with module.
|
||||
*
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
public function dispLayoutPreviewWithModule()
|
||||
|
|
@ -260,7 +260,7 @@ class layoutView extends layout
|
|||
{
|
||||
throw new Rhymix\Framework\Exception(lang('msg_unabled_preview'));
|
||||
}
|
||||
|
||||
|
||||
$mid = current($output->data)->mid;
|
||||
}
|
||||
|
||||
|
|
@ -397,7 +397,7 @@ class layoutView extends layout
|
|||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -413,7 +413,7 @@ class layoutView extends layout
|
|||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ class Device extends \Member
|
|||
{
|
||||
/**
|
||||
* Automatically recognize device token from header or cookie and register it.
|
||||
*
|
||||
*
|
||||
* If the device is already registered, just update its last active date.
|
||||
*
|
||||
*
|
||||
* @return \BaseObject
|
||||
*/
|
||||
public function autoRegisterDevice(int $member_srl): \BaseObject
|
||||
|
|
@ -33,10 +33,10 @@ class Device extends \Member
|
|||
}
|
||||
return new \BaseObject;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Automatically recognize device token from header or cookie and unregister it.
|
||||
*
|
||||
*
|
||||
* @return \BaseObject
|
||||
*/
|
||||
public function autoUnregisterDevice(int $member_srl): \BaseObject
|
||||
|
|
@ -115,7 +115,7 @@ class Device extends \Member
|
|||
{
|
||||
return new \BaseObject(-1, 'INVALID_DEVICE_TOKEN');
|
||||
}
|
||||
|
||||
|
||||
if ($member_srl)
|
||||
{
|
||||
$member_srl = intval($member_srl);
|
||||
|
|
@ -150,7 +150,7 @@ class Device extends \Member
|
|||
$args->device_type = $device_type;
|
||||
$args->device_version = $device_version;
|
||||
$args->device_model = $device_model;
|
||||
|
||||
|
||||
// Call trigger (before)
|
||||
$trigger_output = \ModuleHandler::triggerCall('member.insertMemberDevice', 'before', $args);
|
||||
if(!$trigger_output->toBool()) return $trigger_output;
|
||||
|
|
@ -158,10 +158,10 @@ class Device extends \Member
|
|||
// Start transaction
|
||||
$oDB = \DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
// Remove duplicated token key
|
||||
executeQuery('member.deleteMemberDevice', ['device_token' => $device_token]);
|
||||
|
||||
|
||||
// Create member_device
|
||||
$output = executeQuery('member.insertMemberDevice', $args);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -169,10 +169,10 @@ class Device extends \Member
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Call trigger (after)
|
||||
\ModuleHandler::triggerCall('member.insertMemberDevice', 'after', $args);
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
// Set parameters
|
||||
|
|
@ -242,7 +242,7 @@ class Device extends \Member
|
|||
{
|
||||
if(isset($member_info->phone_number))
|
||||
{
|
||||
$user_id = $member_info->phone_number;
|
||||
$user_id = $member_info->phone_number;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -259,26 +259,26 @@ class Device extends \Member
|
|||
{
|
||||
$member_info = null;
|
||||
}
|
||||
|
||||
|
||||
// Update last active date
|
||||
executeQuery('member.updateMemberDeviceLastActiveDate', ['device_token' => $device_token]);
|
||||
|
||||
|
||||
$this->add('member_srl', $member_srl);
|
||||
$this->add('user_id', $member_info ? $member_info->user_id : null);
|
||||
$this->add('user_name', $member_info ? $member_info->user_name : null);
|
||||
$this->add('nick_name', $member_info ? $member_info->nick_name : null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unregister a registered device.
|
||||
*
|
||||
*
|
||||
* This action requires a device token and matching device key.
|
||||
* It is intended to be called by mobile applications.
|
||||
*/
|
||||
public function procMemberUnregisterDevice()
|
||||
{
|
||||
\Context::setResponseMethod('JSON');
|
||||
|
||||
|
||||
// Check member_srl, device_token, device_key
|
||||
$allow_guest_device = config('push.allow_guest_device');
|
||||
$member_srl = abs(\Context::get('member_srl'));
|
||||
|
|
@ -298,7 +298,7 @@ class Device extends \Member
|
|||
{
|
||||
return new \BaseObject(-1, 'NULL_DEVICE_KEY');
|
||||
}
|
||||
|
||||
|
||||
// Check the device token and key.
|
||||
$args = new \stdClass;
|
||||
$args->member_srl = $member_srl;
|
||||
|
|
@ -313,7 +313,7 @@ class Device extends \Member
|
|||
{
|
||||
return new \BaseObject(-1, 'UNREGISTERED_DEVICE');
|
||||
}
|
||||
|
||||
|
||||
// Delete the device.
|
||||
$args = new \stdClass;
|
||||
$args->device_token = $device_token;
|
||||
|
|
@ -323,10 +323,10 @@ class Device extends \Member
|
|||
return new \BaseObject(-1, 'DELETE_FAILED');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a registered device.
|
||||
*
|
||||
*
|
||||
* This action requires only the device_srl, but it must belong to the currently logged in member.
|
||||
* It is intended to be called from the web frontend.
|
||||
*/
|
||||
|
|
@ -338,13 +338,13 @@ class Device extends \Member
|
|||
{
|
||||
throw new \Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$member_srl = $this->user->member_srl;
|
||||
if (!$member_srl)
|
||||
{
|
||||
throw new \Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// Check that the device_srl matches the member.
|
||||
$args = new \stdClass;
|
||||
$args->device_srl = $device_srl;
|
||||
|
|
@ -354,17 +354,17 @@ class Device extends \Member
|
|||
{
|
||||
throw new \Rhymix\Framework\Exceptions\TargetNotFound;
|
||||
}
|
||||
|
||||
|
||||
// Delete the device.
|
||||
$args = new \stdClass;
|
||||
$args->device_token = $output->data->device_token;
|
||||
$output = executeQuery('member.deleteMemberDevice', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get device token from POST parameter, HTTP header or cookie
|
||||
*
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
protected function _getDeviceToken()
|
||||
|
|
@ -375,14 +375,14 @@ class Device extends \Member
|
|||
{
|
||||
return $device_token;
|
||||
}
|
||||
|
||||
|
||||
// HTTP header named X-Device-Token
|
||||
$device_token = $_SERVER['HTTP_X_DEVICE_TOKEN'] ?? null;
|
||||
if ($device_token)
|
||||
{
|
||||
return $device_token;
|
||||
}
|
||||
|
||||
|
||||
// Cookie named device_token
|
||||
$device_token = $_COOKIE['device_token'] ?? null;
|
||||
if ($device_token)
|
||||
|
|
@ -390,10 +390,10 @@ class Device extends \Member
|
|||
return $device_token;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set device key via header or cookie
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _setDeviceKey()
|
||||
|
|
@ -404,7 +404,7 @@ class Device extends \Member
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Set header if header was given, or cookie otherwise
|
||||
if (isset($_SERVER['HTTP_X_DEVICE_TOKEN']))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class MemberAdminController extends Member
|
|||
{
|
||||
$extra_vars = new stdClass;
|
||||
}
|
||||
|
||||
|
||||
// Get list of extra vars
|
||||
$all_args = Context::getRequestVars();
|
||||
foreach($config->signupForm as $formInfo)
|
||||
|
|
@ -114,7 +114,7 @@ class MemberAdminController extends Member
|
|||
{
|
||||
$args->limit_date = '';
|
||||
}
|
||||
|
||||
|
||||
// remove whitespace
|
||||
$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
|
||||
foreach($checkInfos as $val)
|
||||
|
|
@ -130,7 +130,7 @@ class MemberAdminController extends Member
|
|||
{
|
||||
$args->description = '';
|
||||
}
|
||||
|
||||
|
||||
$oMemberController = getController('member');
|
||||
// Execute insert or update depending on the value of member_srl
|
||||
if(!$args->member_srl)
|
||||
|
|
@ -146,7 +146,7 @@ class MemberAdminController extends Member
|
|||
}
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
||||
// Invalidate sessions if denied or limited
|
||||
if ($args->denied === 'Y' || $args->limited >= date('Ymd'))
|
||||
{
|
||||
|
|
@ -155,13 +155,13 @@ class MemberAdminController extends Member
|
|||
Rhymix\Framework\Session::setValidityInfo($args->member_srl, $validity_info);
|
||||
executeQuery('member.deleteAutologin', ['member_srl' => $args->member_srl]);
|
||||
}
|
||||
|
||||
|
||||
// Invalidate auth mail if denied or limited
|
||||
if ($args->denied === 'Y' || $args->limited >= date('Ymd'))
|
||||
{
|
||||
executeQuery('member.deleteAuthMail', ['member_srl' => $args->member_srl]);
|
||||
}
|
||||
|
||||
|
||||
// Save Signature
|
||||
$signature = Context::get('signature');
|
||||
$oMemberController->putSignature($args->member_srl, $signature);
|
||||
|
|
@ -193,7 +193,7 @@ class MemberAdminController extends Member
|
|||
|
||||
// Clear cache
|
||||
MemberController::clearMemberCache($args->member_srl);
|
||||
|
||||
|
||||
// Return result
|
||||
$this->add('member_srl', $args->member_srl);
|
||||
$this->setMessage($msg_code);
|
||||
|
|
@ -238,7 +238,7 @@ class MemberAdminController extends Member
|
|||
'allow_duplicate_nickname',
|
||||
'member_profile_view'
|
||||
);
|
||||
|
||||
|
||||
if ($args->enable_join === 'KEY')
|
||||
{
|
||||
$args->enable_join = 'N';
|
||||
|
|
@ -259,12 +259,12 @@ class MemberAdminController extends Member
|
|||
{
|
||||
$args->authmail_expires_unit = 86400;
|
||||
}
|
||||
|
||||
|
||||
if(!array_key_exists($args->password_hashing_algorithm, Rhymix\Framework\Password::getSupportedAlgorithms()))
|
||||
{
|
||||
$args->password_hashing_algorithm = 'md5';
|
||||
}
|
||||
|
||||
|
||||
$args->password_hashing_work_factor = intval($args->password_hashing_work_factor, 10);
|
||||
if($args->password_hashing_work_factor < 4)
|
||||
{
|
||||
|
|
@ -278,7 +278,7 @@ class MemberAdminController extends Member
|
|||
{
|
||||
$args->password_hashing_auto_upgrade = 'N';
|
||||
}
|
||||
|
||||
|
||||
if(!in_array($args->nickname_symbols, ['Y', 'N', 'LIST']))
|
||||
{
|
||||
$args->nickname_symbols = 'Y';
|
||||
|
|
@ -299,7 +299,7 @@ class MemberAdminController extends Member
|
|||
{
|
||||
$config = new stdClass;
|
||||
$config->features = array();
|
||||
|
||||
|
||||
$args = Context::gets(
|
||||
'scrapped_documents',
|
||||
'saved_documents',
|
||||
|
|
@ -312,7 +312,7 @@ class MemberAdminController extends Member
|
|||
{
|
||||
$config->features[$key] = toBool($value);
|
||||
}
|
||||
|
||||
|
||||
$oModuleController = getController('module');
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
|
||||
|
|
@ -328,7 +328,7 @@ class MemberAdminController extends Member
|
|||
$config = new stdClass;
|
||||
$config->agreements = array();
|
||||
$config->agreement = null;
|
||||
|
||||
|
||||
$args = Context::getRequestVars();
|
||||
for ($i = 1; $i < 20; $i++)
|
||||
{
|
||||
|
|
@ -347,14 +347,14 @@ class MemberAdminController extends Member
|
|||
$config->agreements[$i] = $agreement;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oModuleController = getController('module');
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// Delete old agreement files.
|
||||
foreach (Context::loadLangSupported() as $key => $val)
|
||||
{
|
||||
|
|
@ -371,12 +371,12 @@ class MemberAdminController extends Member
|
|||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminAgreementsConfig');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
|
||||
public function procMemberAdminInsertSignupConfig()
|
||||
{
|
||||
$oMemberModel = getModel('member');
|
||||
$config = $oMemberModel->getMemberConfig();
|
||||
|
||||
|
||||
$oModuleController = getController('module');
|
||||
|
||||
$args = Context::gets(
|
||||
|
|
@ -433,7 +433,7 @@ class MemberAdminController extends Member
|
|||
{
|
||||
return new BaseObject('-1', 'msg_need_default_country');
|
||||
}
|
||||
|
||||
|
||||
// set default
|
||||
$all_args->is_nick_name_public = 'Y';
|
||||
|
||||
|
|
@ -474,7 +474,7 @@ class MemberAdminController extends Member
|
|||
$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired;
|
||||
$signupItem->isUse = in_array($key, $usable_list) || $signupItem->required;
|
||||
$signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N';
|
||||
|
||||
|
||||
if(in_array($key, ['signature', 'profile_image', 'image_name', 'image_mark']))
|
||||
{
|
||||
$args->$key = $signupItem->isPublic;
|
||||
|
|
@ -538,7 +538,7 @@ class MemberAdminController extends Member
|
|||
'after_login_url',
|
||||
'after_logout_url'
|
||||
);
|
||||
|
||||
|
||||
if(!count($args->identifiers))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_need_identifier');
|
||||
|
|
@ -565,7 +565,7 @@ class MemberAdminController extends Member
|
|||
}
|
||||
$args->signupForm = $config->signupForm;
|
||||
$args->identifier = array_first($args->identifiers);
|
||||
|
||||
|
||||
if(!$args->change_password_date)
|
||||
{
|
||||
$args->change_password_date = 0;
|
||||
|
|
@ -630,7 +630,7 @@ class MemberAdminController extends Member
|
|||
{
|
||||
global $lang;
|
||||
$oMemberModel = getModel('member');
|
||||
|
||||
|
||||
// Get join form list which is additionally set
|
||||
$extendItems = $oMemberModel->getJoinFormList();
|
||||
|
||||
|
|
@ -700,7 +700,7 @@ class MemberAdminController extends Member
|
|||
*/
|
||||
function _createSignupRuleset($signupForm)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -710,7 +710,7 @@ class MemberAdminController extends Member
|
|||
*/
|
||||
function _createLoginRuleset($identifier)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -720,7 +720,7 @@ class MemberAdminController extends Member
|
|||
*/
|
||||
function _createFindAccountByQuestion($identifier)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -984,7 +984,7 @@ class MemberAdminController extends Member
|
|||
}
|
||||
$this->setMessage('success_updated');
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 'delete':
|
||||
{
|
||||
$oMemberController->memberInfo = null;
|
||||
|
|
@ -1017,7 +1017,7 @@ class MemberAdminController extends Member
|
|||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminList');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
|
@ -1313,7 +1313,7 @@ class MemberAdminController extends Member
|
|||
|
||||
// Call trigger (after)
|
||||
ModuleHandler::triggerCall('member.insertGroup', 'after', $args);
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -1325,7 +1325,7 @@ class MemberAdminController extends Member
|
|||
function updateGroup($args)
|
||||
{
|
||||
if(!$args->group_srl) throw new Rhymix\Framework\Exceptions\TargetNotFound;
|
||||
|
||||
|
||||
// Call trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('member.updateGroup', 'before', $args);
|
||||
if(!$trigger_output->toBool())
|
||||
|
|
@ -1346,10 +1346,10 @@ class MemberAdminController extends Member
|
|||
|
||||
$output = executeQuery('member.updateGroup', $args);
|
||||
$this->_deleteMemberGroupCache();
|
||||
|
||||
|
||||
// Call trigger (after)
|
||||
ModuleHandler::triggerCall('member.updateGroup', 'after', $args);
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -1369,7 +1369,7 @@ class MemberAdminController extends Member
|
|||
|
||||
if(!$group_info) throw new Rhymix\Framework\Exceptions\TargetNotFound;
|
||||
if($group_info->is_default == 'Y') throw new Rhymix\Framework\Exception('msg_not_delete_default');
|
||||
|
||||
|
||||
// Call trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('member.deleteGroup', 'before', $group_info);
|
||||
if(!$trigger_output->toBool())
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class MemberAdminModel extends Member
|
|||
|
||||
/**
|
||||
* Get a member list
|
||||
*
|
||||
*
|
||||
* @return object|array (object : when member count is 1, array : when member count is more than 1)
|
||||
*/
|
||||
function getMemberList()
|
||||
|
|
@ -143,7 +143,7 @@ class MemberAdminModel extends Member
|
|||
else
|
||||
{
|
||||
$query_id = 'member.getMemberList';
|
||||
$args->sort_index = $sort_index;
|
||||
$args->sort_index = $sort_index;
|
||||
}
|
||||
|
||||
$args->sort_order = $sort_order;
|
||||
|
|
@ -159,7 +159,7 @@ class MemberAdminModel extends Member
|
|||
|
||||
/**
|
||||
* Get a memebr list for each site
|
||||
*
|
||||
*
|
||||
* @param int $site_srl
|
||||
* @param int $page
|
||||
*
|
||||
|
|
@ -178,8 +178,8 @@ class MemberAdminModel extends Member
|
|||
|
||||
/**
|
||||
* Get member_srls lists about site admins
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getSiteAdminMemberSrls()
|
||||
{
|
||||
|
|
@ -197,8 +197,8 @@ class MemberAdminModel extends Member
|
|||
|
||||
/**
|
||||
* Return colorset list of a skin in the member module
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function getMemberAdminColorset()
|
||||
{
|
||||
|
|
@ -225,7 +225,7 @@ class MemberAdminModel extends Member
|
|||
|
||||
/**
|
||||
* Return member count with date
|
||||
*
|
||||
*
|
||||
* @param string $date
|
||||
*
|
||||
* @return int
|
||||
|
|
@ -292,7 +292,7 @@ class MemberAdminModel extends Member
|
|||
|
||||
$oMemberModel = getModel('member');
|
||||
$config = $oMemberModel->getMemberConfig();
|
||||
foreach($config->signupForm as $item)
|
||||
foreach($config->signupForm as $item)
|
||||
{
|
||||
$list[] = $item->name;
|
||||
}
|
||||
|
|
@ -307,7 +307,7 @@ class MemberAdminModel extends Member
|
|||
}
|
||||
|
||||
/**
|
||||
* check allowed target ip address when login for admin.
|
||||
* check allowed target ip address when login for admin.
|
||||
*
|
||||
* @return boolean (true : allowed, false : refuse)
|
||||
*/
|
||||
|
|
@ -317,12 +317,12 @@ class MemberAdminModel extends Member
|
|||
{
|
||||
return Rhymix\Framework\Filters\IpFilter::inRanges(RX_CLIENT_IP, $allow_list);
|
||||
}
|
||||
|
||||
|
||||
if ($deny_list = ($deny_list === null) ? config('admin.deny') : $deny_list)
|
||||
{
|
||||
return !Rhymix\Framework\Filters\IpFilter::inRanges(RX_CLIENT_IP, $deny_list);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php
|
||||
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
||||
/**
|
||||
* @class memberAdminView
|
||||
|
|
@ -102,7 +102,7 @@ class MemberAdminView extends Member
|
|||
'user_name' => 'user_name',
|
||||
'nick_name' => 'nick_name'
|
||||
);
|
||||
$usedIdentifiers = array();
|
||||
$usedIdentifiers = array();
|
||||
|
||||
if(is_array($config->signupForm))
|
||||
{
|
||||
|
|
@ -116,7 +116,7 @@ class MemberAdminView extends Member
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get list of new members who have not completed email auth
|
||||
$check_list = array();
|
||||
foreach ($output->data as $member)
|
||||
|
|
@ -181,7 +181,7 @@ class MemberAdminView extends Member
|
|||
$password_algos['sha256'] = false;
|
||||
}
|
||||
Context::set('password_hashing_algos', $password_algos);
|
||||
|
||||
|
||||
$this->setTemplateFile('default_config');
|
||||
}
|
||||
|
||||
|
|
@ -242,7 +242,7 @@ class MemberAdminView extends Member
|
|||
$option->height = 300;
|
||||
$option->editor_toolbar_hide = 'Y';
|
||||
Context::set('editor', $oEditorModel->getEditor(0, $option));
|
||||
|
||||
|
||||
$signupForm = $config->signupForm;
|
||||
foreach($signupForm as $val)
|
||||
{
|
||||
|
|
@ -272,7 +272,7 @@ class MemberAdminView extends Member
|
|||
$managedEmailHost = $oMemberModel->getManagedEmailHosts();
|
||||
Context::set('managedEmailHost', $managedEmailHost);
|
||||
$oSecurity->encodeHTML('managedEmailHost..email_host');
|
||||
|
||||
|
||||
// Get country calling code list
|
||||
$country_list = Rhymix\Framework\i18n::listCountries(Context::get('lang_type') === 'ko' ? Rhymix\Framework\i18n::SORT_NAME_KOREAN : Rhymix\Framework\i18n::SORT_NAME_ENGLISH);
|
||||
Context::set('country_list', $country_list);
|
||||
|
|
@ -400,7 +400,7 @@ class MemberAdminView extends Member
|
|||
Context::set('member_config', $member_config);
|
||||
$extendForm = $oMemberModel->getCombineJoinForm($this->memberInfo);
|
||||
Context::set('extend_form_list', $extendForm);
|
||||
|
||||
|
||||
$memberInfo = Context::get('member_info');
|
||||
if(!is_object($memberInfo) || !$memberInfo->member_srl)
|
||||
{
|
||||
|
|
@ -433,7 +433,7 @@ class MemberAdminView extends Member
|
|||
{
|
||||
$oMemberModel = getModel('member');
|
||||
$member_config = $this->memberConfig;
|
||||
|
||||
|
||||
if($member_info = Context::get('member_info'))
|
||||
{
|
||||
$member_info->signature = $oMemberModel->getSignature($this->memberInfo->member_srl);
|
||||
|
|
@ -442,12 +442,12 @@ class MemberAdminView extends Member
|
|||
{
|
||||
$member_info = new stdClass;
|
||||
}
|
||||
|
||||
|
||||
Context::set('member_info', $member_info);
|
||||
|
||||
|
||||
$formTags = $this->_getMemberInputTag($member_info, true);
|
||||
Context::set('formTags', $formTags);
|
||||
|
||||
|
||||
// Editor of the module set for signing by calling getEditor
|
||||
foreach($formTags as $formTag)
|
||||
{
|
||||
|
|
@ -468,22 +468,22 @@ class MemberAdminView extends Member
|
|||
$option->editor_toolbar_hide = 'Y';
|
||||
$option->editor_skin = $member_config->signature_editor_skin;
|
||||
$option->sel_editor_colorset = $member_config->sel_editor_colorset;
|
||||
|
||||
|
||||
Context::set('editor', getModel('editor')->getEditor($member_info->member_srl, $option));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$identifierForm = new stdClass;
|
||||
$identifierForm->title = lang($member_config->identifier);
|
||||
$identifierForm->name = $member_config->identifier;
|
||||
$identifierForm->value = $member_info->{$member_config->identifier};
|
||||
Context::set('identifierForm', $identifierForm);
|
||||
|
||||
|
||||
if ($member_info->limit_date < date('Ymd'))
|
||||
{
|
||||
$member_info->limit_date = '';
|
||||
}
|
||||
|
||||
|
||||
$member_unauthenticated = false;
|
||||
if ($member_info->member_srl && $member_info->denied !== 'N')
|
||||
{
|
||||
|
|
@ -499,7 +499,7 @@ class MemberAdminView extends Member
|
|||
}
|
||||
}
|
||||
Context::set('member_unauthenticated', $member_unauthenticated);
|
||||
|
||||
|
||||
$this->setTemplateFile('insert_member');
|
||||
}
|
||||
|
||||
|
|
@ -518,7 +518,7 @@ class MemberAdminView extends Member
|
|||
$extend_form_list = $oMemberModel->getCombineJoinForm($memberInfo);
|
||||
$security = new Security($extend_form_list);
|
||||
$security->encodeHTML('..column_title', '..description', '..default_value.');
|
||||
|
||||
|
||||
if ($memberInfo)
|
||||
{
|
||||
$memberInfo = get_object_vars($memberInfo);
|
||||
|
|
@ -533,17 +533,17 @@ class MemberAdminView extends Member
|
|||
{
|
||||
$member_config = $this->memberConfig = $oMemberModel->getMemberConfig();
|
||||
}
|
||||
|
||||
|
||||
global $lang;
|
||||
$formTags = array();
|
||||
|
||||
|
||||
foreach($member_config->signupForm as $no=>$formInfo)
|
||||
{
|
||||
if(!$formInfo->isUse || $formInfo->name == $member_config->identifier || $formInfo->name == 'password')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$formTag = new stdClass();
|
||||
$inputTag = '';
|
||||
$formTag->title = $formInfo->title;
|
||||
|
|
@ -593,7 +593,7 @@ class MemberAdminView extends Member
|
|||
{
|
||||
$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
|
||||
}
|
||||
|
||||
|
||||
$max_filesize = min(FileHandler::returnBytes(ini_get('upload_max_filesize')), FileHandler::returnBytes(ini_get('post_max_size')));
|
||||
if (isset($member_config->{$formInfo->name.'_max_filesize'}))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Member extends ModuleObject
|
|||
*/
|
||||
public $admin_extra_vars = ['refused_reason', 'limited_reason'];
|
||||
public $nouse_extra_vars = ['error_return_url', 'success_return_url', '_rx_ajax_compat', '_rx_csrf_token', 'ruleset', 'captchaType', 'use_editor', 'use_html'];
|
||||
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
|
|
@ -32,14 +32,14 @@ class Member extends ModuleObject
|
|||
{
|
||||
$oModuleController = getController('module');
|
||||
$config = ModuleModel::getModuleConfig('member');
|
||||
|
||||
|
||||
// Set default config
|
||||
if(!$config)
|
||||
{
|
||||
$config = MemberModel::getMemberConfig();
|
||||
$oModuleController->insertModuleConfig('member', $config);
|
||||
}
|
||||
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
$oMemberController = getController('member');
|
||||
$oMemberAdminController = getAdminController('member');
|
||||
|
|
@ -127,36 +127,36 @@ class Member extends ModuleObject
|
|||
if(!$oDB->isIndexExists("member","idx_phone_country")) return true;
|
||||
if(!$oDB->isColumnExists("member", "phone_type")) return true;
|
||||
if(!$oDB->isIndexExists("member","idx_phone_type")) return true;
|
||||
|
||||
|
||||
// Add columns for IP address
|
||||
if(!$oDB->isColumnExists("member", "ipaddress")) return true;
|
||||
if(!$oDB->isIndexExists("member","idx_ipaddress")) return true;
|
||||
if(!$oDB->isColumnExists("member", "last_login_ipaddress")) return true;
|
||||
if(!$oDB->isIndexExists("member","idx_last_login_ipaddress")) return true;
|
||||
|
||||
|
||||
// Add column for list order
|
||||
if(!$oDB->isColumnExists("member", "list_order")) return true;
|
||||
if(!$oDB->isIndexExists("member","idx_list_order")) return true;
|
||||
|
||||
|
||||
// Check autologin table
|
||||
if(!$oDB->isColumnExists("member_autologin", "security_key")) return true;
|
||||
|
||||
|
||||
// Check scrap folder table
|
||||
if(!$oDB->isColumnExists("member_scrap", "folder_srl")) return true;
|
||||
|
||||
if(!$oDB->isIndexExists('member_nickname_log', 'idx_before_nick_name')) return true;
|
||||
if(!$oDB->isIndexExists('member_nickname_log', 'idx_after_nick_name')) return true;
|
||||
if(!$oDB->isIndexExists('member_nickname_log', 'idx_user_id')) return true;
|
||||
|
||||
|
||||
// Check individual indexes for member_group_member table
|
||||
if(!$oDB->isIndexExists('member_group_member', 'idx_member_srl')) return true;
|
||||
|
||||
|
||||
// Add device token type and last active date 2020.10.28
|
||||
if(!$oDB->isColumnExists('member_devices', 'device_token_type')) return true;
|
||||
if(!$oDB->isColumnExists('member_devices', 'last_active_date')) return true;
|
||||
|
||||
|
||||
$config = ModuleModel::getModuleConfig('member');
|
||||
|
||||
|
||||
// Check members with phone country in old format
|
||||
if ($config->phone_number_default_country && !preg_match('/^[A-Z]{3}$/', $config->phone_number_default_country))
|
||||
{
|
||||
|
|
@ -167,7 +167,7 @@ class Member extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Check signup form
|
||||
if(!$config->signupForm || !is_array($config->signupForm)) return true;
|
||||
$phone_found = false;
|
||||
|
|
@ -190,7 +190,7 @@ class Member extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Check agreements
|
||||
if(!$config->agreements)
|
||||
{
|
||||
|
|
@ -225,7 +225,7 @@ class Member extends ModuleObject
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -238,13 +238,13 @@ class Member extends ModuleObject
|
|||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleController = getController('module');
|
||||
|
||||
|
||||
// Check member directory
|
||||
FileHandler::makeDir('./files/member_extra_info/image_name');
|
||||
FileHandler::makeDir('./files/member_extra_info/image_mark');
|
||||
FileHandler::makeDir('./files/member_extra_info/signature');
|
||||
FileHandler::makeDir('./files/member_extra_info/profile_image');
|
||||
|
||||
|
||||
// Add columns for phone number
|
||||
if(!$oDB->isColumnExists("member", "phone_number"))
|
||||
{
|
||||
|
|
@ -270,7 +270,7 @@ class Member extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex("member","idx_phone_type", array("phone_type"));
|
||||
}
|
||||
|
||||
|
||||
// Add columns for IP address
|
||||
if(!$oDB->isColumnExists("member", "ipaddress"))
|
||||
{
|
||||
|
|
@ -303,7 +303,7 @@ class Member extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex("member","idx_list_order", array("list_order"));
|
||||
}
|
||||
|
||||
|
||||
// Check autologin table
|
||||
if(!$oDB->isColumnExists("member_autologin", "security_key"))
|
||||
{
|
||||
|
|
@ -317,7 +317,7 @@ class Member extends ModuleObject
|
|||
$oDB->addColumn("member_scrap", "folder_srl", "number", 11);
|
||||
$oDB->addIndex("member_scrap","idx_folder_srl", array("folder_srl"));
|
||||
}
|
||||
|
||||
|
||||
// Add to index in member nickname log table. 2020. 07 .20 @BJRambo
|
||||
if(!$oDB->isIndexExists('member_nickname_log', 'idx_before_nick_name'))
|
||||
{
|
||||
|
|
@ -325,13 +325,13 @@ class Member extends ModuleObject
|
|||
$oDB->addIndex('member_nickname_log', 'idx_after_nick_name', array('after_nick_name'));
|
||||
$oDB->addIndex('member_nickname_log', 'idx_user_id', array('user_id'));
|
||||
}
|
||||
|
||||
|
||||
// Check index for member_group_member table
|
||||
if(!$oDB->isIndexExists('member_group_member', 'idx_member_srl'))
|
||||
{
|
||||
$oDB->addIndex('member_group_member', 'idx_member_srl', array('member_srl'));
|
||||
}
|
||||
|
||||
|
||||
// Add device token type and last active date 2020.10.28
|
||||
if(!$oDB->isColumnExists('member_devices', 'device_token_type'))
|
||||
{
|
||||
|
|
@ -346,10 +346,10 @@ class Member extends ModuleObject
|
|||
$oDB->addIndex('member_devices', 'idx_last_active_date', array('last_active_date'));
|
||||
$oDB->query("UPDATE member_devices SET last_active_date = regdate WHERE last_active_date = ''");
|
||||
}
|
||||
|
||||
|
||||
$config = ModuleModel::getModuleConfig('member') ?: new stdClass;
|
||||
$changed = false;
|
||||
|
||||
|
||||
// Check members with phone country in old format
|
||||
if ($config->phone_number_default_country && !preg_match('/^[A-Z]{3}$/', $config->phone_number_default_country))
|
||||
{
|
||||
|
|
@ -364,7 +364,7 @@ class Member extends ModuleObject
|
|||
'new_phone_country' => 'KOR',
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
// Check signup form
|
||||
$oModuleController = getController('module');
|
||||
$oMemberAdminController = getAdminController('member');
|
||||
|
|
@ -422,7 +422,7 @@ class Member extends ModuleObject
|
|||
$config->signupForm = $newForm;
|
||||
$changed = true;
|
||||
}
|
||||
|
||||
|
||||
// Check agreements
|
||||
if(!$config->agreements)
|
||||
{
|
||||
|
|
@ -441,7 +441,7 @@ class Member extends ModuleObject
|
|||
{
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
}
|
||||
|
||||
|
||||
// Check skin
|
||||
if($config->skin)
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -4,7 +4,7 @@
|
|||
class MemberMobile extends MemberView
|
||||
{
|
||||
/**
|
||||
* Support method are
|
||||
* Support method are
|
||||
* dispMemberInfo, dispMemberSignUpForm, dispMemberFindAccount, dispMemberGetTempPassword, dispMemberModifyInfo, dispMemberModifyInfoBefore
|
||||
*/
|
||||
var $memberInfo;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class MemberModel extends Member
|
|||
*/
|
||||
public function init()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -32,9 +32,9 @@ class MemberModel extends Member
|
|||
{
|
||||
return self::$_member_config;
|
||||
}
|
||||
|
||||
|
||||
$config = ModuleModel::getModuleConfig('member') ?: new stdClass;
|
||||
|
||||
|
||||
// Set default config
|
||||
$config->enable_join = $config->enable_join ?? 'Y';
|
||||
$config->enable_confirm = $config->enable_confirm ?? 'N';
|
||||
|
|
@ -49,7 +49,7 @@ class MemberModel extends Member
|
|||
$config->password_hashing_work_factor = $config->password_hashing_work_factor ?? 10;
|
||||
$config->password_hashing_auto_upgrade = $config->password_hashing_auto_upgrade ?? 'Y';
|
||||
$config->password_change_invalidate_other_sessions = $config->password_change_invalidate_other_sessions ?? 'N';
|
||||
|
||||
|
||||
// Set features config
|
||||
if(!isset($config->features)) $config->features = array();
|
||||
$config->features['scrapped_documents'] = $config->features['scrapped_documents'] ?? true;
|
||||
|
|
@ -58,7 +58,7 @@ class MemberModel extends Member
|
|||
$config->features['my_comments'] = $config->features['my_comments'] ?? true;
|
||||
$config->features['active_logins'] = $config->features['active_logins'] ?? true;
|
||||
$config->features['nickname_log'] = $config->features['nickname_log'] ?? true;
|
||||
|
||||
|
||||
// Set agreements config
|
||||
if(!isset($config->agreements) || !is_array($config->agreements))
|
||||
{
|
||||
|
|
@ -69,7 +69,7 @@ class MemberModel extends Member
|
|||
$config->agreements[1]->type = !empty($config->agreements[1]->content) ? 'required' : 'disabled';
|
||||
}
|
||||
unset($config->agreement);
|
||||
|
||||
|
||||
// Set signup config
|
||||
$config->limit_day = $config->limit_day ?? 0;
|
||||
$config->emailhost_check = $config->emailhost_check ?? 'allowed';
|
||||
|
|
@ -103,7 +103,7 @@ class MemberModel extends Member
|
|||
{
|
||||
$config->signature_editor_skin = 'ckeditor';
|
||||
}
|
||||
|
||||
|
||||
// Set login config
|
||||
$config->identifier = $config->identifier ?? 'user_id';
|
||||
$config->identifiers = $config->identifiers ?? array('user_id', 'email_address');
|
||||
|
|
@ -114,17 +114,17 @@ class MemberModel extends Member
|
|||
$config->login_invalidate_other_sessions = $config->login_invalidate_other_sessions ?? 'N';
|
||||
$config->after_login_url = $config->after_login_url ?? null;
|
||||
$config->after_logout_url = $config->after_logout_url ?? null;
|
||||
|
||||
|
||||
// Set design config
|
||||
$config->layout_srl = $config->layout_srl ?? 0;
|
||||
$config->skin = $config->skin ?? 'default';
|
||||
$config->colorset = $config->colorset ?? 'white';
|
||||
$config->mlayout_srl = $config->mlayout_srl ?? 0;
|
||||
$config->mskin = $config->mskin ?? 'default';
|
||||
|
||||
|
||||
// Set group image config
|
||||
$config->group_image_mark = $config->group_image_mark ?? 'N';
|
||||
|
||||
|
||||
// Set signup form
|
||||
if(!isset($config->signupForm) || !is_array($config->signupForm))
|
||||
{
|
||||
|
|
@ -138,13 +138,13 @@ class MemberModel extends Member
|
|||
}
|
||||
$config->signupForm[$key]->isPublic = $config->signupForm[$key]->isPublic ?? 'Y';
|
||||
}
|
||||
|
||||
|
||||
return self::$_member_config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get member agreement from old version
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
protected static function _getAgreement()
|
||||
|
|
@ -188,11 +188,11 @@ class MemberModel extends Member
|
|||
$this->add('errorDetail', 'ERR_CSRF_INVALID_ORIGIN');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Add CORS restriction
|
||||
header('Access-Control-Allow-Origin: ' . rtrim(Rhymix\Framework\Url::getCurrentDomainURL(), '/'));
|
||||
header('Cross-Origin-Resource-Policy: same-origin');
|
||||
|
||||
|
||||
// Return login status and CSRF token
|
||||
Context::setResponseMethod('JSON');
|
||||
$this->add('status', Rhymix\Framework\Session::getLoginStatus());
|
||||
|
|
@ -211,12 +211,12 @@ class MemberModel extends Member
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$mid = Context::get('cur_mid');
|
||||
$logged_info = Context::get('logged_info');
|
||||
$module_config = self::getMemberConfig();
|
||||
$icon_path = '';
|
||||
|
||||
|
||||
// Get requested member info
|
||||
if($member_srl == $logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -237,7 +237,7 @@ class MemberModel extends Member
|
|||
ModuleHandler::triggerCall('member.getMemberMenu', 'before', $member_info);
|
||||
|
||||
$oMemberController = MemberController::getInstance();
|
||||
|
||||
|
||||
// Display member information (Don't display to non-logged user)
|
||||
if($logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -269,7 +269,7 @@ class MemberModel extends Member
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if homepage and blog are public
|
||||
$homepage_is_public = false;
|
||||
$blog_is_public = false;
|
||||
|
|
@ -292,19 +292,19 @@ class MemberModel extends Member
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// View homepage info
|
||||
if($member_info->homepage && $homepage_is_public)
|
||||
{
|
||||
$oMemberController->addMemberPopupMenu(escape($member_info->homepage, false), 'homepage', '', '_blank', 'homepage');
|
||||
}
|
||||
|
||||
|
||||
// View blog info
|
||||
if($member_info->blog && $blog_is_public)
|
||||
{
|
||||
$oMemberController->addMemberPopupMenu(escape($member_info->blog, false), 'blog', '', '_blank', 'blog');
|
||||
}
|
||||
|
||||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('member.getMemberMenu', 'after', $member_info);
|
||||
// Display a menu for editting member info to a top administrator
|
||||
|
|
@ -315,7 +315,7 @@ class MemberModel extends Member
|
|||
|
||||
$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',0);
|
||||
$oMemberController->addMemberPopupMenu($url,'cmd_spammer',$icon_path,'popup');
|
||||
|
||||
|
||||
$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl);
|
||||
$oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument');
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ class MemberModel extends Member
|
|||
|
||||
/**
|
||||
* @brief Return member information with user_id
|
||||
*
|
||||
*
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getMemberInfoByUserID($user_id)
|
||||
|
|
@ -371,7 +371,7 @@ class MemberModel extends Member
|
|||
|
||||
/**
|
||||
* @brief Return member information with email_address
|
||||
*
|
||||
*
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getMemberInfoByEmailAddress($email_address)
|
||||
|
|
@ -390,7 +390,7 @@ class MemberModel extends Member
|
|||
|
||||
/**
|
||||
* @brief Return member information with phone number
|
||||
*
|
||||
*
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getMemberInfoByPhoneNumber($phone_number, $phone_country = null)
|
||||
|
|
@ -407,7 +407,7 @@ class MemberModel extends Member
|
|||
$phone_country = array(preg_replace('/[^0-9]/', '', $phone_country), Rhymix\Framework\i18n::getCountryCodeByCallingCode($phone_country));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->phone_number = $phone_number;
|
||||
$args->phone_country = $phone_country;
|
||||
|
|
@ -421,7 +421,7 @@ class MemberModel extends Member
|
|||
|
||||
/**
|
||||
* @brief Return member information with member_srl
|
||||
*
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public static function getMemberInfoByMemberSrl($member_srl)
|
||||
|
|
@ -459,7 +459,7 @@ class MemberModel extends Member
|
|||
|
||||
/**
|
||||
* @brief Shortcut to getMemberInfoByMemberSrl()
|
||||
*
|
||||
*
|
||||
* @param int $member_srl
|
||||
* @return object
|
||||
*/
|
||||
|
|
@ -1190,7 +1190,7 @@ class MemberModel extends Member
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$info = null;
|
||||
$member_group = self::getMemberGroups($member_srl);
|
||||
$groups_info = self::getGroups();
|
||||
|
|
@ -1226,7 +1226,7 @@ class MemberModel extends Member
|
|||
$GLOBALS['__member_info__']['group_image_mark'][$member_srl] = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $GLOBALS['__member_info__']['group_image_mark'][$member_srl];
|
||||
}
|
||||
|
||||
|
|
@ -1249,7 +1249,7 @@ class MemberModel extends Member
|
|||
if(file_exists($filename))
|
||||
{
|
||||
$signature = preg_replace('/<\?.*\?>/', '', FileHandler::readFile($filename));
|
||||
|
||||
|
||||
// retroact
|
||||
$config = self::getMemberConfig();
|
||||
if($config->signature_html_retroact == 'Y' && $config->signature_html == 'N' && preg_match('/<[^br]+>/i', $signature))
|
||||
|
|
@ -1257,7 +1257,7 @@ class MemberModel extends Member
|
|||
$signature = preg_replace('/(\r?\n)+/', "\n", $signature);
|
||||
return MemberController::getInstance()->putSignature($member_srl, $signature);
|
||||
}
|
||||
|
||||
|
||||
$GLOBALS['__member_info__']['signature'][$member_srl] = $signature;
|
||||
}
|
||||
else
|
||||
|
|
@ -1265,7 +1265,7 @@ class MemberModel extends Member
|
|||
$GLOBALS['__member_info__']['signature'][$member_srl] = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $GLOBALS['__member_info__']['signature'][$member_srl];
|
||||
}
|
||||
|
||||
|
|
@ -1283,7 +1283,7 @@ class MemberModel extends Member
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Check the password
|
||||
$password_match = false;
|
||||
$current_algorithm = false;
|
||||
|
|
@ -1301,7 +1301,7 @@ class MemberModel extends Member
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Update the encryption method if necessary
|
||||
$config = self::getMemberConfig();
|
||||
if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
|
||||
|
|
@ -1324,7 +1324,7 @@ class MemberModel extends Member
|
|||
$need_upgrade = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($need_upgrade)
|
||||
{
|
||||
$args = new stdClass();
|
||||
|
|
@ -1333,10 +1333,10 @@ class MemberModel extends Member
|
|||
MemberController::getInstance()->updateMemberPassword($args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Create a hash of plain text password
|
||||
* @param string $password_text The password to hash
|
||||
|
|
@ -1347,37 +1347,37 @@ class MemberModel extends Member
|
|||
{
|
||||
return Rhymix\Framework\Password::hashPassword($password_text, $algorithm);
|
||||
}
|
||||
|
||||
|
||||
public static function checkPasswordStrength($password, $strength)
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y') return true;
|
||||
|
||||
|
||||
if($strength == NULL)
|
||||
{
|
||||
$config = self::getMemberConfig();
|
||||
$strength = $config->password_strength?$config->password_strength:'normal';
|
||||
}
|
||||
|
||||
|
||||
$length = strlen($password);
|
||||
|
||||
|
||||
switch ($strength) {
|
||||
case 'high':
|
||||
if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
|
||||
/* no break */
|
||||
|
||||
|
||||
case 'normal':
|
||||
if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
|
||||
break;
|
||||
|
||||
|
||||
case 'low':
|
||||
if($length < 4) return false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static function getAdminGroupSrl()
|
||||
{
|
||||
$groupSrl = 0;
|
||||
|
|
@ -1395,12 +1395,12 @@ class MemberModel extends Member
|
|||
}
|
||||
return $groupSrl;
|
||||
}
|
||||
|
||||
|
||||
public static function getMemberModifyNicknameLog($page = 1, $member_srl = null)
|
||||
{
|
||||
$search_keyword = Context::get('search_keyword');
|
||||
$search_target = Context::get('search_target');
|
||||
|
||||
|
||||
// $this->user 에 재대로 된 회원 정보가 들어 가지 않음.
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
|
@ -1429,14 +1429,14 @@ class MemberModel extends Member
|
|||
break;
|
||||
}
|
||||
$output = executeQuery('member.getMemberModifyNickName', $args);
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('member.getMemberModifyNickName', $args);
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ class MemberView extends Member
|
|||
|
||||
// Get the member information if logged-in
|
||||
if($this->user->member_srl) throw new Rhymix\Framework\Exception('msg_already_logged');
|
||||
// call a trigger (before)
|
||||
// call a trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config);
|
||||
if(!$trigger_output->toBool()) return $trigger_output;
|
||||
|
||||
|
|
@ -233,11 +233,11 @@ class MemberView extends Member
|
|||
throw new Rhymix\Framework\Exceptions\FeatureDisabled('msg_signup_disabled');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$formTags = getAdminView('member')->_getMemberInputTag();
|
||||
Context::set('formTags', $formTags);
|
||||
Context::set('email_confirmation_required', $member_config->enable_confirm);
|
||||
|
||||
|
||||
// Editor of the module set for signing by calling getEditor
|
||||
foreach($formTags as $formTag)
|
||||
{
|
||||
|
|
@ -262,21 +262,21 @@ class MemberView extends Member
|
|||
{
|
||||
$option->editor_skin = 'textarea';
|
||||
}
|
||||
|
||||
|
||||
Context::set('editor', getModel('editor')->getEditor(0, $option));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$identifierForm = new stdClass;
|
||||
$identifierForm->title = lang($member_config->identifier);
|
||||
$identifierForm->name = $member_config->identifier;
|
||||
Context::set('identifierForm', $identifierForm);
|
||||
|
||||
|
||||
$this->addExtraFormValidatorMessage();
|
||||
|
||||
|
||||
// Set a copy of the agreement for compatibility with old skins
|
||||
$member_config->agreement = $member_config->agreements[1]->content ?? '';
|
||||
|
||||
|
||||
// Set a template file
|
||||
$this->setTemplateFile('signup_form');
|
||||
}
|
||||
|
|
@ -301,7 +301,7 @@ class MemberView extends Member
|
|||
if ($this->member_config->identifier == 'email_address')
|
||||
{
|
||||
Context::set('identifierTitle', lang('email_address'));
|
||||
Context::set('identifierValue', $logged_info->email_address);
|
||||
Context::set('identifierValue', $logged_info->email_address);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -315,7 +315,7 @@ class MemberView extends Member
|
|||
/**
|
||||
* @brief Modify member information
|
||||
*/
|
||||
function dispMemberModifyInfo()
|
||||
function dispMemberModifyInfo()
|
||||
{
|
||||
if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
|
||||
{
|
||||
|
|
@ -337,10 +337,10 @@ class MemberView extends Member
|
|||
$member_info = MemberModel::getMemberInfoByMemberSrl($member_srl, 0, $columnList);
|
||||
$member_info->signature = MemberModel::getSignature($member_srl);
|
||||
Context::set('member_info', $member_info);
|
||||
|
||||
|
||||
$formTags = getAdminView('member')->_getMemberInputTag($member_info);
|
||||
Context::set('formTags', $formTags);
|
||||
|
||||
|
||||
// Editor of the module set for signing by calling getEditor
|
||||
foreach($formTags as $formTag)
|
||||
{
|
||||
|
|
@ -365,19 +365,19 @@ class MemberView extends Member
|
|||
{
|
||||
$option->editor_skin = 'textarea';
|
||||
}
|
||||
|
||||
|
||||
Context::set('editor', getModel('editor')->getEditor($member_info->member_srl, $option));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$identifierForm = new stdClass;
|
||||
$identifierForm->title = lang($member_config->identifier);
|
||||
$identifierForm->name = $member_config->identifier;
|
||||
$identifierForm->value = $member_info->{$member_config->identifier};
|
||||
Context::set('identifierForm', $identifierForm);
|
||||
|
||||
|
||||
$this->addExtraFormValidatorMessage();
|
||||
|
||||
|
||||
// Set a template file
|
||||
$this->setTemplateFile('modify_info');
|
||||
}
|
||||
|
|
@ -411,7 +411,7 @@ class MemberView extends Member
|
|||
$args->module_srl = intval(Context::get('selected_module_srl')) ?: null;
|
||||
$args->sort_index = 'list_order';
|
||||
$args->statusList = array('PUBLIC', 'SECRET');
|
||||
|
||||
|
||||
$columnList = array('document_srl', 'module_srl', 'category_srl', 'member_srl', 'title', 'nick_name', 'comment_count', 'trackback_count', 'readed_count', 'voted_count', 'blamed_count', 'regdate', 'ipaddress', 'status');
|
||||
$output = DocumentModel::getDocumentList($args, false, false, $columnList);
|
||||
Context::set('total_count', $output->total_count);
|
||||
|
|
@ -454,7 +454,7 @@ class MemberView extends Member
|
|||
$args->member_srl = array($this->user->member_srl, $this->user->member_srl * -1);
|
||||
$args->module_srl = intval(Context::get('selected_module_srl')) ?: null;
|
||||
$args->sort_index = 'list_order';
|
||||
|
||||
|
||||
$output = CommentModel::getTotalCommentList($args);
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
|
|
@ -485,7 +485,7 @@ class MemberView extends Member
|
|||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
||||
// Check folders
|
||||
$args = new stdClass;
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
|
|
@ -498,11 +498,11 @@ class MemberView extends Member
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$output = executeQueryArray('member.getScrapFolderList', $args);
|
||||
$folders = $output->data;
|
||||
}
|
||||
|
||||
|
||||
// Get default folder if no folder is selected
|
||||
$folder_srl = (int)Context::get('folder_srl');
|
||||
if($folder_srl && !array_filter($folders, function($folder) use($folder_srl) { return $folder->folder_srl == $folder_srl; }))
|
||||
|
|
@ -513,7 +513,7 @@ class MemberView extends Member
|
|||
{
|
||||
$folder_srl = array_first($folders)->folder_srl;
|
||||
}
|
||||
|
||||
|
||||
// Get folder info
|
||||
$folder_info = new stdClass;
|
||||
foreach($folders as $folder)
|
||||
|
|
@ -547,7 +547,7 @@ class MemberView extends Member
|
|||
break;
|
||||
}
|
||||
$output = executeQueryArray('member.getScrapDocumentList', $args);
|
||||
|
||||
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
|
|
@ -577,7 +577,7 @@ class MemberView extends Member
|
|||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info->member_srl) throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
// Get the saved document(module_srl is set to member_srl instead)
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->page = Context::get('page');
|
||||
|
|
@ -607,7 +607,7 @@ class MemberView extends Member
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->page = Context::get('page');
|
||||
|
|
@ -617,7 +617,7 @@ class MemberView extends Member
|
|||
Context::set('page', $output->page);
|
||||
Context::set('active_logins', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$output = executeQueryArray('member.getMemberDevice', $args);
|
||||
|
|
@ -625,9 +625,9 @@ class MemberView extends Member
|
|||
|
||||
$this->setTemplateFile('active_logins');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Display the login form
|
||||
* @brief Display the login form
|
||||
*/
|
||||
function dispMemberLoginForm()
|
||||
{
|
||||
|
|
@ -638,7 +638,7 @@ class MemberView extends Member
|
|||
$referer_url = getNotEncodedUrl('act', '');
|
||||
}
|
||||
Context::set('referer_url', $referer_url);
|
||||
|
||||
|
||||
// Return to previous screen if already logged in.
|
||||
if(Context::get('is_logged'))
|
||||
{
|
||||
|
|
@ -734,7 +734,7 @@ class MemberView extends Member
|
|||
$this->setRedirectUrl(getNotEncodedUrl('act', ''));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$output = MemberController::getInstance()->procMemberLogout();
|
||||
$this->setRedirectUrl(isset($output->redirect_url) ? $output->redirect_url : getNotEncodedUrl('act', ''));
|
||||
}
|
||||
|
|
@ -808,7 +808,7 @@ class MemberView extends Member
|
|||
$js_code[] = 'if(!validator) return false;';
|
||||
|
||||
$errorLang = array();
|
||||
foreach($extraList as $val)
|
||||
foreach($extraList as $val)
|
||||
{
|
||||
$title = str_ireplace(array('<script', '</script'), array('<scr"+"ipt', '</scr"+"ipt'), addslashes($val->column_title));
|
||||
if($val->column_type == 'kr_zip' || $val->column_type == 'tel')
|
||||
|
|
@ -832,7 +832,7 @@ class MemberView extends Member
|
|||
|
||||
/**
|
||||
* Spammer manage popup
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function dispMemberSpammer()
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ class menuAdminController extends menu
|
|||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMenuAdminManagement', 'menu_srl', $args->menu_srl);
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change the menu design (layout)
|
||||
*/
|
||||
|
|
@ -253,7 +253,7 @@ class menuAdminController extends menu
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass;
|
||||
$args->menu_srl = $menu_srl;
|
||||
$output = executeQueryArray('layout.getLayoutModules', $args);
|
||||
|
|
@ -285,7 +285,7 @@ class menuAdminController extends menu
|
|||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::clearGroup('site_and_module');
|
||||
}
|
||||
}
|
||||
|
|
@ -1653,10 +1653,10 @@ class menuAdminController extends menu
|
|||
$oModuleModel = getModel('module');
|
||||
//$info = $oModuleModel->getModuleInfoXml($moduleName);
|
||||
$info = $oModuleModel->getModuleActionXml($moduleName);
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
$args->url = 'index.php?module=admin';
|
||||
|
||||
|
||||
if($info->menu->{$menuName}->index)
|
||||
{
|
||||
$args->url .= '&act=' . $info->menu->{$menuName}->index;
|
||||
|
|
@ -1665,7 +1665,7 @@ class menuAdminController extends menu
|
|||
{
|
||||
$args->url .= '&act=' . $info->admin_index_act;
|
||||
}
|
||||
|
||||
|
||||
$args->menu_item_srl = (!$requestArgs->menu_item_srl) ? getNextSequence() : $requestArgs->menu_item_srl;
|
||||
$args->parent_srl = $requestArgs->parent_srl;
|
||||
$args->menu_srl = $requestArgs->menu_srl;
|
||||
|
|
@ -1730,7 +1730,7 @@ class menuAdminController extends menu
|
|||
{
|
||||
$exposure = implode(',', $exposure);
|
||||
}
|
||||
|
||||
|
||||
if(in_array($exposure, array('-1','-3')))
|
||||
{
|
||||
$args->group_srls = $exposure;
|
||||
|
|
@ -1835,7 +1835,7 @@ class menuAdminController extends menu
|
|||
FileHandler::writeFile($xml_file, '<root />');
|
||||
FileHandler::writeFile($php_file, '<?php if(!defined("__XE__")) exit(); ?>');
|
||||
return $xml_file;
|
||||
}
|
||||
}
|
||||
$site_srl = 0;
|
||||
$domain = null;
|
||||
|
||||
|
|
@ -1947,7 +1947,7 @@ class menuAdminController extends menu
|
|||
{
|
||||
$child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
|
||||
}
|
||||
|
||||
|
||||
// List variables
|
||||
$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
|
||||
$name_arr_str = '';
|
||||
|
|
@ -1976,11 +1976,11 @@ class menuAdminController extends menu
|
|||
$normal_btn = strval($node->normal_btn);
|
||||
if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = escape($normal_btn);
|
||||
else $normal_btn = '';
|
||||
|
||||
|
||||
$hover_btn = strval($node->hover_btn);
|
||||
if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = escape($hover_btn);
|
||||
else $hover_btn = '';
|
||||
|
||||
|
||||
$active_btn = strval($node->active_btn);
|
||||
if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = escape($active_btn);
|
||||
else $active_btn = '';
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ class menuAdminModel extends menu
|
|||
$menu_info->php_file = sprintf('./files/cache/menu/%d.php',$menu_srl);
|
||||
return $menu_info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get actual menu info data
|
||||
*
|
||||
*
|
||||
* @param int $menu_srl
|
||||
* @return object
|
||||
*/
|
||||
|
|
@ -85,7 +85,7 @@ class menuAdminModel extends menu
|
|||
{
|
||||
$menu = new stdClass;
|
||||
$menu->list = [];
|
||||
|
||||
|
||||
$filename = sprintf('./files/cache/menu/%d.php', $menu_srl);
|
||||
if (!FileHandler::exists($filename))
|
||||
{
|
||||
|
|
@ -95,7 +95,7 @@ class menuAdminModel extends menu
|
|||
{
|
||||
include $filename;
|
||||
}
|
||||
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
|
|
@ -350,7 +350,7 @@ class menuAdminModel extends menu
|
|||
|
||||
$oAutoinstallAdminModel = getAdminModel('autoinstall');
|
||||
$config = $oAutoinstallAdminModel->getAutoInstallAdminModuleConfig();
|
||||
|
||||
|
||||
foreach($_allModules as $module_name)
|
||||
{
|
||||
$module = $oModuleModel->getModuleInfoXml($module_name);
|
||||
|
|
@ -489,7 +489,7 @@ class menuAdminModel extends menu
|
|||
$oModuleModel = getModel('module');
|
||||
$oMenuAdminController = getAdminController('menu');
|
||||
$columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl');
|
||||
|
||||
|
||||
$start_module_list = executeQuery('module.getDomainInfo', new stdClass);
|
||||
$start_module = $start_module_list->data;
|
||||
|
||||
|
|
@ -503,7 +503,7 @@ class menuAdminModel extends menu
|
|||
{
|
||||
include($php_file);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$oMenuAdminController->makeXmlFile($menuSrl);
|
||||
}
|
||||
|
|
@ -663,7 +663,7 @@ class menuAdminModel extends menu
|
|||
{
|
||||
$start_module = $start_module ? array($start_module) : array();
|
||||
}
|
||||
|
||||
|
||||
// if url is empty and is_shortcut is 'N', change to is_shortcut 'Y'
|
||||
if(!$menu['url'] && $menu['is_shortcut'] == 'N')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class menuAdminView extends menu
|
|||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Site map admin menu index page
|
||||
* @return void
|
||||
|
|
@ -40,7 +40,7 @@ class menuAdminView extends menu
|
|||
$oMenuController = getAdminController('menu');
|
||||
$oMenuController->linkAllModuleInstancesToSitemap();
|
||||
}
|
||||
|
||||
|
||||
// get installed module list
|
||||
$oPageController = getController('page'); //for lang
|
||||
$oMenuAdminModel = getAdminModel('menu');
|
||||
|
|
@ -79,7 +79,7 @@ class menuAdminView extends menu
|
|||
}
|
||||
}
|
||||
Context::set('group_list', $groupList);
|
||||
|
||||
|
||||
// Get layout instance list
|
||||
$oLayoutModel = getModel('layout');
|
||||
$layouts_P = $oLayoutModel->getLayoutList(0, 'P') ?: [];
|
||||
|
|
|
|||
|
|
@ -27,19 +27,19 @@ class menu extends ModuleObject
|
|||
function checkUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
|
||||
// 2015. 06. 15 add column desc
|
||||
if(!$oDB->isColumnExists('menu_item', 'desc'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 2021. 01. 20 add column icon
|
||||
if(!$oDB->isColumnExists('menu_item', 'icon'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -50,13 +50,13 @@ class menu extends ModuleObject
|
|||
function moduleUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
|
||||
// 2015. 06. 15 add column desc
|
||||
if(!$oDB->isColumnExists('menu_item', 'desc'))
|
||||
{
|
||||
$oDB->addColumn('menu_item', 'desc', 'varchar', 250, null, false, 'name');
|
||||
}
|
||||
|
||||
|
||||
// 2021. 01. 20 add column icon
|
||||
if(!$oDB->isColumnExists('menu_item', 'icon'))
|
||||
{
|
||||
|
|
@ -116,4 +116,4 @@ class menu extends ModuleObject
|
|||
}
|
||||
}
|
||||
/* End of file menu.class.php */
|
||||
/* Location: ./modules/menu/menu.class.php */
|
||||
/* Location: ./modules/menu/menu.class.php */
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class menuMobile extends moduleObject
|
|||
}
|
||||
}
|
||||
|
||||
Context::set('menu', $this->result);
|
||||
Context::set('menu', $this->result);
|
||||
|
||||
$this->setTemplatePath(sprintf("%stpl/",$this->module_path));
|
||||
$this->setTemplateFile('menu.html');
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Message extends ModuleObject
|
|||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
class MessageMobile extends MessageView
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
/* End of file message.mobile.php */
|
||||
/* Location: ./modules/message/message.mobile.php */
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class MessageView extends Message
|
|||
{
|
||||
$config->mskin = 'default';
|
||||
}
|
||||
|
||||
|
||||
// Set the template path
|
||||
if (contains('mobile', get_class($this), false))
|
||||
{
|
||||
|
|
@ -63,13 +63,13 @@ class MessageView extends Message
|
|||
// Get the member configuration
|
||||
$member_config = ModuleModel::getModuleConfig('member');
|
||||
Context::set('member_config', $member_config);
|
||||
|
||||
|
||||
// Disable location if debug not available
|
||||
if (!Rhymix\Framework\Debug::isEnabledForCurrentUser())
|
||||
{
|
||||
$location = null;
|
||||
}
|
||||
|
||||
|
||||
// Remove basedir from location (if any)
|
||||
if ($location && starts_with(\RX_BASEDIR, $location))
|
||||
{
|
||||
|
|
@ -80,7 +80,7 @@ class MessageView extends Message
|
|||
Context::set('system_message', nl2br($this->getMessage()));
|
||||
Context::set('system_message_detail', nl2br($detail));
|
||||
Context::set('system_message_location', escape($location));
|
||||
|
||||
|
||||
if ($this->getError())
|
||||
{
|
||||
if ($detail)
|
||||
|
|
@ -94,7 +94,7 @@ class MessageView extends Message
|
|||
}
|
||||
|
||||
$this->setTemplateFile('system_message');
|
||||
|
||||
|
||||
// Default 403 Error
|
||||
if($this->getHttpStatusCode() === 200)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -285,10 +285,10 @@ class ModuleAdminController extends Module
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
if(!$module_info) throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
// Register Admin ID
|
||||
$oModuleController->deleteAdminId($module_srl);
|
||||
$admin_member = Context::get('admin_member');
|
||||
|
|
@ -357,9 +357,9 @@ class ModuleAdminController extends Module
|
|||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete("site_and_module:module_grants:$module_srl");
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
|
@ -646,10 +646,10 @@ class ModuleAdminController extends Module
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::delete("site_and_module:module_grants:$module_srl");
|
||||
$this->setMessage('success_registed');
|
||||
|
||||
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
|
||||
{
|
||||
if(Context::get('success_return_url'))
|
||||
|
|
@ -876,10 +876,10 @@ class ModuleAdminController extends Module
|
|||
|
||||
$langMap[$langCode] += $langMap[$targetLangCode];
|
||||
}
|
||||
|
||||
|
||||
Rhymix\Framework\Cache::set('site_and_module:user_defined_langs:0:' . $langCode, $langMap[$langCode], 0, true);
|
||||
}
|
||||
|
||||
|
||||
$currentLang = Context::getLangType();
|
||||
return isset($langMap[$currentLang]) ? $langMap[$currentLang] : array();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class ModuleAdminModel extends Module
|
|||
$group_list = MemberModel::getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
//Security
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('group_list..title');
|
||||
$security->encodeHTML('group_list..description');
|
||||
|
|
@ -360,12 +360,12 @@ class ModuleAdminModel extends Module
|
|||
|
||||
if($skin_info->extra_vars)
|
||||
{
|
||||
foreach($skin_info->extra_vars as $key => $val)
|
||||
foreach($skin_info->extra_vars as $key => $val)
|
||||
{
|
||||
$group = $val->group;
|
||||
$name = $val->name;
|
||||
$type = $val->type;
|
||||
if($skin_vars[$name])
|
||||
if($skin_vars[$name])
|
||||
{
|
||||
$value = $skin_vars[$name]->value;
|
||||
}
|
||||
|
|
@ -387,7 +387,7 @@ class ModuleAdminModel extends Module
|
|||
Context::set('mode', $mode);
|
||||
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security = new Security();
|
||||
$security->encodeHTML('mid');
|
||||
$security->encodeHTML('module_info.browser_title');
|
||||
$security->encodeHTML('skin_info...');
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class ModuleAdminView extends Module
|
|||
$module_info = $oModuleModel->getModuleInfoXml(Context::get('selected_module'));
|
||||
Context::set('module_info', $module_info);
|
||||
|
||||
$security = new Security();
|
||||
$security = new Security();
|
||||
$security->encodeHTML('module_info...');
|
||||
|
||||
// Set the layout to be pop-up
|
||||
|
|
@ -257,7 +257,7 @@ class ModuleAdminView extends Module
|
|||
$oMemberModel = getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
$security = new Security();
|
||||
$security = new Security();
|
||||
$security->encodeHTML('group_list..title');
|
||||
|
||||
// Set the layout to be pop-up
|
||||
|
|
@ -310,10 +310,10 @@ class ModuleAdminView extends Module
|
|||
Context::set('filebox_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
Context::set('page', $page);
|
||||
|
||||
|
||||
$max_filesize = min(FileHandler::returnBytes(ini_get('upload_max_filesize')), FileHandler::returnBytes(ini_get('post_max_size')));
|
||||
Context::set('max_filesize', $max_filesize);
|
||||
|
||||
|
||||
$oSecurity = new Security();
|
||||
$oSecurity->encodeHTML('filebox_list..comment', 'filebox_list..attributes.');
|
||||
$this->setTemplateFile('adminFileBox');
|
||||
|
|
|
|||
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