/**
  * Handle an error.
  *
  * @param       int             $errorNo        Error number
  * @param       string          $errorMsg       Error message
  * @param       string          $errorFile      Error script file
  * @param       int             $errorLine      Error script line
  */
 public static function handle($errorNo, $errorMsg, $errorFile, $errorLine)
 {
     // Build the complete error message
     $mailMsg = '<b>--- ' . BRAND_NAME . ' ErrorHandler ---</b>' . PHP_EOL . PHP_EOL;
     $mailMsg .= 'Date: ' . Date::format() . PHP_EOL;
     $mailMsg .= 'Error number: ' . $errorNo . PHP_EOL;
     $mailMsg .= 'Error type: ' . self::$errortypes[$errorNo] . PHP_EOL;
     $mailMsg .= 'Error message: ' . $errorMsg . PHP_EOL;
     $mailMsg .= 'Script name: ' . $errorFile . PHP_EOL;
     $mailMsg .= 'Line number: ' . $errorLine . PHP_EOL;
     $mailMsg .= 'Request URL: ' . URL_BASE . ltrim(REQUEST_URI, '/') . PHP_EOL;
     if (isset($_SERVER['HTTP_USER_AGENT'])) {
         $mailMsg .= 'User agent: ' . $_SERVER['HTTP_USER_AGENT'];
     }
     // Determine whether debug mode is active
     if (debugMode()) {
         // In case debug mode is active, set the error message as the frontend message
         debugPrint($mailMsg);
     } else {
         // Prepare the error mailer
         Mail::addMailer(EMAIL_HOST, EMAIL_PORT, EMAIL_ERROR_FROM, EMAIL_ERROR_FROM_PASSWORD, BRAND_PRODUCT);
         // Send the error email
         Mail::send(EMAIL_ERROR_RECIPIENT, EMAIL_ERROR_FROM, EMAIL_ERROR_SUBJECT, nl2br($mailMsg));
         // In case of a fatal error, stop execution and show the general frontend message
         if ($errorNo !== E_WARNING && $errorNo !== E_NOTICE && $errorNo !== E_USER_NOTICE && $errorNo !== E_STRICT) {
             debugPrint(__('An unexpected error has occured.<br>If this error keeps occuring, please contact your vendor for assistance') . __('<br>Message: %s', $errorMsg));
         }
     }
 }
 function procDoNotify()
 {
     $oController =& getController('module');
     $output = $oController->lock('commentnotify', 400);
     if (!$output->toBool()) {
         return;
     }
     $deadline = $output->get('deadline');
     if (file_exists($this->cachedir . $this->cachefile)) {
         FileHandler::removeFile($this->cachedir . $this->cachefile);
     }
     $oModel =& getModel('tccommentnotify');
     $output = $oModel->GetCommentsFromNotifyQueue();
     if (!$output->toBool()) {
         debugPrint("Error");
         debugPrint($output);
     }
     if ($output->data) {
         foreach ($output->data as $data) {
             $this->deleteFromQueue($data->comment_srl);
             $this->sendCommentNotify($data->comment_srl);
         }
     }
     $oController->unlock('commentnotify', $deadline);
 }
 /**
  * @brief 모듈 환경설정값 쓰기
  **/
 function procNmileageAdminInsertModInst()
 {
     // module 모듈의 model/controller 객체 생성
     $oModuleController =& getController('module');
     $oModuleModel =& getModel('module');
     // 게시판 모듈의 정보 설정
     $args = Context::getRequestVars();
     $args->module = 'nmileage';
     debugPrint('procNmileageADminInsertModInst');
     debugPrint($args);
     // 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', 'dispNmileageAdminInsertModInst', 'module_srl', $this->get('module_srl'));
     $this->setRedirectUrl($returnUrl);
 }
 function send($comment, $access, $uselang = 'en', $use_socialxe = false)
 {
     $result = new Object();
     // 머리글
     $lang->comment = $this->lang->comment[$uselang];
     if (!$lang->comment) {
         $lang->comment = $this->lang->comment['en'];
     }
     $lang->notify = $this->lang->notify[$uselang];
     if (!$lang->notify) {
         $lang->notify = $this->lang->notify['en'];
     }
     // 페이스북 객체 생성
     $fb = new FacebookSocialXE(array("appId" => $this->app_id, "secret" => $this->app_secret, "cookie" => false));
     // 세션 세팅
     if (is_object($access)) {
         debugPrint('facebook: (array)$access : ' . (array) $access);
         $fb->setSession((array) $access, false);
     }
     // 얼마만큼의 길이를 사용할 수 있는지 확인
     $max_length = 420;
     // 실제 내용을 준비
     if ($comment->content_title) {
         $title = $comment->content_title;
     } else {
         if ($use_socialxe) {
             $title = $lang->notify;
         } else {
             $title = $lang->comment;
         }
     }
     $content2 = '「' . $title . '」 ' . $comment->content;
     // 내용 길이가 최대 길이를 넘는지 확인
     $content = $this->cut_str($content2, $max_length - 3, '...');
     // 썸네일이 제공되면 그것을 사용
     if ($comment->content_thumbnail) {
         $image = $comment->content_thumbnail;
     } else {
         $image = Context::getRequestUri() . 'modules/socialxeserver/tpl/images/blank.gif';
     }
     // 부모 댓글이 페이스북이면 메일로 댓글 알림
     if ($comment->parent && $comment->parent->provider == 'facebook') {
         $reply_id = $comment->parent->comment_id;
         try {
             $output = $fb->api(array('method' => 'notifications.sendEmail', 'recipients' => $comment->parent->id, 'subject' => $title, 'text' => $content . ' ' . $comment->content_link));
         } catch (FacebookApiException $e) {
             $output->error = $e->__toString();
         }
     } else {
         try {
             $output = $fb->api($fb->getUser() . '/feed', 'POST', array('message' => $content, 'link' => $comment->content_link, 'picture' => $image));
         } catch (FacebookApiException $e) {
             $output->error = $e->__toString();
         }
     }
     $result->add('result', $output);
     return $result;
 }
Exemple #5
0
function writeFile($filename, $content)
{
    if (!($handle = fopen($filename, 'w'))) {
        echo "Cannot open file ({$filename})";
        exit;
    }
    if (fwrite($handle, $content) === FALSE) {
        echo "Cannot write to file ({$filename})";
        exit;
    }
    fclose($handle);
    debugPrint('writeFile', "Success, wrote json to file ({$filename})");
}
 function send($provider, $comment, $access, $uselang = 'en', $use_socialxe = false)
 {
     //debug :@kakikaki
     $debugstr = '';
     $debugstr .= 'provider : ' . $provider . "\n";
     //$debugstr .= 'comment : ' .$comment."\n";
     //$debugstr .= 'access : '.$access."\n";
     //$debugstr .= 'use_socialxe : '.$use_socialxe;
     debugPrint('providerManager->send() 진입함 ');
     debugPrint($debugstr);
     debugPrint('comment (type): ' . gettype($comment));
     if (!$this->inProvider($provider)) {
         return new Object(-1, 'msg_invalid_provider');
     }
     return $this->provider[$provider]->send($comment, $access, $uselang, $use_socialxe);
 }
 /**
  * @brief 모듈 환경설정값 쓰기
  **/
 function procLicenseAdminConfig()
 {
     $args = Context::getRequestVars();
     debugPrint($args);
     // save module configuration.
     $oModuleControll = getController('module');
     $output = $oModuleControll->insertModuleConfig('license', $args);
     $oLicenseModel =& getModel('license');
     $oLicenseModel->checkLicense('nstore', $args->user_id, $args->serial_number, TRUE);
     $oLicenseModel->checkLicense('nstore_digital', $args->d_user_id, $args->d_serial_number, TRUE);
     $this->setMessage('success_updated');
     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', 'dispLicenseAdminConfig', 'module_srl', Context::get('module_srl'));
         $this->setRedirectUrl($returnUrl);
     }
 }
 function init()
 {
     debugPrint('authentication mobile');
     $oAuthenticationModel =& getModel('authentication');
     $config = $oAuthenticationModel->getModuleConfig();
     if (!$config->mskin) {
         $config->mskin;
     }
     $this->setTemplatePath($this->module_path . "m.skins/{$config->mskin}");
     $oLayoutModel =& getModel('layout');
     $layout_info = $oLayoutModel->getLayout($config->mlayout_srl);
     if ($layout_info) {
         $this->module_info->mlayout_srl = $config->mlayout_srl;
         $this->setLayoutPath($layout_info->path);
     }
 }
	/**
	 * @brief saving config values.
	 **/
	function procPaynotyAdminInsert() 
	{
		$params = Context::gets('admin_phones','admin_emails','sender_name','sender_email','content','mail_content','module_srls','msgtype','sending_method');
		$params->config_srl = Context::get('config_srl');

		if ($params->config_srl) 
		{
			// delete existences
			$args->config_srl = $params->config_srl;
			$output = executeQuery('paynoty.deleteConfig', $args);
			if (!$output->toBool()) return $output;
			$output = executeQuery('paynoty.deleteModule', $args);
			if (!$output->toBool()) return $output;
		}
		else
		{
			// new sequence
			$params->config_srl = getNextSequence();
		}

		// insert module srls
		$module_srls = explode(',', $params->module_srls);
		foreach ($module_srls as $srl) 
		{
			unset($args);
			$args->config_srl = $params->config_srl;
			$args->module_srl = $srl;
			$output = executeQuery('paynoty.insertModuleSrl', $args);
			if (!$output->toBool()) return $output;
		}

		//$params->extra_vars = serialize($extra_vars);

		debugPrint('params : ' . serialize($params));
		// insert paynoty
		$output = executeQuery('paynoty.insertConfig', $params);
		debugPrint('insertConfig : ' . serialize($output));
		if (!$output->toBool()) 
		{
			return $output;
		}

		$redirectUrl = getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPaynotyAdminModify','config_srl',$params->config_srl);
		$this->setRedirectUrl($redirectUrl);
	}
