Пример #1
0
 /**
  * @brief 설치시 추가 작업이 필요할시 구현
  **/
 function moduleInstall()
 {
     // action forward에 등록 (관리자 모드에서 사용하기 위함)
     $oModuleController =& getController('module');
     // 기본 에디터 컴포넌트를 추가
     $oEditorController =& getAdminController('editor');
     $oEditorController->insertComponent('colorpicker_text', true);
     $oEditorController->insertComponent('colorpicker_bg', true);
     $oEditorController->insertComponent('emoticon', true);
     $oEditorController->insertComponent('url_link', true);
     $oEditorController->insertComponent('image_link', true);
     $oEditorController->insertComponent('multimedia_link', true);
     $oEditorController->insertComponent('quotation', true);
     $oEditorController->insertComponent('table_maker', true);
     $oEditorController->insertComponent('poll_maker', true);
     $oEditorController->insertComponent('image_gallery', true);
     // 에디터 모듈에서 사용할 디렉토리 생성
     FileHandler::makeDir('./files/cache/editor');
     // 2007. 10. 17 글의 입력(신규 or 수정)이 일어날때마다 자동 저장된 문서를 삭제하는 trigger 추가
     $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
     $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
     // 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가
     $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
     // 2009. 04. 14 editor component 변환 코드를 trigger로 독립
     $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
     return new Object();
 }
Пример #2
0
 /**
  * Display menu
  * @return void
  */
 function dispMenuMenu()
 {
     $menu_srl = Context::get('menu_srl');
     $oAdminModel =& getAdminModel('menu');
     $menu_info = $oAdminModel->getMenu($menu_srl);
     if (!$menu_srl) {
         $oMenuAdminController = getAdminController('menu');
         $homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
         if (file_exists($homeMenuCacheFile)) {
             @(include $homeMenuCacheFile);
         }
         $menu_info->php_file = './files/cache/menu/' . $homeMenuSrl . '.php';
     }
     if (file_exists($menu_info->php_file)) {
         @(include $menu_info->php_file);
     }
     if (is_array($menu->list)) {
         foreach ($menu->list as $menu_item) {
             $this->straightenMenu($menu_item, 0);
         }
     }
     Context::set('menu', $this->result);
     $this->setTemplatePath(sprintf("%stpl/", $this->module_path));
     $this->setTemplateFile('menu.html');
 }
Пример #3
0
 /**
  * @brief Implement if additional tasks are necessary when installing
  */
 function moduleInstall()
 {
     // Register action forward (to use in administrator mode)
     $oModuleController = getController('module');
     // Add the default editor component
     $oEditorController = getAdminController('editor');
     $oEditorController->insertComponent('colorpicker_text', true);
     $oEditorController->insertComponent('colorpicker_bg', true);
     $oEditorController->insertComponent('emoticon', true);
     $oEditorController->insertComponent('url_link', true);
     $oEditorController->insertComponent('image_link', true);
     $oEditorController->insertComponent('multimedia_link', true);
     $oEditorController->insertComponent('quotation', true);
     $oEditorController->insertComponent('table_maker', true);
     $oEditorController->insertComponent('poll_maker', true);
     $oEditorController->insertComponent('image_gallery', true);
     // Create a directory to use in the editor module
     FileHandler::makeDir('./files/cache/editor');
     // 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
     $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
     $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
     // 2007. 10. 23 Add an editor trigger on the module addition setup
     $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
     // 2009. 04. 14 Add a trigger from compiled codes of the editor component
     $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
     return new Object();
 }
Пример #4
0
 /**
  * @brief 설치시 추가 작업이 필요할시 구현
  **/
 function moduleInstall()
 {
     // 몇가지 애드온을 등록
     $oAddonController =& getAdminController('addon');
     $oAddonController->doInsert('autolink');
     $oAddonController->doInsert('blogapi');
     $oAddonController->doInsert('counter');
     $oAddonController->doInsert('member_communication');
     $oAddonController->doInsert('member_extra_info');
     $oAddonController->doInsert('mobile');
     $oAddonController->doInsert('referer');
     $oAddonController->doInsert('resize_image');
     $oAddonController->doInsert('openid_delegation_id');
     $oAddonController->doInsert('point_level_icon');
     // 몇가지 애드온을 기본 활성화 상태로 변경
     $oAddonController->doActivate('autolink');
     $oAddonController->doActivate('counter');
     $oAddonController->doActivate('member_communication');
     $oAddonController->doActivate('member_extra_info');
     $oAddonController->doActivate('mobile');
     $oAddonController->doActivate('referer');
     $oAddonController->doActivate('resize_image');
     $oAddonController->makeCacheFile(0);
     return new Object();
 }
Пример #5
0
function __makeMenu(&$list, $parent_srl)
{
    $oMenuAdminController = getAdminController('menu');
    foreach ($list as $idx => &$item) {
        Context::set('parent_srl', $parent_srl, TRUE);
        Context::set('menu_name', $item['menu_name'], TRUE);
        Context::set('module_type', $item['module_type'], TRUE);
        Context::set('module_id', $item['module_id'], TRUE);
        if ($item['is_shortcut'] === 'Y') {
            Context::set('is_shortcut', $item['is_shortcut'], TRUE);
            Context::set('shortcut_target', $item['shortcut_target'], TRUE);
        } else {
            Context::set('is_shortcut', 'N', TRUE);
            Context::set('shortcut_target', null, TRUE);
        }
        $output = $oMenuAdminController->procMenuAdminInsertItem();
        if ($output instanceof Object && !$output->toBool()) {
            return $output;
        }
        $menu_srl = $oMenuAdminController->get('menu_item_srl');
        $item['menu_srl'] = $menu_srl;
        if ($item['list']) {
            __makeMenu($item['list'], $menu_srl);
        }
    }
}
 function procInstallAdminUpdateIndexModule()
 {
     if (!Context::get('index_module_srl') || !Context::get('menu_item_srl')) {
         return new Object(-1, 'msg_invalid_request');
     }
     $site_args = new stdClass();
     $site_args->site_srl = 0;
     $site_args->index_module_srl = Context::get('index_module_srl');
     $oModuleController = getController('module');
     $oModuleController->updateSite($site_args);
     // get menu item info
     $menuItemSrl = Context::get('menu_item_srl');
     $oMenuAdminModel = getAdminModel('menu');
     $output = $oMenuAdminModel->getMenuItemInfo($menuItemSrl);
     // update homeSitemap.php cache file
     $oMenuAdminController = getAdminController('menu');
     $homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
     if (file_exists($homeMenuCacheFile)) {
         include $homeMenuCacheFile;
     }
     if (!$homeMenuSrl || $homeMenuSrl != $output->menu_srl) {
         $oMenuAdminController->makeHomemenuCacheFile($output->menu_srl);
     }
     $this->setMessage('success_updated');
 }
