예제 #1
0
 /**
  * Trash list
  * @return void
  */
 function dispTrashAdminList()
 {
     $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
     $oTrashModel = getModel('trash');
     $output = $oTrashModel->getTrashList($args);
     // for no text comment language and for document manange language
     $oCommentModel =& getModel('comment');
     $oDocumentModel =& getModel('document');
     Context::set('trash_list', $output->data);
     Context::set('total_count', $output->total_count);
     Context::set('total_page', $output->total_page);
     Context::set('page', $output->page);
     Context::set('page_navigation', $output->page_navigation);
     // 템플릿 파일 지정
     $this->setTemplateFile('trash_list');
 }
예제 #2
0
	/**
	 * Skin Settings
	 *
	 * @return Object
	 */
	function dispStore_searchAdminSkinInfo()
	{
		$oModuleModel = getModel('module');
		$module_srl = Context::get('module_srl');
		// module_srl이 넘어오면 해당 모듈의 정보를 미리 구해 놓음
		if($module_srl) 
		{
			$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
			if(!$module_info) 
			{
				Context::set('module_srl','');
				$this->act = 'list';
			}
			else
			{
				$oModuleModel->syncModuleToSite($module_info);
				$this->module_info = $module_info;
				Context::set('module_info',$module_info);
			}
		}

		// 공통 모듈 권한 설정 페이지 호출
		$oModuleAdminModel = getAdminModel('module');
		$skin_content = $oModuleAdminModel->getModuleSkinHTML($this->module_info->module_srl);
		Context::set('skin_content', $skin_content);
		$this->setTemplateFile('skininfo');
	}
예제 #3
0
 /**
  * Display a form to upload the xml file
  * @return void
  */
 function dispImporterAdminImportForm()
 {
     $oDocumentModel = getModel('document');
     //for document lang use in this page
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile('index');
 }
 /**
  * the html to select colorset of the skin
  * @return void
  */
 function getCommunicationAdminColorset()
 {
     $skin = Context::get('skin');
     $type = Context::get('type') == 'P' ? 'P' : 'M';
     Context::set('type', $type);
     if ($type == 'P') {
         $dir = 'skins';
     } else {
         $dir = 'm.skins';
     }
     if (!$skin) {
         $tpl = "";
     } else {
         $oModuleModel = getModel('module');
         $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir);
         Context::set('skin_info', $skin_info);
         $oModuleModel = getModel('module');
         $communication_config = $oModuleModel->getModuleConfig('communication');
         if (!$communication_config->colorset) {
             $communication_config->colorset = "white";
         }
         Context::set('communication_config', $communication_config);
         $security = new Security();
         $security->encodeHTML('skin_info.colorset..title', 'skin_info.colorset..name');
         $security->encodeHTML('skin_info.colorset..name');
         $oTemplate = TemplateHandler::getInstance();
         $tpl = $oTemplate->compile($this->module_path . 'tpl', 'colorset_list');
     }
     $this->add('tpl', $tpl);
     $this->add('type', $type);
 }
예제 #5
0
 function moduleUpdate()
 {
     $oModuleModel = getModel('module');
     $oModuleController = getController('module');
     $oDB =& DB::getInstance();
     foreach ($this->triggers as $trigger) {
         if (!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) {
             $oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
         }
     }
     if (!$oDB->isColumnExists('androidpushapp_gcmregid', 'member_srl')) {
         $oDB->addColumn('androidpushapp_gcmregid', 'member_srl', 'number', 11);
     }
     if (!$oDB->isColumnExists('androidpushapp_gcmregid', 'setting')) {
         $oDB->addColumn('androidpushapp_gcmregid', 'setting', 'text');
     }
     if (!$oDB->isColumnExists('androidpushapp_gcmregid', 'setting_board')) {
         $oDB->addColumn('androidpushapp_gcmregid', 'setting_board', 'text');
     }
     if (!$oDB->isColumnExists('androidpushapp_gcmregid', 'last_login')) {
         $oDB->addColumn('androidpushapp_gcmregid', 'last_login', 'date');
     }
     if (!$oDB->isColumnExists('androidpushapp_gcmregid', 'sort')) {
         $oDB->addColumn('androidpushapp_gcmregid', 'sort', 'char', 1, 'W', 'true');
     }
     return new Object(0, 'success_updated');
 }