Exemple #10
0
 function processPayment($args)
 {
     debugPrint('processPayment');
     debugPrint($args);
     $output = new Object();
     $output->add('state', '2');
     // not completed
     $output->add('payment_method', 'ZP');
     $output->add('payment_amount', $args->price);
     $output->add('result_code', '0');
     $output->add('result_message', 'success');
     $output->add('pg_tid', $this->keygen());
     $output->add('vact_bankname', $this->plugin_info->bank_name);
     $output->add('vact_num', $this->plugin_info->account_number);
     $output->add('vact_name', $this->plugin_info->account_holder);
     $output->add('vact_inputname', $args->depositor_name);
     return $output;
 }
Exemple #11
0
 /**
  * Connect to selected database type
  */
 public function Connect()
 {
     if (DB_TYPE == 'mysql') {
         try {
             $options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
             $this->connection = new PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_DATABASE_NAME . "", DB_USER_LOGIN, DB_USER_PASSWORD, $options);
         } catch (PDOException $e) {
             $message = "Error!: " . $e->getMessage() . "<br/>";
             debugPrint($message);
             die;
         }
     } elseif (DB_TYPE == 'pgsql') {
         $message = "PgSQL connectivity is NOT implemented";
         debugPrint($message);
         die;
     } else {
         $message = "Unknown database type. This type " . DB_TYPE . " is NOT implemented";
         debugPrint($message);
         die;
     }
 }
Exemple #12
0
 /**
  * @brief epay.getPaymentForm 에서 호출됨
  */
 function dispKcpForm()
 {
     $oEpayController =& getController('epay');
     $oNcartModel =& getModel('ncart');
     $kcphome = sprintf(_XE_PATH_ . "files/epay/%s", $this->module_info->module_srl);
     // get products info using cartnos
     $reviewOutput = $oEpayController->reviewOrder();
     if (!$reviewOutput->toBool()) {
         return $reviewOutput;
     }
     debugPrint('$reviewOutput');
     debugPrint($reviewOutput);
     Context::set('review_form', $reviewOutput->review_form);
     Context::set('item_name', $reviewOutput->item_name);
     Context::set('price', $reviewOutput->price);
     Context::set('transaction_srl', $reviewOutput->transaction_srl);
     Context::set('order_srl', $reviewOutput->order_srl);
     // payment method 변환 <-- CC, IB, VA, MP 를 결제모듈에서 정의된 것으로 대체할 수 있으면 좋겠음.
     $payment_method = Context::get('payment_method');
     switch ($payment_method) {
         case "CC":
             $payment_method = "100000000000";
             break;
         case "IB":
             $payment_method = "010000000000";
             break;
         case "VA":
             $payment_method = "001000000000";
             break;
         case "MP":
             $payment_method = "000010000000";
             break;
         default:
             $payment_method = "100000000000";
     }
     Context::set('payment_method', $payment_method);
     debugPrint($payment_method);
     $this->setTemplateFile('formdata');
 }
Exemple #13
0
 /**
  * @brief insert paynoty configuration info.
  **/
 function dispPaynotyAdminConfig()
 {
     $oEditorModel = getModel('editor');
     $editor_config = $oEditorModel->getEditorConfig(0);
     // set editor options.
     $option = new stdClass();
     $option->skin = $editor_config->editor_skin;
     $option->content_style = $editor_config->content_style;
     $option->content_font = $editor_config->content_font;
     $option->content_font_size = $editor_config->content_font_size;
     $option->colorset = $editor_config->sel_editor_colorset;
     $option->allow_fileupload = true;
     $option->enable_default_component = true;
     $option->enable_component = true;
     $option->disable_html = false;
     $option->height = 200;
     $option->enable_autosave = false;
     $option->primary_key_name = 'noti_srl';
     $option->content_key_name = 'mail_content';
     $editor = $oEditorModel->getEditor(0, $option);
     Context::set('editor', $editor);
     $member_config = getModel('member')->getMemberConfig();
     $variable_name = array();
     foreach ($member_config->signupForm as $item) {
         if ($item->type == 'tel') {
             $variable_name[] = $item->name;
         }
     }
     debugPrint($variable_name);
     $config = getModel('paynoty')->getConfig();
     if (!$config) {
         $config->content = Context::getLang('default_content');
         $config->mail_content = Context::getLang('default_mail_content');
     }
     Context::set('config', $config);
     Context::set('variable_name', $variable_name);
 }
/**
 * Returns a valid transport for Swift_Mailer.
 *
 * @param mixed[] $snmp_conf Connection parameters.
 * An empty array will cause a sendmail transport be returned.
 * Params:
 *   string host  Server hostname
 *   int    port  Server port
 *   string proto Connection protocol: ssl, sslv2, sslv3 or tsl. Empty for tcp
 *   string user  Auth username
 *   string pass  Auth password
 *
 * @return Swift_Transport The mail transport.
 *
 * @throws Swift_TransportException if the transport can't connect
 */