Пример #7
0
 /**
  * @brief module 삭제시 해당 댓글을 모두 삭제하는 trigger
  **/
 function triggerDeleteModuleComments(&$obj)
 {
     $module_srl = $obj->module_srl;
     if (!$module_srl) {
         return new Object();
     }
     $oCommentController =& getAdminController('comment');
     return $oCommentController->deleteModuleComments($module_srl);
 }
Пример #8
0
 /**
  * Returns addon list
  *
  * @param int $site_srl Site srl
  * @param string $gtype site or global
  * @return array Returns addon list
  */
 function getAddonList($site_srl = 0, $gtype = 'site')
 {
     // Wanted to add a list of activated
     $inserted_addons = $this->getInsertedAddons($site_srl, $gtype);
     // Downloaded and installed add-on to the list of Wanted
     $searched_list = FileHandler::readDir('./addons', '/^([a-zA-Z0-9-_]+)$/');
     $searched_count = count($searched_list);
     if (!$searched_count) {
         return;
     }
     sort($searched_list);
     $oAddonAdminController = getAdminController('addon');
     for ($i = 0; $i < $searched_count; $i++) {
         // Add the name of
         $addon_name = $searched_list[$i];
         if ($addon_name == "smartphone") {
             continue;
         }
         // Add the path (files/addons precedence)
         $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;
         $info->path = $path;
         $info->activated = FALSE;
         $info->mactivated = FALSE;
         $info->fixed = FALSE;
         // Check if a permossion is granted entered in DB
         if (!in_array($addon_name, array_keys($inserted_addons))) {
             // If not, type in the DB type (model, perhaps because of the hate doing this haneungeo .. ㅡ. ㅜ)
             $oAddonAdminController->doInsert($addon_name, $site_srl, $type, 'N', new stdClass());
             // Is activated
         } else {
             if ($inserted_addons[$addon_name]->is_used == 'Y') {
                 $info->activated = TRUE;
             }
             if ($inserted_addons[$addon_name]->is_used_m == 'Y') {
                 $info->mactivated = TRUE;
             }
             if ($gtype == 'global' && $inserted_addons[$addon_name]->is_fixed == 'Y') {
                 $info->fixed = TRUE;
             }
         }
         $list[] = $info;
     }
     return $list;
 }
Пример #9
0
 /**
  * Admin menu reset
  * @return void
  */
 function procAdminMenuReset()
 {
     $menuSrl = Context::get('menu_srl');
     if (!$menuSrl) {
         return $this->stop('msg_invalid_request');
     }
     $oMenuAdminController = getAdminController('menu');
     $output = $oMenuAdminController->deleteMenu($menuSrl);
     if (!$output->toBool()) {
         return $output;
     }
     FileHandler::removeDir('./files/cache/menu/admin_lang/');
     $this->setRedirectUrl(Context::get('error_return_url'));
 }
Пример #10
0
 /**
  * Re-generate the cache file
  * @return void
  */
 function recompileCache()
 {
     $oMenuAdminController =& getAdminController('menu');
     // Wanted list of all the blog module
     $output = executeQueryArray("menu.getMenus");
     $list = $output->data;
     if (!count($list)) {
         return;
     }
     // The menu module is used in the re-create all the menu list
     foreach ($list as $menu_item) {
         $menu_srl = $menu_item->menu_srl;
         $oMenuAdminController->makeXmlFile($menu_srl);
     }
 }
Пример #11
0
 /**
  * Implement if additional tasks are necessary when installing
  *
  * @return Object
  */
 function moduleInstall()
 {
     // Register to add a few
     $oAddonController = getAdminController('addon');
     $oAddonController->doInsert('autolink', 0, 'site', 'Y');
     $oAddonController->doInsert('blogapi');
     $oAddonController->doInsert('member_communication', 0, 'site', 'Y');
     $oAddonController->doInsert('member_extra_info', 0, 'site', 'Y');
     $oAddonController->doInsert('mobile', 0, 'site', 'Y');
     $oAddonController->doInsert('resize_image', 0, 'site', 'Y');
     $oAddonController->doInsert('openid_delegation_id');
     $oAddonController->doInsert('point_level_icon');
     $oAddonController->makeCacheFile(0);
     return new Object();
 }
Пример #12
0
 /**
  * @brief 캐시 파일 재생성
  **/
 function recompileCache()
 {
     // 메뉴 모듈의 캐시 파일 모두 삭제
     FileHandler::removeFilesInDir("./files/cache/menu");
     $oMenuAdminController =& getAdminController('menu');
     // 블로그 모듈 목록을 모두 구함
     $output = executeQueryArray("menu.getMenus");
     $list = $output->data;
     if (!count($list)) {
         return;
     }
     // 메뉴 모듈에서 사용되는 모든 메뉴 목록을 재 생성
     foreach ($list as $menu_item) {
         $menu_srl = $menu_item->menu_srl;
         $oMenuAdminController->makeXmlFile($menu_srl);
     }
 }
 /**
  * Update easy install information
  *
  * @return void
  */
 function _updateinfo()
 {
     $oModel = getModel('autoinstall');
     $item = $oModel->getLatestPackage();
     if ($item) {
         $params["updatedate"] = $item->updatedate;
     }
     $params["act"] = "getResourceapiUpdate";
     $body = XmlGenerater::generate($params);
     $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
     $xml = new XmlParser();
     $xmlDoc = $xml->parse($buff);
     $this->updateCategory($xmlDoc);
     $this->updatePackages($xmlDoc);
     $this->checkInstalled();
     $oAdminController = getAdminController('admin');
     $output = $oAdminController->cleanFavorite();
 }
Пример #14
0
 /**
  * Implement if additional tasks are necessary when installing
  *
  * @return Object
  */
 function moduleInstall()
 {
     // Register to add a few
     $oAddonController = getAdminController('addon');
     $oAddonController->doInsert('autolink', 0, 'site', 'Y');
     $oAddonController->doInsert('blogapi');
     $oAddonController->doInsert('member_extra_info', 0, 'site', 'Y');
     $oAddonController->doInsert('mobile', 0, 'site', 'Y');
     $oAddonController->doInsert('resize_image', 0, 'site', 'Y');
     $oAddonController->doInsert('openid_delegation_id');
     $oAddonController->doInsert('point_level_icon');
     $args = new stdClass();
     $args->xe_validator_id = 'module/addon/tpl/setup_addon/1';
     $args->apply_signup = 'apply';
     $args->xe_run_method = 'run_selected';
     $oAddonController->doInsert('captcha_member', 0, 'site', 'Y', $args);
     $oAddonController->makeCacheFile(0);
     return new Object();
 }