예제 #6
0
 /**
  * Report an improper comment
  * @return void
  */
 function dispCommentDeclare()
 {
     $this->setLayoutFile('popup_layout');
     $comment_srl = Context::get('target_srl');
     $oMemberModel = getModel('member');
     // A message appears if the user is not logged-in
     if (!$oMemberModel->isLogged()) {
         return $this->stop('msg_not_logged');
     }
     // Create the comment object.
     $oCommentModel = getModel('comment');
     // Creates an object for displaying the selected comment
     $oComment = $oCommentModel->getComment($comment_srl);
     if (!$oComment->isExists()) {
         return new Object(-1, 'msg_invalid_request');
     }
     // Check permissions
     if (!$oComment->isAccessible()) {
         return new Object(-1, 'msg_not_permitted');
     }
     // Browser title settings
     Context::set('target_comment', $oComment);
     Context::set('target_srl', $comment_srl);
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile('declare_comment');
 }
예제 #7
0
 function getNickChangeList($obj)
 {
     $args->s_member_srl = $obj->member_srl;
     $args->page = Context::get('page');
     // /< Page
     $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->sort_index = 'regdate';
     // /< sorting values
     $args->order_type = 'desc';
     // /< sorting values by order
     if ($obj->search_target == 'nick_name') {
         $args->nick_name_old = $obj->search_keyword;
         $args->nick_name_new = $obj->search_keyword;
     }
     if ($obj->search_target == 'member_srl') {
         $args->s_member_srl = $obj->search_keyword;
     }
     if ($obj->search_target == 'user_id') {
         $oMemberModel =& getModel('member');
         $member_info = $oMemberModel->getMemberInfoByUserID($obj->search_keyword);
         $args->s_member_srl = $member_info->member_srl;
     }
     $output = executeQueryArray('sejin7940_nick.getNickChangeList', $args);
     return $output;
 }
예제 #8
0
 /**
  * Get the board module admin simple setting page
  * @return void
  */
 public function getBoardAdminSimpleSetup($moduleSrl, $setupUrl)
 {
     if (!$moduleSrl) {
         return;
     }
     Context::set('module_srl', $moduleSrl);
     // default module info setting
     $oModuleModel = getModel('module');
     $moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl);
     $moduleInfo->use_status = explode('|@|', $moduleInfo->use_status);
     if ($moduleInfo) {
         Context::set('module_info', $moduleInfo);
     }
     // get document status list
     $oDocumentModel = getModel('document');
     $documentStatusList = $oDocumentModel->getStatusNameList();
     Context::set('document_status_list', $documentStatusList);
     // set order target list
     foreach ($this->order_target as $key) {
         $order_target[$key] = Context::getLang($key);
     }
     $order_target['list_order'] = Context::getLang('document_srl');
     $order_target['update_order'] = Context::getLang('last_update');
     Context::set('order_target', $order_target);
     // for advanced language & url
     $oAdmin = getClass('admin');
     Context::set('setupUrl', $setupUrl);
     // Extract admin ID set in the current module
     $admin_member = $oModuleModel->getAdminId($moduleSrl);
     Context::set('admin_member', $admin_member);
     $oTemplate =& TemplateHandler::getInstance();
     $html = $oTemplate->compile($this->module_path . 'tpl/', 'board_setup_basic');
     return $html;
 }
예제 #9
0
 /**
  * @brief Widget execution
  * Get extra_vars declared in ./widgets/widget/conf/info.xml as arguments
  * After generating the result, do not print but return it.
  */
 function proc($args)
 {
     // Set a path of the template skin (values of skin, colorset settings)
     $tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
     Context::set('colorset', $args->colorset);
     // Specify a template file
     if (Context::get('is_logged')) {
         $tpl_file = 'login_info';
     } else {
         $tpl_file = 'login_form';
     }
     // Get the member configuration
     $oModuleModel = getModel('module');
     $this->member_config = $oModuleModel->getModuleConfig('member');
     Context::set('member_config', $this->member_config);
     // Set a flag to check if the https connection is made when using SSL and create https url
     $ssl_mode = false;
     $useSsl = Context::getSslStatus();
     if ($useSsl != 'none') {
         if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) {
             $ssl_mode = true;
         }
     }
     Context::set('ssl_mode', $ssl_mode);
     // Compile a template
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($tpl_path, $tpl_file);
 }