function mail_get_transport($snmp_conf = array())
{
    //~ debugPrint($snmp_conf, true);
    if (empty($snmp_conf)) {
        // Use the system sendmail
        debugPrint('sendmail', true);
        return Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -t -bv');
    }
    if (empty($snmp_conf['host']) || empty($snmp_conf['port'])) {
        throw new Exception('Invalid SNMP connection data');
    }
    //~ debugPrint('smtp', true);
    $transport = Swift_SmtpTransport::newInstance();
    $transport->setHost($snmp_conf['host']);
    $transport->setPort((int) $snmp_conf['port']);
    $transport->setUsername($snmp_conf['user']);
    $transport->setPassword($snmp_conf['pass']);
    if (!empty($snmp_conf['proto'])) {
        $transport->setEncryption($snmp_conf['proto']);
    }
    // Try the connection. Can throw a 'Swift_TransportException'
    $transport->start();
    return $transport;
}
 /**
  * @brief pay
  */
 function procCashpayDoIt()
 {
     debugPrint('procCashpayDoIt');
     $oEpayController =& getController('epay');
     $vars = Context::getRequestVars();
     $output = $oEpayController->beforePayment($vars);
     debugPrint($output);
     if (!$output->toBool()) {
         return $output;
     }
     $obj->bank_name = $this->module_info->bank_name;
     $obj->account_number = $this->module_info->account_number;
     $obj->account_holder = $this->module_info->account_holder;
     $output = new Object();
     $output->add('transaction_srl', Context::get('transaction_srl'));
     $output->add('state', '1');
     // not completed
     $output->add('payment_method', 'BT');
     $output->add('payment_amount', Context::get('price'));
     $output->add('result_code', '0');
     $output->add('result_message', 'success');
     $output->add('pg_tid', $this->keygen());
     $output->add('vact_bankname', $obj->bank_name);
     $output->add('vact_num', $obj->account_number);
     $output->add('vact_name', $obj->account_holder);
     $output->add('vact_inputname', context::get('depositor_name'));
     // afterPayment will call an after trigger
     $output = $oEpayController->afterPayment($output);
     if (!$output->toBool()) {
         return $output;
     }
     $return_url = $output->get('return_url');
     if ($return_url) {
         $this->setRedirectUrl($return_url);
     }
 }
 /**
  * Set the Session.
  *
  * @param Array $session the session
  * @param Boolean $write_cookie indicate if a cookie should be written. this
  * value is ignored if cookie support has been disabled.
  */
 public function setSession($session = null, $write_cookie = true)
 {
     $session = $this->validateSessionObject($session);
     debugPrint($session);
     $this->sessionLoaded = true;
     $this->session = $session;
     if ($write_cookie) {
         $this->setCookieFromSession($session);
     }
     return $this;
 }
 /**
  * @brief 가상계좌 입금시 처리
  */
 function processReport($order_srl)
 {
     $oEpayModel =& getModel('epay');
     $transaction_info = $oEpayModel->getTransactionByOrderSrl($order_srl);
     if (!$transaction_info) {
         return new Object(-1, 'could not find transaction');
     }
     $TEMP_IP = $_SERVER["REMOTE_ADDR"];
     $PG_IP = substr($TEMP_IP, 0, 10);
     //PG에서 보냈는지 IP로 체크
     if ($PG_IP != "203.238.37" && $PG_IP != "210.98.138") {
         debugPrint($PG_IP . 'is not from inicis');
         return new Object(-1, 'msg_invalid_request');
     }
     /*
     // 이니시스에서 보내오는 request 변수들
     $msg_id = $msg_id;             //메세지 타입
     $no_tid = $no_tid;             //거래번호
     $no_oid = $no_oid;             //상점 주문번호
     $id_merchant = $id_merchant;   //상점 아이디
     $cd_bank = $cd_bank;           //거래 발생 기관 코드
     $cd_deal = $cd_deal;           //취급 기관 코드
     $dt_trans = $dt_trans;         //거래 일자
     $tm_trans = $tm_trans;         //거래 시간
     $no_msgseq = $no_msgseq;       //전문 일련 번호
     $cd_joinorg = $cd_joinorg;     //제휴 기관 코드
     
     $dt_transbase = $dt_transbase; //거래 기준 일자
     $no_transeq = $no_transeq;     //거래 일련 번호
     $type_msg = $type_msg;         //거래 구분 코드
     $cl_close = $cl_close;         //마감 구분코드
     $cl_kor = $cl_kor;             //한글 구분 코드
     $no_msgmanage = $no_msgmanage; //전문 관리 번호
     $no_vacct = $no_vacct;         //가상계좌번호
     $amt_input = $amt_input;       //입금금액
     $amt_check = $amt_check;       //미결제 타점권 금액
     $nm_inputbank = $nm_inputbank; //입금 금융기관명
     $nm_input = $nm_input;         //입금 의뢰인
     $dt_inputstd = $dt_inputstd;   //입금 기준 일자
     $dt_calculstd = $dt_calculstd; //정산 기준 일자
     $flg_close = $flg_close;       //마감 전화
     */
     /*
     //가상계좌채번시 현금영수증 자동발급신청시에만 전달
     $dt_cshr      = $dt_cshr;       //현금영수증 발급일자
     $tm_cshr      = $tm_cshr;       //현금영수증 발급시간
     $no_cshr_appl = $no_cshr_appl;  //현금영수증 발급번호
     $no_cshr_tid  = $no_cshr_tid;   //현금영수증 발급TID
     */
     $inipayhome = sprintf(_XE_PATH_ . "files/epay/%s", $transaction_info->module_srl);
     $logfile = fopen($inipayhome . "/log/vbank_" . date("Ymd") . ".log", "a+");
     $vars = Context::getRequestVars();
     foreach ($vars as $key => $val) {
         fwrite($logfile, $key . " : " . $val . "\n");
     }
     /*
     $output = $this->processPayment(Context::get('no_oid'), Context::get('amt_input'));
     if (!$output->toBool()) return $output;
     */
     fwrite($logfile, "************************************************\n\n");
     fclose($logfile);
     //위에서 상점 데이터베이스에 등록 성공유무에 따라서 성공시에는 "OK"를 이니시스로
     //리턴하셔야합니다. 아래 조건에 데이터베이스 성공시 받는 FLAG 변수를 넣으세요
     //(주의) OK를 리턴하지 않으시면 이니시스 지불 서버는 "OK"를 수신할때까지 계속 재전송을 시도합니다
     //기타 다른 형태의 PRINT( echo )는 하지 않으시기 바랍니다
     $output = new Object();
     $output->order_srl = Context::get('no_oid');
     $output->amount = Context::get('amt_input');
     if ($output->amount == $transaction_info->payment_amount) {
         $output->add('state', '2');
         // successfully completed
         $output->add('result_code', '0');
         $output->add('result_message', 'Success');
     } else {
         $output->setError(-1);
         $output->setMessage('amount does not match');
         $output->add('state', '3');
         // failed
         $output->add('result_code', '1');
         $output->add('result_message', 'amount does not match');
     }
     $output->add('transaction_srl', $transaction_info->transaction_srl);
     $output->add('payment_method', 'VA');
     $output->add('payment_amount', $transaction_info->payment_amount);
     $output->add('pg_tid', $transaction_ifno->pg_tid);
     $output->add('vact_bankname', $transaction_info->vact_bankname);
     $output->add('vact_num', $transaction_info->vact_num);
     $output->add('vact_name', $transaction_info->vact_name);
     $output->add('vact_inputname', $transaction_info->vact_inputname);
     // doPayment will call an after trigger
     $oEpayController =& getController('epay');
     $output = $oEpayController->afterPayment($output);
     if (!$output->toBool()) {
         return $output;
     }
     // OK를 출력하고 끝내야 한다.
     echo "OK";
     exit(0);
 }
 function getContentText($strlen = 0)
 {
     if (!$this->document_srl) {
         return "<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-size:18.0pt;font-family:'08서울남산체 EB,한컴돋움';font-weight:'bold';line-height:160%'>상&nbsp; 담&nbsp; 일&nbsp; 지</SPAN></P>\n\n\t\t<P CLASS=HStyle0 STYLE='text-align:center;'></P>\n\t\t<TABLE border='1' cellspacing='0' cellpadding='0' style='border-collapse:collapse;border:1;width: 60%;position: relative;margin: auto;'>\n\t\t<TR>\n\t\t\t<TD valign='middle' style='width:80;height:44;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>내담자</SPAN></P>\n\t\t\t</TD>\n\t\t\t<TD valign='middle' style='width:209;height:44;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>&nbsp;</SPAN></P>\n\t\t\t</TD>\n\t\t\t<TD valign='middle' style='width:82;height:44;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>상담자</SPAN></P>\n\t\t\t</TD>\n\t\t\t<TD valign='middle' style='width:261;height:44;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>&nbsp;</SPAN></P>\n\t\t\t</TD>\n\t\t</TR>\n\t\t<TR>\n\t\t\t<TD valign='middle' style='width:80;height:44;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>회기</SPAN></P>\n\t\t\t</TD>\n\t\t\t<TD valign='middle' style='width:209;height:44;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>12</SPAN></P>\n\t\t\t</TD>\n\t\t\t<TD colspan='2' valign='middle' style='width:343;height:44;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>2015년&nbsp;&nbsp; 12월&nbsp; 17일 (월요일) </SPAN></P>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>pm 15:00 ~ 15:40</SPAN></P>\n\t\t\t</TD>\n\t\t</TR>\n\t\t<TR>\n\t\t\t<TD valign='middle' style='width:80;height:44;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>상담목표</SPAN></P>\n\t\t\t</TD>\n\t\t\t<TD colspan='3' valign='middle' style='width:552;height:44;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움''>&nbsp;</SPAN></P>\n\t\t\t</TD>\n\t\t</TR>\n\t\t<TR>\n\t\t\t<TD valign='middle' style='width:80;height:495;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>주요활동</SPAN></P>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>및</SPAN></P>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>상담내용</SPAN></P>\n\t\t\t</TD>\n\t\t\t<TD colspan='3' valign='middle' style='width:552;height:495;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0>● <SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>입실 시 태도</SPAN></P>\n\t\t\t<P CLASS=HStyle0><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움''>&nbsp;</SPAN></P>\n\t\t\t<P CLASS=HStyle0><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움''>&nbsp;</SPAN></P>\n\t\t\t<P CLASS=HStyle0>● <SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>치료 시 태도</SPAN></P>\n\t\t\t<P CLASS=HStyle0><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움''>&nbsp;</SPAN></P>\n\t\t\t<P CLASS=HStyle0><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움''>&nbsp;</SPAN></P>\n\t\t\t<P CLASS=HStyle0>● <SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>퇴실 시 태도</SPAN></P>\n\t\t\t<P CLASS=HStyle0><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움''>&nbsp;</SPAN></P>\n\t\t\t</TD>\n\t\t</TR>\n\t\t<TR>\n\t\t\t<TD valign='middle' style='width:80;height:99;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>상담자 소견</SPAN></P>\n\t\t\t</TD>\n\t\t\t<TD colspan='3' valign='middle' style='width:552;height:99;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움''>&nbsp;</SPAN></P>\n\t\t\t</TD>\n\t\t</TR>\n\t\t<TR>\n\t\t\t<TD valign='middle' style='width:80;height:106;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>부모상담</SPAN></P>\n\t\t\t<P CLASS=HStyle0 STYLE='text-align:center;'><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움';font-weight:'bold''>내용</SPAN></P>\n\t\t\t</TD>\n\t\t\t<TD colspan='3' valign='middle' style='width:552;height:106;border-left:solid #000000 0.4pt;border-right:solid #000000 0.4pt;border-top:solid #000000 0.4pt;border-bottom:solid #000000 0.4pt;padding:1.4pt 5.1pt 1.4pt 5.1pt'>\n\t\t\t<P CLASS=HStyle0><SPAN STYLE='font-family:'08서울남산체 L,한컴돋움''>&nbsp;</SPAN></P>\n\t\t\t</TD>\n\t\t</TR>\n\t\t</TABLE>\n\t\t<P CLASS=HStyle0 STYLE='text-align:center;'></P>";
     }
     if ($this->isSecret() && !$this->isGranted() && !$this->isAccessible()) {
         return Context::getLang('msg_is_secret');
     }
     debugPrint("2");
     $result = $this->_checkAccessibleFromStatus();
     if ($result) {
         $_SESSION['accessible'][$this->document_srl] = true;
     }
     debugPrint("3");
     $content = $this->get('content');
     $content = preg_replace_callback('/<(object|param|embed)[^>]*/is', array($this, '_checkAllowScriptAccess'), $content);
     $content = preg_replace_callback('/<object[^>]*>/is', array($this, '_addAllowScriptAccess'), $content);
     debugPrint($content);
     if ($strlen) {
         return cut_str(strip_tags($content), $strlen, '...');
     }
     return htmlspecialchars($content);
 }
 function procEscrowDenyConfirm()
 {
     $inipayhome = sprintf(_XE_PATH_ . "files/epay/%s", $this->plugin_info->plugin_srl);
     $vars = Context::getRequestVars();
     debugPrint('procEscrowDenyConfirm');
     debugPrint($vars);
     extract(get_object_vars($vars));
     /**************************
      * 1. 라이브러리 인클루드 *
      **************************/
     require "libs/INILib.php";
     /***************************************
      * 2. INIpay50 클래스의 인스턴스 생성 *
      ***************************************/
     $iniescrow = new INIpay50();
     /*********************
      * 3. 지불 정보 설정 *
      *********************/
     $iniescrow->SetField("inipayhome", $inipayhome);
     $iniescrow->SetField("tid", Context::get('tid'));
     $iniescrow->SetField("mid", $this->plugin_info->inicis_id);
     $iniescrow->SetField("admin", $this->plugin_info->inicis_pass);
     $iniescrow->SetField("type", "escrow");
     $iniescrow->SetField("escrowtype", "dcnf");
     // 고정 (절대 수정 불가)
     $iniescrow->SetField("dcnf_name", $dcnf_name);
     $iniescrow->SetField("debug", "true");
     /*********************
      * 3. 거절확인 요청 *
      *********************/
     $iniescrow->startAction();
     /**********************
      * 4. 거절확인  결과 *
      **********************/
     debugPrint($iniescrow->m_Data);
     $tid = $iniescrow->GetResult("tid");
     // 거래번호
     $resultCode = $iniescrow->GetResult("ResultCode");
     // 결과코드 ("00"이면 지불 성공)
     $resultMsg = $iniescrow->GetResult("ResultMsg");
     // 결과내용 (지불결과에 대한 설명)
     $resultDate = $iniescrow->GetResult("DCNF_Date");
     // 처리 날짜
     $resultTime = $iniescrow->GetResult("DCNF_Time");
     // 처리 시각
     Context::set('tid', $tid);
     Context::set('resultCode', $resultCode);
     Context::set('resultMsg', $resultMsg);
     Context::set('resultDate', $resultDate);
     Context::set('resultTime', $resultTime);
     $oTemplate =& TemplateHandler::getInstance();
     $tpl_path = _XE_PATH_ . "modules/epay/plugins/iniescrow/tpl";
     $tpl_file = 'escrow_denyconfirm_result.html';
     $tpl = $oTemplate->compile($tpl_path, $tpl_file);
     $output = new Object();
     if (!$resultCode != '00') {
         $output->setError(-1);
     }
     $output->add('order_srl', Context::get('order_srl'));
     $output->add('denyconfirm_code', $resultCode);
     $output->add('denyconfirm_message', iconv('EUC-KR', 'UTF-8', $resultMsg));
     $output->add('denyconfirm_date', $resultDate . $resultTime);
     $output->setMessage($tpl);
     return $output;
 }