Пример #15
0
 /**
  * Constructor
  *
  * Checks to see if a menu cache file exists, and
  * if not it creates it <br />
  * Loads the menu from the cache file and saves it
  * in the $_menu private property
  *
  * @param $menu_srl
  */
 public function __construct($menu_srl)
 {
     if (!isset($menu_srl)) {
         return NULL;
     }
     /**
      * @var menuAdminModel $menuModel
      */
     $menuModel = getAdminModel('menu');
     $shop_menu = $menuModel->getMenu($menu_srl);
     if (!file_exists($shop_menu->php_file)) {
         $menuAdminController = getAdminController('menu');
         $menuAdminController->makeXmlFile($menu_srl);
     }
     $menu = NULL;
     @(include $shop_menu->php_file);
     // Populates $menu with menu data
     $this->_menu = $menu;
     return $menu;
 }
Пример #16
0
 /**
  * @brief 애드온의 종류와 정보를 구함
  **/
 function getAddonList($site_srl = 0)
 {
     // activated된 애드온 목록을 구함
     $inserted_addons = $this->getInsertedAddons($site_srl);
     // 다운받은 애드온과 설치된 애드온의 목록을 구함
     $searched_list = FileHandler::readDir('./addons');
     $searched_count = count($searched_list);
     if (!$searched_count) {
         return;
     }
     sort($searched_list);
     for ($i = 0; $i < $searched_count; $i++) {
         // 애드온의 이름
         $addon_name = $searched_list[$i];
         // 애드온의 경로 (files/addons가 우선)
         $path = $this->getAddonPath($addon_name);
         // 해당 애드온의 정보를 구함
         unset($info);
         $info = $this->getAddonInfoXml($addon_name, $site_srl);
         $info->addon = $addon_name;
         $info->path = $path;
         $info->activated = false;
         // DB에 입력되어 있는지 확인
         if (!in_array($addon_name, array_keys($inserted_addons))) {
             // DB에 입력되어 있지 않으면 입력 (model에서 이런짓 하는거 싫지만 귀찮아서.. ㅡ.ㅜ)
             $oAddonAdminController =& getAdminController('addon');
             $oAddonAdminController->doInsert($addon_name, $site_srl);
             // 활성화 되어 있는지 확인
         } else {
             if ($inserted_addons[$addon_name]->is_used == 'Y') {
                 $info->activated = true;
             }
         }
         $list[] = $info;
     }
     return $list;
 }
Пример #17
0
 /**
  * Move/ Delete the document in the seession
  * @return void|Object
  */
 function procDocumentManageCheckedDocument()
 {
     @set_time_limit(0);
     if (!Context::get('is_logged')) {
         return new Object(-1, 'msg_not_permitted');
     }
     if (!checkCSRF()) {
         return new Object(-1, 'msg_invalid_request');
     }
     $type = Context::get('type');
     $target_module = Context::get('target_module');
     $module_srl = Context::get('module_srl');
     if ($target_module && !$module_srl) {
         $module_srl = $target_module;
     }
     $category_srl = Context::get('target_category');
     // send default message - misol 2015-07-23
     $send_default_message = Context::get('send_default_message');
     if ($send_default_message === 'Y') {
         $logged_info = Context::get('logged_info');
         $message_content = '';
         $default_message_verbs = lang('default_message_verbs');
         if (isset($default_message_verbs[$type]) && is_string($default_message_verbs[$type])) {
             $message_content = sprintf(lang('default_message_format'), $logged_info->nick_name, $default_message_verbs[$type]);
         }
     } else {
         $message_content = Context::get('message_content');
         if ($message_content) {
             $message_content = nl2br($message_content);
         }
     }
     $cart = Context::get('cart');
     if (!is_array($cart)) {
         $document_srl_list = explode('|@|', $cart);
     } else {
         $document_srl_list = $cart;
     }
     $document_srl_count = count($document_srl_list);
     $oDocumentModel = getModel('document');
     $document_items = array();
     foreach ($document_srl_list as $document_srl) {
         $oDocument = $oDocumentModel->getDocument($document_srl);
         $document_items[] = $oDocument;
         if (!$oDocument->isGranted()) {
             return $this->stop('msg_not_permitted');
         }
     }
     // Set a spam-filer not to be filtered to spams
     $oSpamController = getController('spamfilter');
     $oSpamController->setAvoidLog();
     $oDocumentAdminController = getAdminController('document');
     if ($type == 'move') {
         if (!$module_srl) {
             return new Object(-1, 'fail_to_move');
         }
         $output = $oDocumentAdminController->moveDocumentModule($document_srl_list, $module_srl, $category_srl);
         if (!$output->toBool()) {
             return new Object(-1, 'fail_to_move');
         }
         $msg_code = 'success_moved';
     } else {
         if ($type == 'copy') {
             if (!$module_srl) {
                 return new Object(-1, 'fail_to_move');
             }
             $output = $oDocumentAdminController->copyDocumentModule($document_srl_list, $module_srl, $category_srl);
             if (!$output->toBool()) {
                 return new Object(-1, 'fail_to_move');
             }
             $msg_code = 'success_copied';
         } else {
             if ($type == 'delete') {
                 $oDB =& DB::getInstance();
                 $oDB->begin();
                 for ($i = 0; $i < $document_srl_count; $i++) {
                     $document_srl = $document_srl_list[$i];
                     $output = $this->deleteDocument($document_srl, true);
                     if (!$output->toBool()) {
                         return new Object(-1, 'fail_to_delete');
                     }
                 }
                 $oDB->commit();
                 $msg_code = 'success_deleted';
             } else {
                 if ($type == 'trash') {
                     $args = new stdClass();
                     $args->description = $message_content;
                     $oDB =& DB::getInstance();
                     $oDB->begin();
                     for ($i = 0; $i < $document_srl_count; $i++) {
                         $args->document_srl = $document_srl_list[$i];
                         $output = $this->moveDocumentToTrash($args);
                         if (!$output || !$output->toBool()) {
                             return new Object(-1, 'fail_to_trash');
                         }
                     }
                     $oDB->commit();
                     $msg_code = 'success_trashed';
                 } else {
                     if ($type == 'cancelDeclare') {
                         $args = new stdClass();
                         $args->document_srl = $document_srl_list;
                         $output = executeQuery('document.deleteDeclaredDocuments', $args);
                         $msg_code = 'success_declare_canceled';
                     }
                 }
             }
         }
     }
     // Send a message
     if ($message_content) {
         $oCommunicationController = getController('communication');
         $logged_info = Context::get('logged_info');
         $title = cut_str($message_content, 10, '...');
         $sender_member_srl = $logged_info->member_srl;
         foreach ($document_items as $oDocument) {
             if (!$oDocument->get('member_srl') || $oDocument->get('member_srl') == $sender_member_srl) {
                 continue;
             }
             if ($type == 'move') {
                 $purl = sprintf("<a href=\"%s\" onclick=\"window.open(this.href);return false;\" style=\"padding:10px 0;\">%s</a><hr />", $oDocument->getPermanentUrl(), $oDocument->getPermanentUrl());
             } else {
                 $purl = "";
             }
             $content = sprintf("<div style=\"padding:10px 0;\"><p>%s</p></div><hr />%s<div style=\"padding:10px 0;font-weight:bold\">%s</div>%s", $message_content, $purl, $oDocument->getTitleText(), $oDocument->getContent(false, false, false));
             $oCommunicationController->sendMessage($sender_member_srl, $oDocument->get('member_srl'), $title, $content, false);
         }
     }
     $_SESSION['document_management'] = array();
     $this->setMessage($msg_code);
     $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList');
     $this->setRedirectUrl($returnUrl);
 }
