/** * faceoff import * @deprecated * @return void */ function procLayoutAdminUserLayoutImport() { return $this->stop('not supported'); // check upload if (!Context::isUploaded()) { exit; } $file = Context::get('file'); if (!is_uploaded_file($file['tmp_name']) || !checkUploadedFile($file['tmp_name'])) { exit; } if (substr_compare($file['name'], '.tar', -4) !== 0) { exit; } $layout_srl = Context::get('layout_srl'); if (!$layout_srl) { exit; } $oLayoutModel = getModel('layout'); $user_layout_path = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath($layout_srl)); if (!move_uploaded_file($file['tmp_name'], $user_layout_path . 'faceoff.tar')) { exit; } $this->importLayout($layout_srl, $user_layout_path . 'faceoff.tar'); $this->setRedirectUrl(Context::get('error_return_url')); }
/** * @brief Add and update a file into the file box **/ function procModuleFileBoxAdd() { $ajax = Context::get('ajax'); if ($ajax) { Context::setRequestMethod('JSON'); } $logged_info = Context::get('logged_info'); if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) { return new Object(-1, 'msg_not_permitted'); } $vars = Context::gets('addfile', 'filter'); $attributes = Context::getRequestVars(); foreach ($attributes as $key => $value) { if (!(strpos($key, 'attribute_name') === false)) { $vars->comment = $vars->comment . ';' . $value; } if (!(strpos($key, 'attribute_value') === false)) { $vars->comment = $vars->comment . ':' . $value; } } $vars->comment = substr($vars->comment, 1); $module_filebox_srl = Context::get('module_filebox_srl'); $ext = strtolower(substr(strrchr($vars->addfile['name'], '.'), 1)); $vars->ext = $ext; if ($vars->filter) { $filter = explode(',', $vars->filter); } else { $filter = array('jpg', 'jpeg', 'gif', 'png'); } if (!in_array($ext, $filter)) { return new Object(-1, 'msg_error_occured'); } $vars->member_srl = $logged_info->member_srl; // update if ($module_filebox_srl > 0) { $vars->module_filebox_srl = $module_filebox_srl; $output = $this->updateModuleFileBox($vars); // insert } else { if (!Context::isUploaded()) { return new Object(-1, 'msg_error_occured'); } $addfile = Context::get('addfile'); if (!is_uploaded_file($addfile['tmp_name'])) { return new Object(-1, 'msg_error_occured'); } if ($vars->addfile['error'] != 0) { return new Object(-1, 'msg_error_occured'); } $output = $this->insertModuleFileBox($vars); } $this->setTemplatePath($this->module_path . 'tpl'); if (!$ajax) { $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispModuleAdminFileBox'); $this->setRedirectUrl($returnUrl); return; } else { $this->add('save_filename', $output->get('save_filename')); } }
/** * @brief Add and update a file into the file box */ function procModuleFileBoxAdd() { $ajax = Context::get('ajax'); if ($ajax) { Context::setRequestMethod('JSON'); } $logged_info = Context::get('logged_info'); if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) { return new Object(-1, 'msg_not_permitted'); } $vars = Context::gets('addfile', 'filter'); $attributeNames = Context::get('attribute_name'); $attributeValues = Context::get('attribute_value'); if (is_array($attributeNames) && is_array($attributeValues) && count($attributeNames) == count($attributeValues)) { $attributes = array(); foreach ($attributeNames as $no => $name) { if (empty($name)) { continue; } $attributes[] = sprintf('%s:%s', $name, $attributeValues[$no]); } $attributes = implode(';', $attributes); } $vars->comment = $attributes; $module_filebox_srl = Context::get('module_filebox_srl'); $ext = strtolower(substr(strrchr($vars->addfile['name'], '.'), 1)); $vars->ext = $ext; if ($vars->filter) { $filter = array_map('trim', explode(',', $vars->filter)); if (!in_array($ext, $filter)) { return new Object(-1, 'msg_error_occured'); } } $vars->member_srl = $logged_info->member_srl; // update if ($module_filebox_srl > 0) { $vars->module_filebox_srl = $module_filebox_srl; $output = $this->updateModuleFileBox($vars); } else { if (!Context::isUploaded()) { return new Object(-1, 'msg_error_occured'); } $addfile = Context::get('addfile'); if (!is_uploaded_file($addfile['tmp_name'])) { return new Object(-1, 'msg_error_occured'); } if ($vars->addfile['error'] != 0) { return new Object(-1, 'msg_error_occured'); } $output = $this->insertModuleFileBox($vars); } $this->setTemplatePath($this->module_path . 'tpl'); if (!$ajax) { $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispModuleAdminFileBox'); $this->setRedirectUrl($returnUrl); return; } else { if ($output) { $this->add('save_filename', $output->get('save_filename')); } else { $this->add('save_filename', ''); } } }
function procIssuetrackerAdminAttachRelease() { $module_srl = Context::get('module_srl'); $module = Context::get('module'); $mid = Context::get('mid'); $release_srl = Context::get('release_srl'); $package_srl = Context::get('package_srl'); $comment = Context::get('comment'); $file_info = Context::get('file'); if (!Context::isUploaded() || !$module_srl || !$release_srl) { $msg = Context::getLang('msg_invalid_request'); } else { if (!is_uploaded_file($file_info['tmp_name'])) { $msg = Context::getLang('msg_not_attached'); } else { $oFileController =& getController('file'); $output = $oFileController->insertFile($file_info, $module_srl, $release_srl, 0); $msg = Context::getLang('msg_attached'); $oFileController->setFilesValid($release_srl); $file_srl = $output->get('file_srl'); Context::set('file_srl', $file_srl); if ($comment) { $comment_args->file_srl = $file_srl; $comment_args->comment = $comment; executeQuery('issuetracker.updateReleaseFile', $comment_args); } } } Context::set('msg', $msg); Context::set('layout', 'none'); $this->setTemplatePath(sprintf("%stpl/", $this->module_path)); $this->setTemplateFile('attached'); }
public function procShopToolUserSkinImport(){ if(!$this->module_srl) exit(); // check upload if(!Context::isUploaded()) exit(); $file = Context::get('file'); if(!is_uploaded_file($file['tmp_name'])) exit(); if(!preg_match('/\.(tar)$/i', $file['name'])) exit(); $oShopModel = $this->model; $skin_path = FileHandler::getRealPath($oShopModel->getShopPath($this->module_srl)); $tar_file = $skin_path . 'shop_skin.tar'; FileHandler::removeDir($skin_path); FileHandler::makeDir($skin_path); if(!move_uploaded_file($file['tmp_name'], $tar_file)) exit(); require_once(_XE_PATH_.'libs/tar.class.php'); $tar = new tar(); $tar->openTAR($tar_file); if(!$tar->getFile('shop.html')) return; $replace_path = getNumberingPath($this->module_srl,3); foreach($tar->files as $key => $info) { FileHandler::writeFile($skin_path . $info['name'],str_replace('__SHOP_SKIN_PATH__',$replace_path,$info['file'])); } FileHandler::removeFile($tar_file); }
/** * @brief 플래닛 사진 업로드 **/ function procPlanetPhotoModify() { if (!Context::isUploaded()) { exit; } $photo = Context::get('photo'); if (!is_uploaded_file($photo['tmp_name'])) { exit; } $oPlanetModel =& getModel('planet'); $planet = $oPlanetModel->getMemberPlanet(); if ($planet->isExists()) { $url = getUrl('', 'mid', $planet->getMid()); } else { $module_info = $oPlanetModel->getPlanetConfig(); $url = getUrl('', 'mid', $module_info->mid); } Context::set('url', $url); $this->insertPlanetPhoto($planet->getModuleSrl(), $photo['tmp_name']); $this->setTemplatePath($this->module_path . 'tpl'); $this->setTemplateFile('move_myplanet'); }
/** * @brief faceoff import * **/ function procLayoutAdminUserLayoutImport() { // check upload if (!Context::isUploaded()) { exit; } $file = Context::get('file'); if (!is_uploaded_file($file['tmp_name'])) { exit; } if (!preg_match('/\\.(tar)$/i', $file['name'])) { exit; } $layout_srl = Context::get('layout_srl'); if (!$layout_srl) { exit; } $oLayoutModel =& getModel('layout'); $user_layout_path = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath($layout_srl)); if (!move_uploaded_file($file['tmp_name'], $user_layout_path . 'faceoff.tar')) { exit; } $this->importLayout($layout_srl, $user_layout_path . 'faceoff.tar'); }
/** * @brief 파일박스에 파일 추가 및 업데이트 **/ function procModuleFileBoxAdd() { $logged_info = Context::get('logged_info'); if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) { return new Object(-1, 'msg_not_permitted'); } $vars = Context::gets('comment', 'addfile', 'filter'); $module_filebox_srl = Context::get('module_filebox_srl'); $ext = strtolower(substr(strrchr($vars->addfile['name'], '.'), 1)); $vars->ext = $ext; if ($vars->filter) { $filter = explode(',', $vars->filter); } else { $filter = array('jpg', 'jpeg', 'gif', 'png'); } if (!in_array($ext, $filter)) { return new Object(-1, 'msg_error_occured'); } $vars->member_srl = $logged_info->member_srl; // update if ($module_filebox_srl > 0) { $vars->module_filebox_srl = $module_filebox_srl; $output = $this->updateModuleFileBox($vars); // insert } else { if (!Context::isUploaded()) { return new Object(-1, 'msg_error_occured'); } $addfile = Context::get('addfile'); if (!is_uploaded_file($addfile['tmp_name'])) { return new Object(-1, 'msg_error_occured'); } if ($vars->addfile['error'] != 0) { return new Object(-1, 'msg_error_occured'); } $output = $this->insertModuleFileBox($vars); } $url = getUrl('', 'module', 'module', 'act', 'dispModuleFileBox', 'input', Context::get('input'), 'filter', $vars->filter); $url = html_entity_decode($url); $vars = Context::set('url', $url); $this->setTemplatePath($this->module_path . 'tpl'); $this->setTemplateFile('move_filebox_list'); }
function procTextyleToolUserSkinImport() { if (!$this->module_srl) { exit; } // check upload if (!Context::isUploaded()) { exit; } $file = Context::get('file'); if (!is_uploaded_file($file['tmp_name'])) { exit; } if (!preg_match('/\\.(tar)$/i', $file['name'])) { exit; } $oTextyleModel =& getModel('textyle'); $skin_path = FileHandler::getRealPath($oTextyleModel->getTextylePath($this->module_srl)); $tar_file = $skin_path . 'textyle_skin.tar'; FileHandler::removeDir($skin_path); FileHandler::makeDir($skin_path); if (!move_uploaded_file($file['tmp_name'], $tar_file)) { exit; } require_once _XE_PATH_ . 'libs/tar.class.php'; $tar = new tar(); $tar->openTAR($tar_file); if (!$tar->getFile('textyle.html')) { return; } $replace_path = getNumberingPath($this->module_srl, 3); foreach ($tar->files as $key => $info) { FileHandler::writeFile($skin_path . $info['name'], str_replace('__TEXTYLE_SKIN_PATH__', $replace_path, $info['file'])); } FileHandler::removeFile($tar_file); }