Exemple #20
0
 function sendComment($args, $manual_data = null)
 {
     $result = new Object();
     set_time_limit(0);
     $oSocialxeModel =& getModel('socialxe');
     if ($manual_data) {
         $logged_provider_list = $manual_data->logged_provider_list;
         $master_provider = $manual_data->master_provider;
         $slave_provider = $manual_data->slave_provider;
     } else {
         $logged_provider_list = $this->providerManager->getLoggedProviderList();
         $master_provider = $this->providerManager->getMasterProvider();
         $slave_provider = $this->providerManager->getSlaveProvider();
     }
     $config = $this->config;
     // $logged_provider_list에서 xe 제외
     if ($logged_provider_list[0] == 'xe') {
         array_shift($logged_provider_list);
     }
     // 데이터 준비
     $comment->content = $args->content;
     $comment->content_link = $args->content_link;
     $comment->hashtag = $config->hashtag;
     $comment->content_title = $args->content_title;
     $comment->content_thumbnail = $args->content_thumbnail;
     // 대댓글이면 부모 댓글의 정보를 준비
     if ($args->parent_srl) {
         $output = $oSocialxeModel->getSocialByCommentSrl($args->parent_srl);
         $comment->parent = $output->data;
     }
     // 내용을 분석해서 각 소셜 서비스의 리플 형식이 들어있는지 확인
     $reply_provider_list = $this->providerManager->getReplyProviderList($comment->content);
     // 보낼 필요가 있는지 확인
     if (count($reply_provider_list) == 0) {
         // 대댓글이면
         if ($args->parent_srl) {
             // 부모 댓글에 소셜 정보가 없으면 리턴~
             if (!$comment->parent->provider || $comment->parent->provider == 'xe') {
                 return new Object();
             }
         } else {
             // 로그인한 소셜 서비스가 없으면 리턴~
             if (!count($logged_provider_list)) {
                 return new Object();
             }
         }
     }
     $args->url = $this->_getCommentUrl($comment->content_link, $comment->parent->comment_srl);
     if ($config->use_short_url != 'N') {
         // 생성된 짧은 주소가 있는지 확인한다.
         $output = executeQuery('socialxe.getBitlyByUrl', $args);
         $comment->short_link = $output->data->short_url;
         // 생성된 짧은 주소가 없으며 생성
         if ($this->config->bitly_username && $this->config->bitly_api_key && !$comment->short_link) {
             // bit.ly 라이브러리 로드
             if (!class_exists("bitly_SocialXE")) {
                 require_once _XE_PATH_ . 'modules/socialxe/bitly.php';
             }
             // 링크 생성
             $bitly = new bitly_SocialXE($this->config->bitly_username, $this->config->bitly_api_key);
             $content_link = $bitly->shorten(urlencode($this->_getCommentUrl($comment->content_link, $comment->parent->comment_srl)));
             if ($content_link) {
                 $comment->short_link = $content_link;
             }
         }
     } else {
         $comment->short_link = $args->url;
     }
     // API 요청 준비
     $data = array('client' => $config->client_token, 'comment' => $comment, 'logged_provider_list' => $logged_provider_list, 'reply_provider_list' => $reply_provider_list, 'master_provider' => $master_provider, 'uselang' => Context::getLangType());
     // 소셜 서비스 액세스 정보 준비
     if ($manual_data) {
         $accesses = $manual_data->access;
     } else {
         $accesses = $this->providerManager->getAccesses();
     }
     foreach ($accesses as $provider => $access) {
         $data[$provider] = serialize($access);
     }
     // URL 생성
     $url = $this->getURL('send', $data);
     // 요청
     $content = $this->httpRequest($url, 'POST');
     //debug :@kakikaki
     debugPrint('$url : ' . $url);
     debugPrint('$content : ' . $content);
     //end
     if (!$content) {
         $result->setError(-1);
         $result->setMessage('msg_request_error');
         //여기서 에러 발생 (댓글 작성 : XE-1.7.4)
         return $result;
     }
     // JSON 디코딩
     $json = new Services_JSON_SocialXE();
     $output = $json->decode($content);
     if (!$output) {
         return new Object(-1, $content);
     }
     // 오류 체크
     if ($output->error) {
         $result->setError(-1);
         $result->setMessage($output->message);
         return $result;
     }
     // 전송 결과를 체크
     $msg = array();
     $lang_provider = Context::getLang('provider');
     foreach ($this->providerManager->getProviderList() as $provider) {
         if ($output->result->{$provider}->error) {
             $msg[] = sprintf(Context::getLang('msg_send_failed'), $lang_provider[$provider], $output->result->{$provider}->error);
         }
     }
     if (count($msg)) {
         $msg = implode("\n", $msg);
         $result->add('msg', $msg);
     }
     if ($config->use_short_url != 'N') {
         // bit.ly 결과를 저장한다.
         if ($bitly) {
             $bitly_result = $bitly->getRawResults();
             $args->hash = $bitly_result['userHash'];
             $args->title = $comment->content_title;
             $args->short_url = $comment->short_link;
             $args->url = $this->_getCommentUrl($comment->content_link, $comment->parent->comment_srl);
             executeQuery('socialxe.insertBitly', $args);
         }
     }
     // 대표 계정의 댓글 번호를 세팅한다.
     if ($master_provider == 'xe' && $slave_provider) {
         $comment_id = $output->result->{$slave_provider}->id;
     } else {
         if ($master_provider) {
             $comment_id = $output->result->{$master_provider}->id;
         }
     }
     $result->add('comment_id', $comment_id);
     return $result;
 }