Пример #18
0
 function _replaceLangCode($matches)
 {
     static $lang = null;
     if (is_null($lang)) {
         $site_module_info = Context::get('site_module_info');
         if (!$site_module_info) {
             $oModuleModel =& getModel('module');
             $site_module_info = $oModuleModel->getDefaultMid();
             Context::set('site_module_info', $site_module_info);
         }
         $cache_file = sprintf('%sfiles/cache/lang_defined/%d.%s.php', _XE_PATH_, $site_module_info->site_srl, Context::getLangType());
         if (!file_exists($cache_file)) {
             $oModuleAdminController =& getAdminController('module');
             $oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl);
         }
         if (file_exists($cache_file)) {
             $moduleAdminControllerMtime = filemtime(_XE_PATH_ . 'modules/module/module.admin.controller.php');
             $cacheFileMtime = filemtime($cache_file);
             if ($cacheFileMtime < $moduleAdminControllerMtime) {
                 $oModuleAdminController =& getAdminController('module');
                 $oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl);
             }
             require_once $cache_file;
         }
     }
     if (!Context::get($matches[1]) && $lang[$matches[1]]) {
         return $lang[$matches[1]];
     }
     return str_replace('$user_lang->', '', $matches[0]);
 }
Пример #19
0
 /**
  * @bvrief 모듈 제거
  */
 function moduleUninstall()
 {
     // allianceXE의 model class
     $oAllianceModel = getModel('alliance');
     // 연합 정보를 구함
     $alliance_info = $oAllianceModel->getAllianceInfo();
     // 연합 정보가 있다면 처리
     if ($alliance_info) {
         // allianceXE의 admin controller class
         $oAllianceAdminController = getAdminController('alliance');
         // 연합 관리자일 경우 연합 해체
         if ($oAllianceModel->isGranted($alliance_info)) {
             $oAllianceAdminController->procAllianceAdminBreakup($alliance_info);
         } else {
             // 아니면 탈퇴 처리
             $oAllianceAdminController->procAllianceAdminLeave($alliance_info);
         }
     }
     return new Object();
 }
Пример #20
0
 /**
  * @brief Install with received information
  */
 function procInstall()
 {
     // Check if it is already installed
     if (Context::isInstalled()) {
         return new Object(-1, 'msg_already_installed');
     }
     // Assign a temporary administrator when installing
     $logged_info = new stdClass();
     $logged_info->is_admin = 'Y';
     Context::set('logged_info', $logged_info);
     // check install config
     if (Context::get('install_config')) {
         $db_info = $this->_makeDbInfoByInstallConfig();
     } else {
         if (FileHandler::exists($this->db_tmp_config_file)) {
             include $this->db_tmp_config_file;
         }
         if (FileHandler::exists($this->etc_tmp_config_file)) {
             include $this->etc_tmp_config_file;
         }
     }
     // Set DB type and information
     Context::setDBInfo($db_info);
     // Create DB Instance
     $oDB =& DB::getInstance();
     // Check if available to connect to the DB
     if (!$oDB->isConnected()) {
         return $oDB->getError();
     }
     // Install all the modules
     try {
         $oDB->begin();
         $this->installDownloadedModule();
         $oDB->commit();
     } catch (Exception $e) {
         $oDB->rollback();
         return new Object(-1, $e->getMessage());
     }
     // Create a config file
     if (!$this->makeConfigFile()) {
         return new Object(-1, 'msg_install_failed');
     }
     // load script
     $scripts = FileHandler::readDir(_XE_PATH_ . 'modules/install/script', '/(\\.php)$/');
     if (count($scripts) > 0) {
         sort($scripts);
         foreach ($scripts as $script) {
             $script_path = FileHandler::getRealPath('./modules/install/script/');
             $output = (include $script_path . $script);
         }
     }
     // save selected lang info
     $oInstallAdminController = getAdminController('install');
     $oInstallAdminController->saveLangSelected(array(Context::getLangType()));
     // Display a message that installation is completed
     $this->setMessage('msg_install_completed');
     unset($_SESSION['use_rewrite']);
     if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
         $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('');
         header('location:' . $returnUrl);
         return new Object();
     }
 }
Пример #21
0
 public function getMenuAdminSiteMap()
 {
     $siteSrl = Context::get('site_srl');
     $menuSrl = Context::get('menu_srl');
     if (!isset($siteSrl)) {
         $site_module_info = Context::get('site_module_info');
         $siteSrl = (int) $site_module_info->site_srl;
     }
     $oModuleModel = getModel('module');
     $oMenuAdminController = getAdminController('menu');
     $columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl');
     $start_module = $oModuleModel->getSiteInfo(0, $columnList);
     $menuList = array();
     if ($menuSrl) {
         $isMenuFixed = false;
         $output = $this->getMenu($menuSrl);
         $php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php', $output->menu_srl);
         if (file_exists($php_file)) {
             include $php_file;
         } else {
             $oMenuAdminController->makeXmlFile($menuSrl);
         }
         if (!$menu) {
             $menu = new stdClass();
             $menu->list = array();
         }
         if (count($menu->list) > 0) {
             foreach ($menu->list as $key => $value) {
                 $this->_menuInfoSetting($menu->list[$key], $start_module, $isMenuFixed, $menuSrl, $siteSrl);
             }
             $menu->list = array_values($menu->list);
         } else {
             $menu->list = array();
         }
         // menu recreate
         if ($isMenuFixed) {
             $oMenuAdminController->makeXmlFile($menuSrl);
         }
         $menuItems->menuSrl = $output->menu_srl;
         $menuItems->title = $output->title;
         $menuItems->menuItems = $menu;
         $menuList[] = $menuItems;
     } else {
         $menuListFromDB = $this->getMenus($siteSrl);
         if (is_array($menuListFromDB)) {
             $oAdmin = getClass('admin');
             foreach ($menuListFromDB as $key => $value) {
                 if ($value->title == $oAdmin->getAdminMenuName()) {
                     unset($output[$key]);
                 } else {
                     unset($menu);
                     unset($menuItems);
                     $value->php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php', $value->menu_srl);
                     if (!file_exists($value->php_file)) {
                         $oMenuAdminController->makeXmlFile($value->menu_srl);
                     }
                     include $value->php_file;
                     if (!$menu) {
                         $menu = new stdClass();
                         $menu->list = array();
                     }
                     $isMenuFixed = false;
                     if (count($menu->list) > 0) {
                         foreach ($menu->list as $key2 => $value2) {
                             $this->_menuInfoSetting($menu->list[$key2], $start_module, $isMenuFixed, $value->menu_srl, $siteSrl);
                         }
                         $menu->list = array_values($menu->list);
                     } else {
                         $menu->list = array();
                     }
                     // menu recreate
                     if ($isMenuFixed) {
                         $oMenuAdminController->makeXmlFile($value->menu_srl);
                     }
                     $menuItems = new stdClass();
                     $menuItems->menuSrl = $value->menu_srl;
                     $menuItems->title = $value->title;
                     $menuItems->menuItems = $menu;
                     // If include home menu, move first
                     if ($value->menu_srl == $this->menuSrlWithinHome) {
                         $menuList[-1] = $menuItems;
                     } else {
                         $menuList[] = $menuItems;
                     }
                 }
             }
         }
     }
     ksort($menuList);
     $menuList = array_values($menuList);
     $this->add('menuList', $menuList);
 }