예제 #10
0
 /**
  * @brief Message output
  **/
 function dispMessage()
 {
     // Get configurations (using module model object)
     $oModuleModel = getModel('module');
     $config = $oModuleModel->getModuleConfig('message');
     if (!$config->mskin) {
         $config->mskin = 'default';
     }
     // Set the template path
     $template_path = sprintf('%sm.skins/%s', $this->module_path, $config->mskin);
     // Get the member configuration
     $oModuleModel = getModel('module');
     $member_config = $oModuleModel->getModuleConfig('member');
     Context::set('member_config', $member_config);
     // Set a flag to check if the https connection is made when using SSL and create https url
     $ssl_mode = false;
     if ($member_config->enable_ssl == 'Y') {
         if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) {
             $ssl_mode = true;
         }
     }
     Context::set('ssl_mode', $ssl_mode);
     Context::set('system_message', nl2br($this->getMessage()));
     Context::set('act', 'procMemberLogin');
     Context::set('mid', '');
     $this->setTemplatePath($template_path);
     $this->setTemplateFile('system_message');
 }
예제 #11
0
 /**
  * @brief Execute update
  */
 function moduleUpdate()
 {
     $oModuleModel = getModel('module');
     $oModuleController = getController('module');
     // 2007.10.17 When deleting posts/comments delete the poll as well
     if (!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) {
         $oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) {
         $oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after');
     }
     // 2008.04.22 A poll connection to add posts/comments
     if (!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) {
         $oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) {
         $oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) {
         $oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after');
     }
     if (!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) {
         $oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after');
     }
     return new Object(0, 'success_updated');
 }
예제 #12
0
 /**
  * @brief 스팸필터의 설정 화면
  **/
 function dispLdapAdminConfig()
 {
     $oModel =& getModel('ldap');
     Context::set('config', $oModel->getConfig());
     // 템플릿 파일 지정
     $this->setTemplateFile('index');
 }
예제 #13
0
 /**
  * @brief 카운터 기록
  **/
 function procCounterExecute()
 {
     $oDB =& DB::getInstance();
     $oDB->begin();
     $site_module_info = Context::get('site_module_info');
     $site_srl = (int) $site_module_info->site_srl;
     // 로그를 검사
     $oCounterModel =& getModel('counter');
     // 오늘자 row가 있는지 체크하여 없으면 등록
     if (!$oCounterModel->isInsertedTodayStatus($site_srl)) {
         $this->insertTodayStatus(0, $site_srl);
         // 기존 row가 있으면 사용자 체크
     } else {
         // 등록되어 있지 않은 아이피일 경우
         if (!$oCounterModel->isLogged($site_srl)) {
             // 로그 등록
             $this->insertLog($site_srl);
             // unique 및 pageview 등록
             $this->insertUniqueVisitor($site_srl);
         } else {
             // pageview 등록
             $this->insertPageView($site_srl);
         }
     }
     $oDB->commit();
 }
예제 #14
0
파일: tag.class.php 프로젝트: relip/xe-core
 /**
  * @brief Execute update
  **/
 function moduleUpdate()
 {
     $oModuleModel =& getModel('module');
     $oModuleController =& getController('module');
     $oDB =& DB::getInstance();
     // 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument trigger property for
     if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) {
         $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
     }
     if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) {
         $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
     }
     if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) {
         $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
     }
     if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) {
         $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
     }
     if (!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) {
         $oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after');
     }
     // 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag
     if (!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) {
         $oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after');
     }
     // tag in the index column of the table tag
     if (!$oDB->isIndexExists("tags", "idx_tag")) {
         $oDB->addIndex("tags", "idx_tag", array("document_srl", "tag"));
     }
     return new Object(0, 'success_updated');
 }
예제 #15
0
 /**
  * @brief 서비스형 모듈의 추가 설정을 위한 부분
  * file의 사용 형태에 대한 설정만 받음
  **/
 function triggerDispFileAdditionSetup(&$obj)
 {
     $current_module_srl = Context::get('module_srl');
     $current_module_srls = Context::get('module_srls');
     if (!$current_module_srl && !$current_module_srls) {
         // 선택된 모듈의 정보를 가져옴
         $current_module_info = Context::get('current_module_info');
         $current_module_srl = $current_module_info->module_srl;
         if (!$current_module_srl) {
             return new Object();
         }
     }
     // 선택된 모듈의 file설정을 가져옴
     $oFileModel =& getModel('file');
     $file_config = $oFileModel->getFileModuleConfig($current_module_srl);
     Context::set('file_config', $file_config);
     // 그룹의 설정을 위한 권한 가져오기
     $oMemberModel =& getModel('member');
     $site_module_info = Context::get('site_module_info');
     $group_list = $oMemberModel->getGroups($site_module_info->site_srl);
     Context::set('group_list', $group_list);
     // 템플릿 파일 지정
     $oTemplate =& TemplateHandler::getInstance();
     $tpl = $oTemplate->compile($this->module_path . 'tpl', 'file_module_config');
     $obj .= $tpl;
     return new Object();
 }