Exemple #21
0
 function processReview($args)
 {
     require_once $this->module_path . 'CallerService.php';
     $cs = new CallerService();
     $currencyCodeType = $this->plugin_info->currency_code;
     $paymentType = 'Sale';
     $L_NAME0 = urlencode($args->order_title);
     $L_AMT0 = $args->price;
     if ($this->plugin_info->conversion_rate) {
         $L_AMT0 = round($args->price * $this->plugin_info->conversion_rate, 2);
     }
     $L_QTY0 = '1';
     $L_NUMBER0 = $args->order_srl;
     $returnURL = urlencode(getNotEncodedFullUrl('', 'module', 'epay', 'act', 'procEpayDoPayment', 'epay_module_srl', $args->epay_module_srl, 'plugin_srl', $args->plugin_srl, 'order_srl', $args->order_srl, 'currencyCodeType', $currencyCodeType, 'paymentType', $paymentType));
     $cancelURL = urlencode(getNotEncodedFullUrl(''));
     $itemamt = 0.0;
     $itemamt = $L_QTY0 * $L_AMT0;
     $amt = $itemamt;
     $maxamt = $amt + 25.0;
     $nvpstr = "";
     $nvpstr = "&L_NAME0=" . $L_NAME0 . "&L_AMT0=" . $L_AMT0 . "&L_QTY0=" . $L_QTY0 . "&MAXAMT=" . (string) $maxamt . "&AMT=" . (string) $amt . "&ITEMAMT=" . (string) $itemamt . "&CALLBACKTIMEOUT=4&L_NUMBER0=" . $L_NUMBER0 . "&L_DESC0=" . $L_NAME0 . "&RETURNURL=" . $returnURL . "&CANCELURL=" . $cancelURL . "&CURRENCYCODE=" . $currencyCodeType . "&PAYMENTACTION=" . $paymentType;
     if ($this->plugin_info->logo_image) {
         $nvpstr .= "&HDRIMG=" . getFullSiteUrl() . $this->plugin_info->logo_image;
     }
     $nvpstr = $nvpHeader . $nvpstr;
     debugPrint('$nvpstr');
     debugPrint($nvpstr);
     /* Make the call to PayPal to set the Express Checkout token
     		If the API call succeded, then redirect the buyer to PayPal
     		to begin to authorize payment.  If an error occured, show the
     		resulting errors
     		*/
     $resArray = $cs->hash_call("SetExpressCheckout", $nvpstr);
     $_SESSION['reshash'] = $resArray;
     $ack = strtoupper($resArray["ACK"]);
     Context::set('resArray', $resArray);
     if ($ack == "SUCCESS") {
         // Redirect to paypal.com here
         $token = urldecode($resArray["TOKEN"]);
         $payPalURL = PAYPAL_URL . $token;
         $output = new Object();
         $output->add('return_url', $payPalURL);
         return $output;
     } else {
         $errorCode = $_SESSION['curl_error_no'];
         $errorMessage = $_SESSION['curl_error_msg'];
         Context::set('errorCode', $errorCode);
         Context::set('errorMessage', $errorMessage);
         $oTemplate =& TemplateHandler::getInstance();
         $tpl_path = _XE_PATH_ . "modules/epay/plugins/paypal/tpl";
         $tpl_file = 'api_error.html';
         $html = $oTemplate->compile($tpl_path, $tpl_file);
         $output = new Object(-1);
         $output->data = $html;
         $output->setMessage($html);
         return $output;
     }
     return new Object();
 }
 function dispAttendanceBoard()
 {
     $oModuleModel = getModel('module');
     $oDocumentModel = getModel('document');
     $module_info = $oModuleModel->getModuleInfoByMid('attendance');
     $oModuleModel->syncSkinInfoToModuleInfo($module_info);
     $oAttendanceModel = getModel('attendance');
     $oMemberModel = getModel('member');
     $oAttendanceAdminModel = getAdminModel('attendance');
     //날짜 초기화
     $document_srl = Context::get('document_srl');
     $selected_date = Context::get('selected_date');
     if ($document_srl) {
         $oAttendance = $oAttendanceModel->getGreetingsData("#" . $document_srl);
         $selected_date = substr($oAttendance->regdate, 0, 8);
     }
     if (!$selected_date) {
         $selected_date = zDate(date('YmdHis'), "Ymd");
     }
     $module_info->start_num = $oAttendanceModel->getPositionData($selected_date, "^showall^");
     if (!$module_info->greetings_cut_size) {
         $module_info->greetings_cut_size = 20;
     }
     //module의 설정값 가져오기
     $oModuleModel = getModel('module');
     $config = $oModuleModel->getModuleConfig('attendance');
     //출석가능 시간대인지 판단
     $is_available = $oAttendanceModel->availableCheck($config);
     //오름차순, 내림차순에 따라 출력방법 결정
     if ($module_info->order_type == 'desc') {
         $oAttendance = $oAttendanceModel->getInverseList($module_info->list_count, $selected_date);
     } else {
         $oAttendance = $oAttendanceModel->getAttendanceList($module_info->list_count, $selected_date);
     }
     $logged_info = Context::get('logged_info');
     $args = new stdClass();
     $args->member_srl = $logged_info->member_srl;
     $args->present_y = 'Y';
     $args->today = $selected_date;
     $outputs = executeQuery('attendance.getTodayMyGiftList', $args);
     debugPrint($outputs);
     //출석달력 설정
     $date_info = new stdClass();
     $date_info->_year = substr($selected_date, 0, 4);
     $date_info->_month = substr($selected_date, 4, 2);
     $date_info->_day = substr($selected_date, 6, 2);
     $date_info->day_max = date("t", mktime(0, 0, 0, $date_info->_month, 1, $date_info->_year));
     $date_info->week_start = date("w", mktime(0, 0, 0, $date_info->_month, 1, $date_info->_year));
     Context::set('admin_date_info', $date_info);
     //변수 내보내기
     Context::set('todaymygift', $outputs->data);
     Context::set('selected_date', $selected_date);
     Context::set('is_available', $is_available);
     Context::set('oAttendance', $oAttendance);
     Context::set('oDocumentModel', $oDocumentModel);
     Context::set('oAttendanceAdminModel', $oAttendanceAdminModel);
     Context::set('oAttendanceModel', $oAttendanceModel);
     Context::set('oMemberModel', $oMemberModel);
     Context::set('module_info', $module_info);
     Context::set('config', $config);
     $this->setTemplateFile('index');
 }
 /**
  * @brief get proc modules
  */
 function getProcModules()
 {
     // 상품타입 정보 가져오기
     $module_list = array();
     $output = ModuleHandler::triggerCall('nproduct.getProcModules', 'before', $module_list);
     if (!$output->toBool()) {
         debugPrint($output);
     }
     return $module_list;
 }
 function procSocialxeserverDeleteCheckedClient()
 {
     if (!$this->grant->register) {
         return $this->stop('msg_not_permitted');
     }
     // 선택된 글이 없으면 오류 표시
     $cart = Context::get('cart');
     if (!$cart) {
         return $this->stop('msg_invalid_request');
     }
     $client_srl_list = explode('|@|', $cart);
     $client_count = count($client_srl_list);
     if (!$client_count) {
         return $this->stop('msg_invalid_request');
     }
     // 선택된 클라이언트가 본인의 클라이언트인지 한번 더 확인
     $logged_info = Context::get('logged_info');
     $args->client_srls = $client_srl_list;
     $output = executeQueryArray('socialxeserver.getClients', $args);
     debugPrint($output);
     foreach ($output->data as $client) {
         if ($client->member_srl != $logged_info->member_srl) {
             return $this->stop('msg_not_permitted');
         }
     }
     $args->client_srls = implode(',', $client_srl_list);
     return executeQuery('socialxeserver.deleteClient', $args);
 }
 function deleteNproductFile($file_srl, $item_srl)
 {
     debugPrint('okok-1');
     $oFileController =& getController('file');
     $oFileController->deleteFile($file_srl);
     $args->file_srl = null;
     $args->item_srl = $item_srl;
     $output = executeQuery('nproduct.updateItemFile', $args);
     if (!$output->toBool()) {
         return $output;
     }
     return;
 }