Пример #22
0
 /**
  * Delete layout xml cache file
  * @param int $layout_srl
  * @return Object
  */
 function deleteLayout($layout_srl, $force = FALSE)
 {
     $oLayoutModel = getModel('layout');
     if (!$force) {
         $layoutInfo = $oLayoutModel->getLayout($layout_srl);
         if ($layoutInfo) {
             $layoutList = $oLayoutModel->getLayoutInstanceList($layoutInfo->site_srl, $layoutInfo->layout_type, $layoutInfo->layout, array('layout_srl', 'layout'));
             if (count($layoutList) <= 1) {
                 // uninstall package
                 $path = $layoutInfo->path;
                 $oAutoinstallModel = getModel('autoinstall');
                 $packageSrl = $oAutoinstallModel->getPackageSrlByPath($path);
                 $oAutoinstallAdminController = getAdminController('autoinstall');
                 if ($packageSrl) {
                     $output = $oAutoinstallAdminController->uninstallPackageByPackageSrl($packageSrl);
                 } else {
                     $output = $oAutoinstallAdminController->uninstallPackageByPath($path);
                 }
                 if (!$output->toBool()) {
                     return new Object(-1, $output->message);
                 }
             }
         }
     }
     $path = $oLayoutModel->getUserLayoutPath($layout_srl);
     FileHandler::removeDir($path);
     $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);
     if (!$output->toBool()) {
         return $output;
     }
     return new Object(0, 'success_deleted');
 }
Пример #23
0
 /**
  * Execute update
  *
  * @return Object
  */
 function moduleUpdate()
 {
     $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 a column
     if (!$oDB->isColumnExists("member_auth_mail", "is_register")) {
         $oDB->addColumn("member_auth_mail", "is_register", "char", 1, "N", true);
     }
     // Add a column(site_srl) to "member_group_member" table (11/15/2008)
     if (!$oDB->isColumnExists("member_group_member", "site_srl")) {
         $oDB->addColumn("member_group_member", "site_srl", "number", 11, 0, true);
         $oDB->addIndex("member_group_member", "idx_site_srl", "site_srl", false);
     }
     if (!$oDB->isColumnExists("member_group", "site_srl")) {
         $oDB->addColumn("member_group", "site_srl", "number", 11, 0, true);
         $oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true);
     }
     if ($oDB->isIndexExists("member_group", "uni_member_group_title")) {
         $oDB->dropIndex("member_group", "uni_member_group_title", true);
     }
     // Add a column(list_order) to "member_group" table (05/18/2011)
     if (!$oDB->isColumnExists("member_group", "list_order")) {
         $oDB->addColumn("member_group", "list_order", "number", 11, '', true);
         $oDB->addIndex("member_group", "idx_list_order", "list_order", false);
         $output = executeQuery('member.updateAllMemberGroupListOrder');
     }
     // Add a column for image_mark (02/14/2009)
     if (!$oDB->isColumnExists("member_group", "image_mark")) {
         $oDB->addColumn("member_group", "image_mark", "text");
     }
     // Add a column for password expiration date
     if (!$oDB->isColumnExists("member", "change_password_date")) {
         $oDB->addColumn("member", "change_password_date", "date");
         executeQuery('member.updateAllChangePasswordDate');
     }
     // Add columns of question and answer to verify a password
     if (!$oDB->isColumnExists("member", "find_account_question")) {
         $oDB->addColumn("member", "find_account_question", "number", 11);
     }
     if (!$oDB->isColumnExists("member", "find_account_answer")) {
         $oDB->addColumn("member", "find_account_answer", "varchar", 250);
     }
     if (!$oDB->isColumnExists("member", "list_order")) {
         $oDB->addColumn("member", "list_order", "number", 11);
         @set_time_limit(0);
         $args->list_order = 'member_srl';
         executeQuery('member.updateMemberListOrderAll', $args);
         executeQuery('member.updateMemberListOrderAll');
     }
     if (!$oDB->isIndexExists("member", "idx_list_order")) {
         $oDB->addIndex("member", "idx_list_order", array("list_order"));
     }
     $oModuleModel = getModel('module');
     $config = $oModuleModel->getModuleConfig('member');
     $oModuleController = getController('module');
     // check agreement value exist
     if ($config->agreement) {
         $agreement_file = _XE_PATH_ . 'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
         $output = FileHandler::writeFile($agreement_file, $config->agreement);
         $config->agreement = NULL;
         $output = $oModuleController->updateModuleConfig('member', $config);
     }
     $oMemberAdminController = getAdminController('member');
     // check signup form ordering info
     if (!$config->signupForm || !is_array($config->signupForm)) {
         $identifier = 'user_id';
         $config->signupForm = $oMemberAdminController->createSignupForm($identifier);
         $config->identifier = $identifier;
         unset($config->agreement);
         $output = $oModuleController->updateModuleConfig('member', $config);
     }
     if ($config->skin) {
         $config_parse = explode('.', $config->skin);
         if (count($config_parse) > 1) {
             $template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
             if (is_dir($template_path)) {
                 $config->skin = implode('|@|', $config_parse);
                 $oModuleController = getController('module');
                 $oModuleController->updateModuleConfig('member', $config);
             }
         }
     }
     if (is_readable('./files/member_extra_info/agreement.txt')) {
         $source_file = _XE_PATH_ . 'files/member_extra_info/agreement.txt';
         $target_file = _XE_PATH_ . 'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
         FileHandler::rename($source_file, $target_file);
     }
     FileHandler::makeDir('./files/ruleset');
     if (!is_readable('./files/ruleset/insertMember.xml')) {
         $oMemberAdminController->_createSignupRuleset($config->signupForm);
     }
     if (!is_readable('./files/ruleset/login.xml')) {
         $oMemberAdminController->_createLoginRuleset($config->identifier);
     }
     if (!is_readable('./files/ruleset/find_member_account_by_question.xml')) {
         $oMemberAdminController->_createFindAccountByQuestion($config->identifier);
     }
     // 2013. 11. 22 add menu when popup document menu called
     if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) {
         $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
     }
     if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) {
         $oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after');
     }
     return new Object(0, 'success_updated');
 }