예제 #16
0
 /**
  * @brief 메세지 출력 
  **/
 function dispMessage()
 {
     // 설정 정보를 받아옴 (module model 객체를 이용)
     $oModuleModel =& getModel('module');
     $config = $oModuleModel->getModuleConfig('message');
     if (!$config->skin) {
         $config->skin = 'default';
     }
     // 템플릿 경로를 지정
     $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
     // 회원 관리 정보를 받음
     $oModuleModel =& getModel('module');
     $member_config = $oModuleModel->getModuleConfig('member');
     Context::set('member_config', $member_config);
     // ssl 사용시 현재 https접속상태인지에 대한 flag및 https url 생성
     $ssl_mode = false;
     if ($member_config->enable_ssl == 'Y') {
         if (preg_match('/^https:\\/\\//i', Context::getRequestUri())) {
             $ssl_mode = true;
         }
     }
     Context::set('ssl_mode', $ssl_mode);
     Context::set('system_message', nl2br($this->getMessage()));
     $this->setTemplatePath($template_path);
     $this->setTemplateFile('system_message');
 }
예제 #17
0
 /**
  * @brief 모듈 환경설정값 쓰기
  **/
 function procCympusadminAdminInsertModInst()
 {
     // module 모듈의 model/controller 객체 생성
     $oModuleController = getController('module');
     $oModuleModel = getModel('module');
     // 게시판 모듈의 정보 설정
     $args = Context::getRequestVars();
     $args->module = 'cympusadmin';
     // module_srl이 넘어오면 원 모듈이 있는지 확인
     if ($args->module_srl) {
         $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
         if ($module_info->module_srl != $args->module_srl) {
             unset($args->module_srl);
         }
     }
     // module_srl의 값에 따라 insert/update
     if (!$args->module_srl) {
         $output = $oModuleController->insertModule($args);
         $msg_code = 'success_registed';
     } else {
         $output = $oModuleController->updateModule($args);
         $msg_code = 'success_updated';
     }
     if (!$output->toBool()) {
         return $output;
     }
     $this->add('module_srl', $output->get('module_srl'));
     $this->setMessage($msg_code);
     $returnUrl = getNotEncodedUrl('', 'module', Context::get('module'), 'act', 'dispCympusadminAdminInsertModInst', 'module_srl', $output->get('module_srl'));
     $this->setRedirectUrl($returnUrl);
 }
예제 #18
0
 /**
  * Execute update
  *
  * @return Object
  */
 function moduleUpdate()
 {
     $oModuleModel = getModel('module');
     $oModuleController = getController('module');
     // Add atom act
     if (!$oModuleModel->getActionForward('atom')) {
         $oModuleController->insertActionForward('rss', 'view', 'atom');
     }
     // 2007. 10. An additional set of 18 to participate in a service module, add a trigger
     if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) {
         $oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
     }
     // 2007. 10. 19 outputs the trigger before you call to set up rss url
     if (!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) {
         $oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
     }
     if ($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) {
         $oModuleController->deleteTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before');
     }
     // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
     if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after')) {
         $oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after');
     }
     return new Object(0, 'success_updated');
 }
예제 #19
0
 function getContributors($document_srl)
 {
     $oDocumentModel =& getModel('document');
     $oDocument = $oDocumentModel->getDocument($document_srl);
     if (!$oDocument->isExists()) {
         return array();
     }
     $args->document_srl = $document_srl;
     $output = executeQueryArray("wiki.getContributors", $args);
     if ($output->data) {
         $list = $output->data;
     } else {
         $list = array();
     }
     $item->member_srl = $oDocument->getMemberSrl();
     $item->nick_name = $oDocument->getNickName();
     $contributors[] = $item;
     for ($i = 0, $c = count($list); $i < $c; $i++) {
         unset($item);
         $item->member_srl = $list[$i]->member_srl;
         $item->nick_name = $list[$i]->nick_name;
         if ($item->member_srl == $oDocument->getMemberSrl()) {
             continue;
         }
         $contributors[] = $item;
     }
     return $contributors;
 }