Exemple #26
0
/**
 * Change error_handing to debugPrint on php5 higher 
 *
 * @param int $errno
 * @param string $errstr
 * @param string $file
 * @param int $line
 * @return void
 */
function handleError($errno, $errstr, $file, $line)
{
    if (!__DEBUG__) {
        return;
    }
    $errors = array(E_USER_ERROR, E_ERROR, E_PARSE);
    if (!in_array($errno, $errors)) {
        return;
    }
    $output = sprintf("Fatal error : %s - %d", $file, $line);
    $output .= sprintf("%d - %s", $errno, $errstr);
    debugPrint($output);
}
 /**
  * excute the member method specified by $act variable
  * @return boolean true : success false : fail
  * */
 function proc()
 {
     // pass if stop_proc is true
     if ($this->stop_proc) {
         debugPrint($this->message, 'ERROR');
         return FALSE;
     }
     // trigger call
     $triggerOutput = ModuleHandler::triggerCall('moduleObject.proc', 'before', $this);
     if (!$triggerOutput->toBool()) {
         $this->setError($triggerOutput->getError());
         $this->setMessage($triggerOutput->getMessage());
         return FALSE;
     }
     // execute an addon(call called_position as before_module_proc)
     $called_position = 'before_module_proc';
     $oAddonController = getController('addon');
     $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
     if (FileHandler::exists($addon_file)) {
         include $addon_file;
     }
     if (isset($this->xml_info->action->{$this->act}) && method_exists($this, $this->act)) {
         // Check permissions
         if ($this->module_srl && !$this->grant->access) {
             $this->stop("msg_not_permitted_act");
             return FALSE;
         }
         // integrate skin information of the module(change to sync skin info with the target module only by seperating its table)
         $is_default_skin = !Mobile::isFromMobilePhone() && $this->module_info->is_skin_fix == 'N' || Mobile::isFromMobilePhone() && $this->module_info->is_mskin_fix == 'N';
         $usedSkinModule = !($this->module == 'page' && ($this->module_info->page_type == 'OUTSIDE' || $this->module_info->page_type == 'WIDGET'));
         if ($usedSkinModule && $is_default_skin && $this->module != 'admin' && strpos($this->act, 'Admin') === false && $this->module == $this->module_info->module) {
             $dir = Mobile::isFromMobilePhone() ? 'm.skins' : 'skins';
             $valueName = Mobile::isFromMobilePhone() ? 'mskin' : 'skin';
             $oModuleModel = getModel('module');
             $skinType = Mobile::isFromMobilePhone() ? 'M' : 'P';
             $skinName = $oModuleModel->getModuleDefaultSkin($this->module, $skinType);
             if ($this->module == 'page') {
                 $this->module_info->{$valueName} = $skinName;
             } else {
                 $isTemplatPath = strpos($this->getTemplatePath(), '/tpl/') !== FALSE;
                 if (!$isTemplatPath) {
                     $this->setTemplatePath(sprintf('%s%s/%s/', $this->module_path, $dir, $skinName));
                 }
             }
         }
         $oModuleModel = getModel('module');
         $oModuleModel->syncSkinInfoToModuleInfo($this->module_info);
         Context::set('module_info', $this->module_info);
         // Run
         $output = $this->{$this->act}();
     } else {
         return FALSE;
     }
     // trigger call
     $triggerOutput = ModuleHandler::triggerCall('moduleObject.proc', 'after', $this);
     if (!$triggerOutput->toBool()) {
         $this->setError($triggerOutput->getError());
         $this->setMessage($triggerOutput->getMessage());
         return FALSE;
     }
     // execute an addon(call called_position as after_module_proc)
     $called_position = 'after_module_proc';
     $oAddonController = getController('addon');
     $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
     if (FileHandler::exists($addon_file)) {
         include $addon_file;
     }
     if (is_a($output, 'Object') || is_subclass_of($output, 'Object')) {
         $this->setError($output->getError());
         $this->setMessage($output->getMessage());
         if (!$output->toBool()) {
             return FALSE;
         }
     }
     // execute api methos of the module if view action is and result is XMLRPC or JSON
     if ($this->module_info->module_type == 'view') {
         if (Context::getResponseMethod() == 'XMLRPC' || Context::getResponseMethod() == 'JSON') {
             $oAPI = getAPI($this->module_info->module, 'api');
             if (method_exists($oAPI, $this->act)) {
                 $oAPI->{$this->act}($this);
             }
         }
     }
     return TRUE;
 }
 /**
  * get a module instance and execute an action
  * @return ModuleObject executed module instance
  * */
 function procModule()
 {
     $oModuleModel = getModel('module');
     $display_mode = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
     // If error occurred while preparation, return a message instance
     if ($this->error) {
         $this->_setInputErrorToContext();
         $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
         $oMessageObject->setError(-1);
         $oMessageObject->setMessage($this->error);
         $oMessageObject->dispMessage();
         if ($this->httpStatusCode) {
             $oMessageObject->setHttpStatusCode($this->httpStatusCode);
         }
         return $oMessageObject;
     }
     // Get action information with conf/module.xml
     $xml_info = $oModuleModel->getModuleActionXml($this->module);
     // If not installed yet, modify act
     if ($this->module == "install") {
         if (!$this->act || !$xml_info->action->{$this->act}) {
             $this->act = $xml_info->default_index_act;
         }
     }
     // if act exists, find type of the action, if not use default index act
     if (!$this->act) {
         $this->act = $xml_info->default_index_act;
     }
     // still no act means error
     if (!$this->act) {
         $this->error = 'msg_module_is_not_exists';
         $this->httpStatusCode = '404';
         $this->_setInputErrorToContext();
         $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
         $oMessageObject->setError(-1);
         $oMessageObject->setMessage($this->error);
         $oMessageObject->dispMessage();
         if ($this->httpStatusCode) {
             $oMessageObject->setHttpStatusCode($this->httpStatusCode);
         }
         return $oMessageObject;
     }
     // get type, kind
     $type = $xml_info->action->{$this->act}->type;
     $ruleset = $xml_info->action->{$this->act}->ruleset;
     $kind = stripos($this->act, 'admin') !== FALSE ? 'admin' : '';
     if (!$kind && $this->module == 'admin') {
         $kind = 'admin';
     }
     // check REQUEST_METHOD in controller
     if ($type == 'controller') {
         $allowedMethod = $xml_info->action->{$this->act}->method;
         if (!$allowedMethod) {
             $allowedMethodList[0] = 'POST';
         } else {
             $allowedMethodList = explode('|', strtoupper($allowedMethod));
         }
         if (!in_array(strtoupper($_SERVER['REQUEST_METHOD']), $allowedMethodList)) {
             $this->error = "msg_invalid_request";
             $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
             $oMessageObject->setError(-1);
             $oMessageObject->setMessage($this->error);
             $oMessageObject->dispMessage();
             return $oMessageObject;
         }
     }
     if ($this->module_info->use_mobile != "Y") {
         Mobile::setMobile(FALSE);
     }
     $logged_info = Context::get('logged_info');
     // check CSRF for POST actions
     if (Context::getRequestMethod() === 'POST' && Context::isInstalled() && $this->act !== 'procFileUpload' && !checkCSRF()) {
         $this->error = 'msg_invalid_request';
         $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
         $oMessageObject->setError(-1);
         $oMessageObject->setMessage($this->error);
         $oMessageObject->dispMessage();
         return $oMessageObject;
     }
     // Admin ip
     if ($kind == 'admin' && $_SESSION['denied_admin'] == 'Y') {
         $this->_setInputErrorToContext();
         $this->error = "msg_not_permitted_act";
         $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
         $oMessageObject->setError(-1);
         $oMessageObject->setMessage($this->error);
         $oMessageObject->dispMessage();
         return $oMessageObject;
     }
     // if(type == view, and case for using mobilephone)
     if ($type == "view" && Mobile::isFromMobilePhone() && Context::isInstalled()) {
         $orig_type = "view";
         $type = "mobile";
         // create a module instance
         $oModule = $this->getModuleInstance($this->module, $type, $kind);
         if (!is_object($oModule) || !method_exists($oModule, $this->act)) {
             $type = $orig_type;
             Mobile::setMobile(FALSE);
             $oModule = $this->getModuleInstance($this->module, $type, $kind);
         }
     } else {
         // create a module instance
         $oModule = $this->getModuleInstance($this->module, $type, $kind);
     }
     if (!is_object($oModule)) {
         $this->_setInputErrorToContext();
         $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
         $oMessageObject->setError(-1);
         $oMessageObject->setMessage($this->error);
         $oMessageObject->dispMessage();
         if ($this->httpStatusCode) {
             $oMessageObject->setHttpStatusCode($this->httpStatusCode);
         }
         return $oMessageObject;
     }
     // If there is no such action in the module object
     if (!isset($xml_info->action->{$this->act}) || !method_exists($oModule, $this->act)) {
         if (!Context::isInstalled()) {
             $this->_setInputErrorToContext();
             $this->error = 'msg_invalid_request';
             $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
             $oMessageObject->setError(-1);
             $oMessageObject->setMessage($this->error);
             $oMessageObject->dispMessage();
             if ($this->httpStatusCode) {
                 $oMessageObject->setHttpStatusCode($this->httpStatusCode);
             }
             return $oMessageObject;
         }
         $forward = NULL;
         // 1. Look for the module with action name
         if (preg_match('/^([a-z]+)([A-Z])([a-z0-9\\_]+)(.*)$/', $this->act, $matches)) {
             $module = strtolower($matches[2] . $matches[3]);
             $xml_info = $oModuleModel->getModuleActionXml($module);
             if ($xml_info->action->{$this->act} && (stripos($this->act, 'admin') !== FALSE || $xml_info->action->{$this->act}->standalone != 'false')) {
                 $forward = new stdClass();
                 $forward->module = $module;
                 $forward->type = $xml_info->action->{$this->act}->type;
                 $forward->ruleset = $xml_info->action->{$this->act}->ruleset;
                 $forward->act = $this->act;
             } else {
                 $this->error = 'msg_invalid_request';
                 $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
                 $oMessageObject->setError(-1);
                 $oMessageObject->setMessage($this->error);
                 $oMessageObject->dispMessage();
                 return $oMessageObject;
             }
         }
         if (!$forward) {
             $forward = $oModuleModel->getActionForward($this->act);
         }
         if ($forward->module && $forward->type && $forward->act && $forward->act == $this->act) {
             $kind = stripos($forward->act, 'admin') !== FALSE ? 'admin' : '';
             $type = $forward->type;
             $ruleset = $forward->ruleset;
             $tpl_path = $oModule->getTemplatePath();
             $orig_module = $oModule;
             $xml_info = $oModuleModel->getModuleActionXml($forward->module);
             // SECISSUE also check foward act method
             // check REQUEST_METHOD in controller
             if ($type == 'controller') {
                 $allowedMethod = $xml_info->action->{$forward->act}->method;
                 if (!$allowedMethod) {
                     $allowedMethodList[0] = 'POST';
                 } else {
                     $allowedMethodList = explode('|', strtoupper($allowedMethod));
                 }
                 if (!in_array(strtoupper($_SERVER['REQUEST_METHOD']), $allowedMethodList)) {
                     $this->error = "msg_invalid_request";
                     $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
                     $oMessageObject->setError(-1);
                     $oMessageObject->setMessage($this->error);
                     $oMessageObject->dispMessage();
                     return $oMessageObject;
                 }
             }
             if ($type == "view" && Mobile::isFromMobilePhone()) {
                 $orig_type = "view";
                 $type = "mobile";
                 // create a module instance
                 $oModule = $this->getModuleInstance($forward->module, $type, $kind);
                 if (!is_object($oModule) || !method_exists($oModule, $this->act)) {
                     $type = $orig_type;
                     Mobile::setMobile(FALSE);
                     $oModule = $this->getModuleInstance($forward->module, $type, $kind);
                 }
             } else {
                 $oModule = $this->getModuleInstance($forward->module, $type, $kind);
             }
             if (!is_object($oModule)) {
                 $this->_setInputErrorToContext();
                 $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
                 $oMessageObject->setError(-1);
                 $oMessageObject->setMessage('msg_module_is_not_exists');
                 $oMessageObject->dispMessage();
                 if ($this->httpStatusCode) {
                     $oMessageObject->setHttpStatusCode($this->httpStatusCode);
                 }
                 return $oMessageObject;
             }
             if ($this->module == "admin" && $type == "view") {
                 if ($logged_info->is_admin == 'Y') {
                     if ($this->act != 'dispLayoutAdminLayoutModify') {
                         $oAdminView = getAdminView('admin');
                         $oAdminView->makeGnbUrl($forward->module);
                         $oModule->setLayoutPath("./modules/admin/tpl");
                         $oModule->setLayoutFile("layout.html");
                     }
                 } else {
                     $this->_setInputErrorToContext();
                     $this->error = 'msg_is_not_administrator';
                     $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
                     $oMessageObject->setError(-1);
                     $oMessageObject->setMessage($this->error);
                     $oMessageObject->dispMessage();
                     return $oMessageObject;
                 }
             }
             if ($kind == 'admin') {
                 $grant = $oModuleModel->getGrant($this->module_info, $logged_info);
                 if (!$grant->manager) {
                     $this->_setInputErrorToContext();
                     $this->error = 'msg_is_not_manager';
                     $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
                     $oMessageObject->setError(-1);
                     $oMessageObject->setMessage($this->error);
                     $oMessageObject->dispMessage();
                     return $oMessageObject;
                 } else {
                     if (!$grant->is_admin && $this->module != $this->orig_module->module && $xml_info->permission->{$this->act} != 'manager') {
                         $this->_setInputErrorToContext();
                         $this->error = 'msg_is_not_administrator';
                         $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
                         $oMessageObject->setError(-1);
                         $oMessageObject->setMessage($this->error);
                         $oMessageObject->dispMessage();
                         return $oMessageObject;
                     }
                 }
             }
         } else {
             if ($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act)) {
                 $this->act = $xml_info->default_index_act;
             } else {
                 $this->error = 'msg_invalid_request';
                 $oModule->setError(-1);
                 $oModule->setMessage($this->error);
                 return $oModule;
             }
         }
     }
     // ruleset check...
     if (!empty($ruleset)) {
         $rulesetModule = $forward->module ? $forward->module : $this->module;
         $rulesetFile = $oModuleModel->getValidatorFilePath($rulesetModule, $ruleset, $this->mid);
         if (!empty($rulesetFile)) {
             if ($_SESSION['XE_VALIDATOR_ERROR_LANG']) {
                 $errorLang = $_SESSION['XE_VALIDATOR_ERROR_LANG'];
                 foreach ($errorLang as $key => $val) {
                     Context::setLang($key, $val);
                 }
                 unset($_SESSION['XE_VALIDATOR_ERROR_LANG']);
             }
             $Validator = new Validator($rulesetFile);
             $result = $Validator->validate();
             if (!$result) {
                 $lastError = $Validator->getLastError();
                 $returnUrl = Context::get('error_return_url');
                 $errorMsg = $lastError['msg'] ? $lastError['msg'] : 'validation error';
                 //for xml response
                 $oModule->setError(-1);
                 $oModule->setMessage($errorMsg);
                 //for html redirect
                 $this->error = $errorMsg;
                 $_SESSION['XE_VALIDATOR_ERROR'] = -1;
                 $_SESSION['XE_VALIDATOR_MESSAGE'] = $this->error;
                 $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
                 $_SESSION['XE_VALIDATOR_RETURN_URL'] = $returnUrl;
                 $_SESSION['XE_VALIDATOR_ID'] = Context::get('xe_validator_id');
                 $this->_setInputValueToSession();
                 return $oModule;
             }
         }
     }
     $oModule->setAct($this->act);
     $this->module_info->module_type = $type;
     $oModule->setModuleInfo($this->module_info, $xml_info);
     $skipAct = array('dispEditorConfigPreview' => 1, 'dispLayoutPreviewWithModule' => 1);
     $db_use_mobile = Mobile::isMobileEnabled();
     if ($type == "view" && $this->module_info->use_mobile == "Y" && Mobile::isMobileCheckByAgent() && !isset($skipAct[Context::get('act')]) && $db_use_mobile === true) {
         global $lang;
         $header = '<style>div.xe_mobile{opacity:0.7;margin:1em 0;padding:.5em;background:#333;border:1px solid #666;border-left:0;border-right:0}p.xe_mobile{text-align:center;margin:1em 0}a.xe_mobile{color:#ff0;font-weight:bold;font-size:24px}@media only screen and (min-width:500px){a.xe_mobile{font-size:15px}}</style>';
         $footer = '<div class="xe_mobile"><p class="xe_mobile"><a class="xe_mobile" href="' . getUrl('m', '1') . '">' . $lang->msg_pc_to_mobile . '</a></p></div>';
         Context::addHtmlHeader($header);
         Context::addHtmlFooter($footer);
     }
     if ($type == "view" && $kind != 'admin') {
         $module_config = $oModuleModel->getModuleConfig('module');
         if ($module_config->htmlFooter) {
             Context::addHtmlFooter($module_config->htmlFooter);
         }
         if ($module_config->siteTitle) {
             $siteTitle = Context::getBrowserTitle();
             if (!$siteTitle) {
                 Context::setBrowserTitle($module_config->siteTitle);
             }
         }
     }
     // if failed message exists in session, set context
     $this->_setInputErrorToContext();
     $procResult = $oModule->proc();
     $methodList = array('XMLRPC' => 1, 'JSON' => 1, 'JS_CALLBACK' => 1);
     if (!$oModule->stop_proc && !isset($methodList[Context::getRequestMethod()])) {
         $error = $oModule->getError();
         $message = $oModule->getMessage();
         $messageType = $oModule->getMessageType();
         $redirectUrl = $oModule->getRedirectUrl();
         if ($messageType == 'error') {
             debugPrint($message, 'ERROR');
         }
         if (!$procResult) {
             $this->error = $message;
             if (!$redirectUrl && Context::get('error_return_url')) {
                 $redirectUrl = Context::get('error_return_url');
             }
             $this->_setInputValueToSession();
         } else {
         }
         $_SESSION['XE_VALIDATOR_ERROR'] = $error;
         $_SESSION['XE_VALIDATOR_ID'] = Context::get('xe_validator_id');
         if ($message != 'success') {
             $_SESSION['XE_VALIDATOR_MESSAGE'] = $message;
         }
         $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = $messageType;
         if (Context::get('xeVirtualRequestMethod') != 'xml') {
             $_SESSION['XE_VALIDATOR_RETURN_URL'] = $redirectUrl;
         }
     }
     unset($logged_info);
     return $oModule;
 }