Пример #24
0
 /**
  * Preview a layout with module.
  * 
  * @return Object
  */
 public function dispLayoutPreviewWithModule()
 {
     $content = '';
     $layoutSrl = Context::get('layout_srl');
     $module = Context::get('module_name');
     $mid = Context::get('target_mid');
     $skin = Context::get('skin');
     $skinType = Context::get('skin_type');
     try {
         // admin check
         // this act is admin view but in normal view because do not load admin css/js files
         $logged_info = Context::get('logged_info');
         if ($logged_info->is_admin != 'Y') {
             throw new Exception(Context::getLang('msg_invalid_request'));
         }
         // if module is 'ARTiCLE' and from site design setting, make content directly
         if ($module == 'ARTICLE' && !$mid) {
             $oDocumentModel = getModel('document');
             $oDocument = $oDocumentModel->getDocument(0, true);
             $t = Context::getLang('article_preview_title');
             $c = '';
             for ($i = 0; $i < 4; $i++) {
                 $c .= '<p>';
                 for ($j = 0; $j < 20; $j++) {
                     $c .= Context::getLang('article_preview_content') . ' ';
                 }
                 $c .= '</p>';
             }
             $attr = new stdClass();
             $attr->title = $t;
             $attr->content = $c;
             $attr->document_srl = -1;
             $oDocument->setAttribute($attr, FALSE);
             Context::set('oDocument', $oDocument);
             if ($skinType == 'M') {
                 $templatePath = _XE_PATH_ . 'modules/page/m.skins/' . $skin;
                 $templateFile = 'mobile';
             } else {
                 $templatePath = _XE_PATH_ . 'modules/page/skins/' . $skin;
                 $templateFile = 'content';
             }
             $oTemplate = TemplateHandler::getInstance();
             $content = $oTemplate->compile($templatePath, $templateFile);
         } else {
             $content = $this->procRealModule($module, $mid, $skin, $skinType);
         }
         Context::set('content', $content);
         // find layout
         if ($layoutSrl) {
             if ($layoutSrl == -1) {
                 $site_srl = $oModule ? $oModule->module_info->site_srl : 0;
                 $designInfoFile = sprintf(_XE_PATH_ . 'files/site_design/design_%s.php', $site_srl);
                 include $designInfoFile;
                 if ($skinType == 'M') {
                     $layoutSrl = $designInfo->mlayout_srl;
                 } else {
                     $layoutSrl = $designInfo->layout_srl;
                 }
             }
             $oLayoutModel = getModel('layout');
             $layoutInfo = $oLayoutModel->getLayout($layoutSrl);
             // If there is no layout, pass it.
             if ($layoutInfo) {
                 // Adhoc...
                 // Input extra_vars into $layout_info
                 if ($layoutInfo->extra_var_count) {
                     foreach ($layoutInfo->extra_var as $var_id => $val) {
                         if ($val->type == 'image') {
                             if (strncmp('./files/attach/images/', $val->value, 22) === 0) {
                                 $val->value = Context::getRequestUri() . substr($val->value, 2);
                             }
                         }
                         $layoutInfo->{$var_id} = $val->value;
                     }
                 }
                 // Set menus into context
                 if ($layoutInfo->menu_count) {
                     foreach ($layoutInfo->menu as $menu_id => $menu) {
                         // set default menu set(included home menu)
                         if (!$menu->menu_srl || $menu->menu_srl == -1) {
                             $oMenuAdminController = getAdminController('menu');
                             $homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
                             if (file_exists($homeMenuCacheFile)) {
                                 include $homeMenuCacheFile;
                             }
                             if (!$menu->menu_srl) {
                                 $menu->xml_file = str_replace('.xml.php', $homeMenuSrl . '.xml.php', $menu->xml_file);
                                 $menu->php_file = str_replace('.php', $homeMenuSrl . '.php', $menu->php_file);
                                 $layoutInfo->menu->{$menu_id}->menu_srl = $homeMenuSrl;
                             } else {
                                 $menu->xml_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->xml_file);
                                 $menu->php_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->php_file);
                             }
                         }
                         $menu->php_file = FileHandler::getRealPath($menu->php_file);
                         if (FileHandler::exists($menu->php_file)) {
                             include $menu->php_file;
                         }
                         Context::set($menu_id, $menu);
                     }
                 }
                 Context::set('layout_info', $layoutInfo);
             }
         }
     } catch (Exception $e) {
         $content = '<div class="message error"><p id="preview_error">' . $e->getMessage() . '</p></div>';
         Context::set('content', $content);
         $layoutSrl = 0;
     }
     // Compile
     $oTemplate = TemplateHandler::getInstance();
     Context::clearHtmlHeader();
     if ($layoutInfo) {
         $layout_path = $layoutInfo->path;
         $editLayoutTPL = $this->getRealLayoutFile($layoutSrl);
         $editLayoutCSS = $this->getRealLayoutCSS($layoutSrl);
         if ($editLayoutCSS != '') {
             Context::addCSSFile($editLayoutCSS);
         }
         $layout_file = 'layout';
         $oModuleModel = getModel('module');
         $part_config = $oModuleModel->getModulePartConfig('layout', $layoutSrl);
         Context::addHtmlHeader($part_config->header_script);
     } else {
         $layout_path = './common/tpl';
         $layout_file = 'default_layout';
     }
     $layout_tpl = $oTemplate->compile($layout_path, $layout_file, $editLayoutTPL);
     Context::set('layout', 'none');
     // Convert widgets and others
     $oContext = Context::getInstance();
     Context::set('layout_tpl', $layout_tpl);
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile('layout_preview');
 }