예제 #20
0
 /**
  * @brief Display messages
  **/
 function dispMessage()
 {
     // Get configurations (using module model object)
     $oModuleModel =& getModel('module');
     $this->module_config = $config = $oModuleModel->getModuleConfig('message', $this->module_info->site_srl);
     if (!$config->skin) {
         $config->skin = 'default';
         $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
     } else {
         //check theme
         $config_parse = explode('|@|', $config->skin);
         if (count($config_parse) > 1) {
             $template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
         } else {
             $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
         }
     }
     // Template path
     $this->setTemplatePath($template_path);
     // Get the member configuration
     $member_config = $oModuleModel->getModuleConfig('member');
     Context::set('member_config', $member_config);
     // Set a flag to check if the https connection is made when using SSL and create https url
     $ssl_mode = false;
     if ($member_config->enable_ssl == 'Y') {
         if (preg_match('/^https:\\/\\//i', Context::getRequestUri())) {
             $ssl_mode = true;
         }
     }
     Context::set('ssl_mode', $ssl_mode);
     Context::set('system_message', nl2br($this->getMessage()));
     $this->setTemplateFile('system_message');
 }
예제 #21
0
 /**
  * @brief 주소 검색에 쓰이는 함수
  * @return JSON형태의 검색된 주소 리스트
  **/
 function dispQueryAddress()
 {
     $oModuleModel =& getModel('module');
     $module_config = $oModuleModel->getModuleConfig('aroundmap');
     $naver_api_key = $module_config->naver_api_key;
     $yahoo_api_key = $module_config->yahoo_api_key;
     $address = Context::Get("address");
     $address = urlencode($address);
     // build JSON result as following
     // $result = '{ "api_type":"yahoo" , "items":[ {"address":"address sample", "lat":36.5459,"lon":128.71},{"address":"address sample2", "lat":36.5459,"lon":128.75}  ]  } ';
     $type = "";
     // YAHOO API
     if ($yahoo_api_key != NULL && $yahoo_api_key != "") {
         $url = 'http://kr.open.gugi.yahoo.com/service/poi.php?appid=' . $yahoo_api_key . '&encoding=utf-8&q=' . $address . '&results=100';
         $type = "yahoo";
     } else {
         if ($naver_api_key != NULL && $naver_api_key != "") {
             // NAVER API if you cannot use yahoo api.
             $url = 'http://map.naver.com/api/geocode.php?key=' . $naver_api_key . '&encoding=utf-8&coord=latlng&query=' . $address;
             $type = "naver";
         }
     }
     if ($type != "") {
         $result = $this->getAddressByJSON($url, $type);
     }
     header("Content-type: application/json; charset=UTF-8");
     header("Pragma: no-cache");
     echo $result;
     exit;
 }
예제 #22
0
 /**
  * @breif module update
  */
 function moduleUpdate()
 {
     $oModuleController =& getController('module');
     $oModuleModel =& getModel('module');
     $oDB =& DB::getInstance();
     if (!$oDB->isColumnExists('epay_transactions', 'target_module')) {
         $oDB->addColumn('epay_transactions', 'target_module', 'varchar', '80');
     }
     // 2012-04-06 regdate index added.
     if (!$oDB->isIndexExists('epay_transactions', 'idx_regdate')) {
         $oDB->addIndex('epay_transactions', 'idx_regdate', 'regdate');
     }
     // 2012-04-24 order_title column added.
     if (!$oDB->isColumnExists('epay_transactions', 'order_title')) {
         $oDB->addColumn('epay_transactions', 'order_title', 'varchar', '250');
     }
     // 2013-07-28 p_member_srl index added.
     if (!$oDB->isIndexExists('epay_transactions', 'idx_member_srl')) {
         $oDB->addIndex('epay_transactions', 'idx_member_srl', 'p_member_srl');
     }
     // added on 2015/06/13
     if (!$oModuleModel->getTrigger('cympusadmin.getManagerMenu', 'epay', 'model', 'triggerGetManagerMenu', 'before')) {
         $oModuleController->insertTrigger('cympusadmin.getManagerMenu', 'epay', 'model', 'triggerGetManagerMenu', 'before');
     }
     return new Object(0, 'success_updated');
 }