Exemple #29
0
 /**
  * Handle an error.
  *
  * @param       int             $errorStatus    Error status code
  * @param       string          $errorMsg       Error message
  * @param       string          $errorFile      Error script file
  * @param       int             $errorLine      Error script line
  * @throws      ApiException                    API exception
  */
 public static function handle($errorStatus, $errorMsg, $errorFile, $errorLine)
 {
     // Build the complete error message
     $mailMsg = '<b>--- Spotzi ErrorHandler ---</b>' . PHP_EOL . PHP_EOL;
     $mailMsg .= 'Date: ' . Date::format() . PHP_EOL;
     $mailMsg .= 'Error status: ' . $errorStatus . PHP_EOL;
     $mailMsg .= 'Error message: ' . $errorMsg . PHP_EOL;
     $mailMsg .= 'Script name: ' . $errorFile . PHP_EOL;
     $mailMsg .= 'Line number: ' . $errorLine . PHP_EOL;
     //$mailMsg .= 'Request referer: ' . REQUEST_REFERER . PHP_EOL;
     //$mailMsg .= 'Request URL: ' . URL_BASE . ltrim(REQUEST_URI, '/') . PHP_EOL;
     if (isset($_SERVER['HTTP_USER_AGENT'])) {
         $mailMsg .= 'User agent: ' . $_SERVER['HTTP_USER_AGENT'];
     }
     // Determine whether debug mode is active
     if (debugMode()) {
         // In case debug mode is active, set the error message as the frontend message
         debugPrint($mailMsg);
     } else {
         // Send the error email when needed
         if (HttpStatus::emailStatus($errorStatus)) {
             // Prepare the error mailer
             Mail::addMailer(EMAIL_HOST, EMAIL_PORT, EMAIL_ERROR_FROM, EMAIL_ERROR_FROM_PASSWORD, BRAND_PRODUCT);
             // Send the error email
             Mail::send(EMAIL_ERROR_RECIPIENT, EMAIL_ERROR_FROM, EMAIL_ERROR_SUBJECT, nl2br($mailMsg));
         }
         throw new ApiException($errorStatus, $errorMsg);
     }
 }