Пример #25
0
 /**
  * @brief faceoff의 관리자 layout 수정
  **/
 function dispLayoutAdminLayoutModify()
 {
     //layout_srl 를 가져온다
     $current_module_info = Context::get('current_module_info');
     $layout_srl = $current_module_info->layout_srl;
     // 파일로 임시저장을 하기때문에 남아 있을지 모르는 tmp를 지운다
     // to do 개선이 필요
     $delete_tmp = Context::get('delete_tmp');
     if ($delete_tmp == 'Y') {
         $oLayoutAdminController =& getAdminController('layout');
         $oLayoutAdminController->deleteUserLayoutTempFile($layout_srl);
     }
     $oLayoutModel =& getModel('layout');
     // layout file들은 temp로 사용한다.
     $oLayoutModel->setUseUserLayoutTemp();
     // css 를 inline style로 뽑는다
     $faceoffcss = $oLayoutModel->_getUserLayoutFaceOffCss($current_module_info->layout_srl);
     $css = FileHandler::readFile($faceoffcss);
     $match = null;
     preg_match_all('/([^\\{]+)\\{([^\\}]*)\\}/is', $css, $match);
     for ($i = 0, $c = count($match[1]); $i < $c; $i++) {
         $name = trim($match[1][$i]);
         $css = trim($match[2][$i]);
         if (!$css) {
             continue;
         }
         $css = str_replace('./images/', Context::getRequestUri() . $oLayoutModel->getUserLayoutImagePath($layout_srl), $css);
         $style[] .= sprintf('"%s":"%s"', $name, $css);
     }
     if (count($style)) {
         $script = '<script type="text/javascript"> var faceOffStyle = {' . implode(',', $style) . '}; </script>';
         Context::addHtmlHeader($script);
     }
     $oTemplate =& TemplateHandler::getInstance();
     Context::set('content', $oTemplate->compile($this->module_path . 'tpl', 'about_faceoff'));
     // 위젯 코드를 Javascript 수정모드로 변경
     $oWidgetController =& getController('widget');
     $oWidgetController->setWidgetCodeInJavascriptMode();
     // 템플릿 파일 지정
     $this->setTemplateFile('faceoff_layout_edit');
 }
Пример #26
0
 /**
  * Get layout instance list
  * @param int $siteSrl
  * @param string $layoutType (P : PC, M : Mobile)
  * @param string $layout name of layout
  * @param array $columnList
  * @return array layout lists in site
  */
 function getLayoutInstanceList($siteSrl = 0, $layoutType = 'P', $layout = null, $columnList = array())
 {
     if (!$siteSrl) {
         $siteModuleInfo = Context::get('site_module_info');
         $siteSrl = (int) $siteModuleInfo->site_srl;
     }
     $args = new stdClass();
     $args->site_srl = $siteSrl;
     $args->layout_type = $layoutType;
     $args->layout = $layout;
     $output = executeQueryArray('layout.getLayoutList', $args, $columnList);
     // Create instance name list
     $instanceList = array();
     if (is_array($output->data)) {
         foreach ($output->data as $no => $iInfo) {
             if ($this->isExistsLayoutFile($iInfo->layout, $layoutType)) {
                 $instanceList[] = $iInfo->layout;
             } else {
                 unset($output->data[$no]);
             }
         }
     }
     // Create downloaded name list
     $downloadedList = array();
     $titleList = array();
     $_downloadedList = $this->getDownloadedLayoutList($layoutType);
     if (is_array($_downloadedList)) {
         foreach ($_downloadedList as $dLayoutInfo) {
             $downloadedList[$dLayoutInfo->layout] = $dLayoutInfo->layout;
             $titleList[$dLayoutInfo->layout] = $dLayoutInfo->title;
         }
     }
     if ($layout) {
         if (count($instanceList) < 1 && $downloadedList[$layout]) {
             $insertArgs = new stdClass();
             $insertArgs->site_srl = $siteSrl;
             $insertArgs->layout_srl = getNextSequence();
             $insertArgs->layout = $layout;
             $insertArgs->title = $titleList[$layout];
             $insertArgs->layout_type = $layoutType;
             $oLayoutAdminController = getAdminController('layout');
             $oLayoutAdminController->insertLayout($insertArgs);
             $isCreateInstance = TRUE;
         }
     } else {
         // Get downloaded name list have no instance
         $noInstanceList = array_diff($downloadedList, $instanceList);
         foreach ($noInstanceList as $layoutName) {
             $insertArgs = new stdClass();
             $insertArgs->site_srl = $siteSrl;
             $insertArgs->layout_srl = getNextSequence();
             $insertArgs->layout = $layoutName;
             $insertArgs->title = $titleList[$layoutName];
             $insertArgs->layout_type = $layoutType;
             $oLayoutAdminController = getAdminController('layout');
             $oLayoutAdminController->insertLayout($insertArgs);
             $isCreateInstance = TRUE;
         }
     }
     // If create layout instance, reload instance list
     if ($isCreateInstance) {
         $output = executeQueryArray('layout.getLayoutList', $args, $columnList);
         if (is_array($output->data)) {
             foreach ($output->data as $no => $iInfo) {
                 if (!$this->isExistsLayoutFile($iInfo->layout, $layoutType)) {
                     unset($output->data[$no]);
                 }
             }
         }
     }
     return $output->data;
 }
 /**
  * @brief delete item
  **/
 function procNproductAdminDeleteItem()
 {
     $oDocumentController =& getController('document');
     $oFileController =& getController('file');
     $oNproductModel =& getModel('nproduct');
     $oStore_reviewAdminController =& getAdminController('store_review');
     // get item info.
     $item_srl = Context::get('item_srl');
     $item_info = $oNproductModel->getItemInfo($item_srl);
     if (!$item_info) {
         return new Object(-1, 'msg_invalid_request');
     }
     // Call a trigger (before)
     $output = ModuleHandler::triggerCall('nproduct.deleteItem', 'before', $item_info);
     if (!$output->toBool()) {
         return $output;
     }
     // delete thumbnail file
     $oFileController->deleteFile($item_info->file_srl);
     // delete review
     $output = $oStore_reviewAdminController->deleteReviewList($item_srl);
     if (!$output->toBool()) {
         return $output;
     }
     // delete document
     $oDocumentController->deleteDocument($item_info->document_srl);
     // delete db record
     $args->item_srl = $item_srl;
     $output = executeQuery('nproduct.deleteItem', $args);
     if (!$output->toBool()) {
         return $output;
     }
     $output = executeQuery('nproduct.deleteNproductExtraVars', $args);
     if (!$output->toBool()) {
         return $output;
     }
     // Call a trigger (after)
     $output = ModuleHandler::triggerCall('nproduct.deleteItem', 'after', $item_info);
     if (!$output->toBool()) {
         return $output;
     }
     $this->setMessage('success_deleted');
     if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
         $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', Context::get('module'), 'act', 'dispNproductAdminItemList', 'module_srl', Context::get('module_srl'));
         $this->setRedirectUrl($returnUrl);
         return;
     }
 }