예제 #23
0
 /**
  * Counter logs
  *
  * @return void
  **/
 function counterExecute()
 {
     $oDB =& DB::getInstance();
     $oDB->begin();
     $site_module_info = Context::get('site_module_info');
     $site_srl = (int) $site_module_info->site_srl;
     // Check the logs
     $oCounterModel =& getModel('counter');
     // Register today's row if not exist
     if (!$oCounterModel->isInsertedTodayStatus($site_srl)) {
         $this->insertTodayStatus(0, $site_srl);
         // check user if the previous row exists
     } else {
         // If unregistered IP
         if (!$oCounterModel->isLogged($site_srl)) {
             // Leave logs
             $this->insertLog($site_srl);
             // Register unique and pageview
             $this->insertUniqueVisitor($site_srl);
         } else {
             //  Register pageview
             $this->insertPageView($site_srl);
         }
     }
     $oDB->commit();
 }
 function setPeriod($cart_srl = null, $set_date = null)
 {
     if (!$cart_srl) {
         return new Object(-1, 'no cart_srl');
     }
     $args->cart_srl = $cart_srl;
     $output = executeQuery('nstore_digital_contents.getPeriod', $args);
     if (!$output->toBool()) {
         return $output;
     }
     $is_set_period = null;
     if ($output->data) {
         $is_set_period = $output->data;
     }
     $oNcartModel =& getModel('ncart');
     $cart_item = $oNcartModel->getCartItem($cart_srl);
     if ($cart_item) {
         $args->item_srl = $cart_item->item_srl;
         $output = executeQuery('nstore_digital_contents.getConfig', $args);
         if (!$output->toBool()) {
             return $output;
         }
         if (!$output->data) {
             return;
         }
         $period = $output->data->period;
         $period_type = $output->data->period_type;
         $d = 0;
         $m = 0;
         $y = 0;
         switch ($period_type) {
             case 'd':
                 $d = $period;
                 break;
             case 'm':
                 $m = $period;
                 break;
             case 'y':
                 $y = $period;
                 break;
         }
         $end_date = date("Ymd", mktime(0, 0, 0, date("m") + $m, date("d") + $d, date("Y") + $y));
         if ($set_date) {
             $end_date = $set_date;
         }
     }
     if (!$is_set_period) {
         $args->period = $end_date;
         $output = executeQuery('nstore_digital_contents.insertPeriod', $args);
         if (!$output->toBool()) {
             return $output;
         }
     } else {
         $args->period = $end_date;
         $output = executeQuery('nstore_digital_contents.updatePeriod', $args);
         if (!$output->toBool()) {
             return $output;
         }
     }
 }
 /**
  * @brief insert Module
  **/
 function procInipaystandardAdminInsertModule()
 {
     $oModuleController = getController('module');
     $oModuleModel = getModel('module');
     $args = Context::getRequestVars();
     $args->module = 'inipaystandard';
     if ($args->module_srl) {
         $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
         if ($module_info->module_srl != $args->module_srl) {
             unset($args->module_srl);
         }
     }
     if (!$args->module_srl) {
         $output = $oModuleController->insertModule($args);
         if (!$output->toBool()) {
             return $output;
         }
         $msg_code = 'success_registed';
     } else {
         $output = $oModuleController->updateModule($args);
         if (!$output->toBool()) {
             return $output;
         }
         $msg_code = 'success_updated';
     }
     $returnUrl = getNotEncodedUrl('', 'module', 'admin', 'act', 'dispInipaystandardAdminInsertModule', 'module_srl', $output->get('module_srl'));
     $this->setRedirectUrl($returnUrl);
     $this->setMessage($msg_code);
 }
예제 #26
0
 /**
  * @brief 관리자 페이지 초기화면
  **/
 function dispCounterAdminIndex()
 {
     // 정해진 일자가 없으면 오늘자로 설정
     $selected_date = Context::get('selected_date');
     if (!$selected_date) {
         $selected_date = date("Ymd");
     }
     Context::set('selected_date', $selected_date);
     // counter model 객체 생성
     $oCounterModel =& getModel('counter');
     // 전체 카운터 및 지정된 일자의 현황 가져오기
     $site_module_info = Context::get('site_module_info');
     $status = $oCounterModel->getStatus(array(0, $selected_date), $site_module_info->site_srl);
     Context::set('total_counter', $status[0]);
     Context::set('selected_day_counter', $status[$selected_date]);
     // 시간, 일, 월, 년도별로 데이터 가져오기
     $type = Context::get('type');
     if (!$type) {
         $type = 'day';
         Context::set('type', $type);
     }
     $detail_status = $oCounterModel->getHourlyStatus($type, $selected_date, $site_module_info->site_srl);
     Context::set('detail_status', $detail_status);
     // 표시
     $this->setTemplateFile('index');
 }
 /**
  * @brief Execute update
  **/
 function moduleUpdate()
 {
     $oDB =& DB::getInstance();
     $oModuleModel =& getModel('module');
     $oModuleController =& getController('module');
     return new Object(0, 'success_updated');
 }