Exemple #30
0
 function send()
 {
     // 응답 형식은 JSON로
     Context::setRequestMethod('JSON');
     //debug :@kakikaki
     debugPrint('send 진입');
     //debug end
     // 클라이언트 버전이 0.9.1보다 낮으면 우선 요청 데이터 처리를 호출해준다.
     if ($this->client_ver < '0.9.1') {
         $name_list = array('comment', 'master_provider', 'logged_provider_list', 'reply_provider_list', 'client', 'uselang', 'twitter', 'me2day', 'facebook', 'yozm');
         $this->getRequestData($name_list);
     }
     if ($this->client_ver < '0.9.1') {
         $comment = unserialize(urldecode($this->request_data['comment']));
         // 댓글 정보
         $master_provider = $this->request_data['master_provider'];
         // 대표 계정
         $logged_provider_list = unserialize($this->request_data['logged_provider_list']);
         // 로그인한 서비스 목록
         $reply_provider_list = unserialize($this->request_data['reply_provider_list']);
         // 리플 서비스 목록
         $client_token = $this->request_data['client'];
         // 클라이언트 키
         $uselang = $this->request_data['uselang'];
         // 언어
     } else {
         $comment = $this->request_data['comment'];
         // 댓글 정보
         $master_provider = $this->request_data['master_provider'];
         // 대표 계정
         $logged_provider_list = $this->request_data['logged_provider_list'];
         // 로그인한 서비스 목록
         $reply_provider_list = $this->request_data['reply_provider_list'];
         // 리플 서비스 목록
         $client_token = $this->request_data['client'];
         // 클라이언트 키
         $uselang = $this->request_data['uselang'];
         // 언어
     }
     // 원본 주소를 저장해 둔다.
     $content_link = $comment->content_link;
     // 소셜 서비스 액세스 정보 준비
     foreach ($logged_provider_list as $provider) {
         if ($this->client_ver < '0.9.1') {
             $access[$provider] = unserialize($this->request_data[$provider]);
         } else {
             $access[$provider] = $this->request_data[$provider];
         }
     }
     // 해당 클라이언트의 사용 도메인인지 확인
     $referer_info = parse_url($comment->content_link);
     $referer_domain = str_replace('www.', '', $referer_info['host']);
     $output = $this->_checkClientDomain($request_info->client_srl, $referer_domain);
     //debug :@kakikaki
     debugPrint('$output 검증 : $output->toBool() : ' . $output->toBool());
     //debug end
     if (!$output->toBool()) {
         return $output;
     }
     // 태그 준비
     if (!$comment->hashtag) {
         $comment->hashtag = 'socialxe';
     }
     // 로그인한 서비스에 댓글을 전송한다.
     unset($output);
     $send_result = array();
     $reply = false;
     // 링크 주소
     if ($comment->short_link) {
         $comment->content_link = $comment->short_link;
     } else {
         $bitly = new bitly_SocialXE($this->config->bitly_username, $this->config->bitly_api_key);
         $comment->content_link = $bitly->shorten(urlencode($this->_getCommentUrl($content_link, $comment->parent->comment_srl)));
     }
     // 댓글이면 모두 등록
     if (!$comment->parent) {
         foreach ($logged_provider_list as $provider) {
             $output = $this->providerManager->send($provider, $comment, $access[$provider], $uselang);
             $send_result[$provider] = $output->get('result');
         }
     } else {
         if (in_array($comment->parent->provider, $logged_provider_list)) {
             // 근데 페이스북은 제외
             if ($comment->parent->provider != 'facebook') {
                 $output = $this->providerManager->send($comment->parent->provider, $comment, $access[$comment->parent->provider], $uselang);
                 $send_result[$comment->parent->provider] = $output->get('result');
                 $reply = true;
             }
         }
     }
     // 대댓글인데 리플 처리가 안 됐으면 소셜XE 계정을 이용하여 리플을 보낸다.
     if ($comment->parent && !$reply) {
         $output = $this->providerManager->send($comment->parent->provider, $comment, $this->access[$comment->parent->provider], $uselang, true);
         $send_result[$comment->parent->provider] = $output->get('result');
     }
     // 리플 리스트 중 보내지 않은 서비스가 있으면 보낸다.
     if (!is_array($send_result)) {
         $send_result = array();
     }
     $sended_provider_list = array_keys($send_result);
     foreach ($reply_provider_list as $provider) {
         if (in_array($provider, $sended_provider_list)) {
             continue;
         }
         // 먼저 사용자의 계정으로 등록을 시도
         if (in_array($provider, $logged_provider_list)) {
             $output = $this->providerManager->send($provider, $comment, $access[$provider], $uselang);
             $send_result[$comment->parent->provider] = $output->get('result');
         } else {
             $output = $this->providerManager->send($provider, $comment, $this->access[$provider], $uselang, true);
             $send_result[$comment->parent->provider] = $output->get('result');
         }
     }
     $result = new Object();
     $result->add('result', $send_result);
     return $result;
 }