Пример #28
0
 /**
  * @brief 설치시 추가 작업이 필요할시 구현
  **/
 function moduleInstall()
 {
     // action forward에 등록 (관리자 모드에서 사용하기 위함)
     $oModuleController =& getController('module');
     $oDB =& DB::getInstance();
     $oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true);
     $oModuleModel =& getModel('module');
     $args = $oModuleModel->getModuleConfig('member');
     // 기본 정보를 세팅
     $args->enable_join = 'Y';
     if (!$args->enable_openid) {
         $args->enable_openid = 'N';
     }
     if (!$args->enable_auth_mail) {
         $args->enable_auth_mail = 'N';
     }
     if (!$args->image_name) {
         $args->image_name = 'Y';
     }
     if (!$args->image_mark) {
         $args->image_mark = 'Y';
     }
     if (!$args->profile_image) {
         $args->profile_image = 'Y';
     }
     if (!$args->image_name_max_width) {
         $args->image_name_max_width = '90';
     }
     if (!$args->image_name_max_height) {
         $args->image_name_max_height = '20';
     }
     if (!$args->image_mark_max_width) {
         $args->image_mark_max_width = '20';
     }
     if (!$args->image_mark_max_height) {
         $args->image_mark_max_height = '20';
     }
     if (!$args->profile_image_max_width) {
         $args->profile_image_max_width = '80';
     }
     if (!$args->profile_image_max_height) {
         $args->profile_image_max_height = '80';
     }
     if ($args->group_image_mark != 'Y') {
         $args->group_image_mark = 'N';
     }
     $oModuleController->insertModuleConfig('member', $args);
     // 멤버 컨트롤러 객체 생성
     $oMemberModel =& getModel('member');
     $oMemberController =& getController('member');
     $oMemberAdminController =& getAdminController('member');
     $groups = $oMemberModel->getGroups();
     if (!count($groups)) {
         // 관리자, 정회원, 준회원 그룹을 입력
         $group_args->title = Context::getLang('admin_group');
         $group_args->is_default = 'N';
         $group_args->is_admin = 'Y';
         $output = $oMemberAdminController->insertGroup($group_args);
         unset($group_args);
         $group_args->title = Context::getLang('default_group_1');
         $group_args->is_default = 'Y';
         $group_args->is_admin = 'N';
         $output = $oMemberAdminController->insertGroup($group_args);
         unset($group_args);
         $group_args->title = Context::getLang('default_group_2');
         $group_args->is_default = 'N';
         $group_args->is_admin = 'N';
         $oMemberAdminController->insertGroup($group_args);
     }
     // 관리자 정보 세팅
     $admin_args->is_admin = 'Y';
     $output = executeQuery('member.getMemberList', $admin_args);
     if (!$output->data) {
         $admin_info = Context::gets('user_id', 'password', 'nick_name', 'user_name', 'email_address');
         if ($admin_info->user_id) {
             // 관리자 정보 입력
             $oMemberAdminController->insertAdmin($admin_info);
             // 로그인 처리시킴
             $output = $oMemberController->doLogin($admin_info->user_id);
         }
     }
     // 금지 아이디 등록 (기본 + 모듈명)
     $oModuleModel =& getModel('module');
     $module_list = $oModuleModel->getModuleList();
     foreach ($module_list as $key => $val) {
         $oMemberAdminController->insertDeniedID($val->module, '');
     }
     $oMemberAdminController->insertDeniedID('www', '');
     $oMemberAdminController->insertDeniedID('root', '');
     $oMemberAdminController->insertDeniedID('administrator', '');
     $oMemberAdminController->insertDeniedID('telnet', '');
     $oMemberAdminController->insertDeniedID('ftp', '');
     $oMemberAdminController->insertDeniedID('http', '');
     // member 에서 사용할 cache디렉토리 생성
     FileHandler::makeDir('./files/member_extra_info/image_name');
     FileHandler::makeDir('./files/member_extra_info/image_mark');
     FileHandler::makeDir('./files/member_extra_info/profile_image');
     FileHandler::makeDir('./files/member_extra_info/signature');
     return new Object();
 }
Пример #29
0
 /**
  * @brief Re-create the cache file
  **/
 function recompileCache()
 {
     // redefine point action file
     $oPointAdminController =& getAdminController('point');
     $oPointAdminController->cacheActList();
 }
Пример #30
0
 /**
  * Regenerate all cache files
  * @return void
  */
 function procAdminRecompileCacheFile()
 {
     // rename cache dir
     $temp_cache_dir = './files/cache_' . $_SERVER['REQUEST_TIME'];
     FileHandler::rename('./files/cache', $temp_cache_dir);
     FileHandler::makeDir('./files/cache');
     // remove debug files
     FileHandler::removeFile(_XE_PATH_ . 'files/_debug_message.php');
     FileHandler::removeFile(_XE_PATH_ . 'files/_debug_db_query.php');
     FileHandler::removeFile(_XE_PATH_ . 'files/_db_slow_query.php');
     $oModuleModel = getModel('module');
     $module_list = $oModuleModel->getModuleList();
     // call recompileCache for each module
     foreach ($module_list as $module) {
         $oModule = NULL;
         $oModule = getClass($module->module);
         if (method_exists($oModule, 'recompileCache')) {
             $oModule->recompileCache();
         }
     }
     // remove cache
     $truncated = array();
     $oObjectCacheHandler = CacheHandler::getInstance('object');
     $oTemplateCacheHandler = CacheHandler::getInstance('template');
     if ($oObjectCacheHandler->isSupport()) {
         $truncated[] = $oObjectCacheHandler->truncate();
     }
     if ($oTemplateCacheHandler->isSupport()) {
         $truncated[] = $oTemplateCacheHandler->truncate();
     }
     if (count($truncated) && in_array(FALSE, $truncated)) {
         return new Object(-1, 'msg_self_restart_cache_engine');
     }
     // remove cache dir
     $tmp_cache_list = FileHandler::readDir('./files', '/(^cache_[0-9]+)/');
     if ($tmp_cache_list) {
         foreach ($tmp_cache_list as $tmp_dir) {
             if ($tmp_dir) {
                 FileHandler::removeDir('./files/' . $tmp_dir);
             }
         }
     }
     // remove duplicate indexes (only for CUBRID)
     $db_type = Context::getDBType();
     if ($db_type == 'cubrid') {
         $db = DB::getInstance();
         $db->deleteDuplicateIndexes();
     }
     // check autoinstall packages
     $oAutoinstallAdminController = getAdminController('autoinstall');
     $oAutoinstallAdminController->checkInstalled();
     $this->setMessage('success_updated');
 }