예제 #28
0
 function dispLicenseAdminConfig()
 {
     $oLicenseModel =& getModel('license');
     $oModuleModel =& getModel('module');
     $config = $oLicenseModel->getModuleConfig();
     Context::set('config', $config);
     $products = array();
     // 'nstore', 'nstore_digital', 'elearning');
     if (getClass('nstore')) {
         $products[] = 'nstore';
     }
     if (getClass('nstore_digital')) {
         $products[] = 'nstore_digital';
     }
     if (getClass('elearning')) {
         $products[] = 'elearning';
     }
     Context::set('products', $products);
     foreach ($products as $key => $prodid) {
         $has_license = TRUE;
         $expiration = NULL;
         if ($oLicenseModel->getLicenseFromAgency($prodid, $has_license, $expiration)) {
             $oLicenseModel->getLicenseFromAgency($prodid, $has_license, $expiration);
         }
         Context::set(sprintf('%s_expiration', $prodid), $expiration);
     }
     $this->setTemplateFile('index');
 }
예제 #29
0
 /**
  * @brief Wanted photos of the type and information
  * Download a widget with type (generation and other means)
  */
 function getDownloadedWidgetList()
 {
     $oAutoinstallModel = getModel('autoinstall');
     // 've Downloaded the widget and the widget's list of installed Wanted
     $searched_list = FileHandler::readDir('./widgets');
     $searched_count = count($searched_list);
     if (!$searched_count) {
         return;
     }
     sort($searched_list);
     // D which pertain to the list of widgets loop spins return statement review the information you need
     for ($i = 0; $i < $searched_count; $i++) {
         // The name of the widget
         $widget = $searched_list[$i];
         // Wanted information on the Widget
         $widget_info = $this->getWidgetInfo($widget);
         if (!$widget_info) {
             $widget_info = new stdClass();
         }
         // get easyinstall remove url
         $packageSrl = $oAutoinstallModel->getPackageSrlByPath($widget_info->path);
         $widget_info->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl);
         // get easyinstall need update
         $package = $oAutoinstallModel->getInstalledPackages($packageSrl);
         $widget_info->need_update = $package[$packageSrl]->need_update;
         // get easyinstall update url
         if ($widget_info->need_update == 'Y') {
             $widget_info->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
         }
         $list[] = $widget_info;
     }
     return $list;
 }
예제 #30
0
 function getFormData($args)
 {
     // check transaction count
     if ($this->plugin_info->minimum_transactions) {
         $logged_info = Context::get('logged_info');
         if ($logged_info) {
             $oEpayModel =& getModel('epay');
             $transaction_count = $oEpayModel->getTransactionCountByMemberSrl($logged_info->member_srl);
             if ($transaction_count < $this->plugin_info->minimum_transactions) {
                 return new Object(0, 'Minimum transactions required');
             }
         }
     }
     if (!$args->price) {
         return new Object(0, 'No input of price');
     }
     $oTemplate =& TemplateHandler::getInstance();
     $tpl_path = _XE_PATH_ . "modules/epay/plugins/paypal/tpl";
     $tpl_file = 'formdata.html';
     Context::set('module_srl', $args->module_srl);
     Context::set('epay_module_srl', $args->epay_module_srl);
     Context::set('plugin_srl', $this->plugin_info->plugin_srl);
     Context::set('script_call_before_submit', $args->script_call_before_submit);
     Context::set('join_form', $args->join_form);
     if ($this->plugin_info->conversion_rate) {
         $price = round($args->price * $this->plugin_info->conversion_rate, 2);
         Context::set('price', $price);
     }
     $html = $oTemplate->compile($tpl_path, $tpl_file);
     $output = new Object();
     $output->data = $html;
     return $output;
 }