function getOrderInfo($order_srl)
 {
     $config = $this->getModuleConfig();
     // order info.
     $args->order_srl = $order_srl;
     $output = executeQuery('nstore_digital.getOrderInfo', $args);
     $order_info = $output->data;
     // ordered items
     $args->order_srl = $order_srl;
     $output = executeQueryArray('nstore_digital.getPurchasedItems', $args);
     $item_list = $output->data;
     if (!is_array($item_list)) {
         $item_list = array($item_list);
     }
     foreach ($item_list as $key => $val) {
         $item = new nproductItem($val, $config->currency, $config->as_sign, $config->decimals);
         debugprint($item);
         if ($item->option_srl) {
             $item->price += $item->option_price;
         }
         $item_list[$key] = $item;
     }
     $order_info->item_list = $item_list;
     return $order_info;
 }
Beispiel #2
0
/**
 * Helper method for getting an APIContext for all calls
 *
 * @return PayPal\Rest\ApiContext
 */
function getApiContext()
{
    // ### Api context
    // Use an ApiContext object to authenticate
    // API calls. The clientId and clientSecret for the
    // OAuthTokenCredential class can be retrieved from
    // developer.paypal.com
    $oModuleModel =& getModel('module');
    $oPaypalModuleConfig = $oModuleModel->getModuleConfig('paypal');
    debugprint($oPaypalModuleConfig);
    $apiContext = new ApiContext(new OAuthTokenCredential($oPaypalModuleConfig->client_id, $oPaypalModuleConfig->api_secret));
    $apiContext->setConfig(array('mode' => $oPaypalModuleConfig->endpoint, 'http.ConnectionTimeOut' => 30, 'log.LogEnabled' => true, 'log.FileName' => '../PayPal.log', 'log.LogLevel' => 'FINE'));
    /*
    // Register the sdk_config.ini file in current directory
    // as the configuration source.
    if(!defined("PP_CONFIG_PATH")) {
    	define("PP_CONFIG_PATH", __DIR__);
    }
    */
    return $apiContext;
}
/**
 * Returns the row object after calling mysql_fetch_object
 * Support debug hooks.
 * @subpackage Database Helper
 * @param result resource $rl
 * @param integer $line Caller line number
 * @param string $file  caller file name
 * @return object
 */
function dofetch($rl, $line = "(noline)", $file = "(nofile)")
{
    global $debugprinting;
    $rs = mysql_fetch_object($rl);
    if ($debugprinting && function_exists("debugprint")) {
        debugprint("<!-- FETCH DUMP ({$file}:{$line})\n" . var_export($rs, true) . "\n-->");
    }
    return $rs;
}
function checkForMoviefolder($folder)
{
    global $tmpfile;
    $returnfile = "";
    $folder2 = quotemeta($folder);
    $folder2 = str_replace(" ", "\\ ", $folder2);
    $result = exec('du -ash ' . $folder2 . '/' . basename($folder2) . '.* > ' . $tmpfile);
    //debugprint("result", 'du -ash '.$folder2.'/'.basename($folder2).'* > '.$tmpfile );
    $movies = file($tmpfile);
    if (0 < count($movies)) {
        foreach ($movies as $moviefile) {
            $moviefile = trim($moviefile);
            debugprint("Moviefolder", $moviefile);
            if (extensionAllowed(basename($moviefile))) {
                list($size, $file) = explode("\t", $moviefile);
                $file = trim($file);
                $returnfile = array();
                $returnfile['file'] = $file;
                $returnfile['size'] = $size;
                $returnfile['ext'] = "dummy";
                break;
            }
        }
    }
    return $returnfile;
}
 /**
  *  @POST send method
  *	@param $options (options must contain api_key, salt, signature, to, from, text)
  *	@type, image, refname, country, datetime, mid, gid, subject, charset (optional)
  *	@returns an object(recipient_number, group_id, message_id, result_code, result_message)
  */
 public function send($options)
 {
     $this->setMethod('send', 1);
     $this->addInfos($options);
     debugprint($this->getResult());
     return $this->getResult();
 }
 /**
  * @brief  get cmpuser adminlist
  */
 function getCympuserAdminItemList()
 {
     $oNproductModel =& getModel('nproduct');
     $member_srl = Context::get('member_srl');
     $target = Context::get('target');
     if (!$target) {
         $target = 'nstore';
     }
     $args->proc_module = $target;
     $output = executeQueryArray('cympuser.getItemList', $args);
     if (!$output->toBool()) {
         return $output;
     }
     $item_list = $output->data;
     $retobj = $oNproductModel->discountItems($item_list);
     debugprint($item_list);
     $list_config = $oNproductModel->getListConfig(null);
     Context::set('list', $item_list);
     Context::set('target', $target);
     Context::set('member_srl', $member_srl);
     $path = $this->module_path . "tpl/" . $module_info->skin;
     $file_name = "addOrderForm.html";
     $oTemplate =& TemplateHandler::getInstance();
     $data = $oTemplate->compile($path, $file_name);
     $this->add('tpl', $data);
 }
 function dispCympuserAdminGuidanceInfo()
 {
     $member_srl = Context::get('member_srl');
     $input = new stdClass();
     $input->member_srl = $member_srl;
     $output = ModuleHandler::triggerCall('cympuser.getGuidanceInfo', 'before', $input);
     if (!$output->toBool()) {
         return $output;
     }
     debugprint($input);
     if ($input->infos['profile']->guidance_info) {
         $guidance = $input->infos['profile']->guidance_info;
         Context::set('guidance', $guidance);
     }
     $this->setTemplateFile('guidance_info');
 }
Beispiel #8
0
debuglog("Handling Last.FM Proxy Request", "LAST.FM");
$post_url = "http://ws.audioscrobbler.com/2.0/";
$lastfm_secret = "3ddf4cb9937e015ca4f30296a918a2b0";
$postified = '';
$sigstring = '';
$vars = $_POST;
ksort($vars);
foreach ($vars as $key => $value) {
    if ($key != 'api_key' && $key != 'sk') {
        debuglog($key . " = " . $value, "LAST.FM");
    }
    if (!is_utf8($key)) {
        debugprint("ERROR! Key " . $key . " is not UTF-8", "LASTFM", 3);
    }
    if (!is_utf8($value)) {
        debugprint("ERROR! Value " . $value . " is not UTF-8", "LASTFM", 3);
    }
    $postified .= $key . '=' . $value . '&';
    $sigstring .= $key . $value;
}
$postified .= "api_sig=" . md5($sigstring . $lastfm_secret);
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $post_url);
curl_setopt($ch, CURLOPT_POST, count($vars) + 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postified);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'RompR Music Player/0.70');
# ignore SSL errors
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 /**
  * Get a member list
  * 
  * @return object|array (object : when member count is 1, array : when member count is more than 1)
  */
 function getCympuserMemberList()
 {
     debugprint("ASDF");
     // Search option
     $args = new stdClass();
     $args->is_admin = Context::get('is_admin') == 'Y' ? 'Y' : '';
     $args->is_denied = Context::get('is_denied') == 'Y' ? 'Y' : '';
     $args->selected_group_srl = Context::get('selected_group_srl');
     $filter = Context::get('filter_type');
     switch ($filter) {
         case 'super_admin':
             $args->is_admin = 'Y';
             break;
         case 'site_admin':
             $args->member_srls = $this->getSiteAdminMemberSrls();
             break;
         case 'enable':
             $args->is_denied = 'N';
             break;
         case 'disable':
             $args->is_denied = 'Y';
             break;
     }
     $search_target = trim(Context::get('search_target'));
     $search_keyword = trim(Context::get('search_keyword'));
     if ($search_target && $search_keyword) {
         switch ($search_target) {
             case 'user_id':
                 if ($search_keyword) {
                     $search_keyword = str_replace(' ', '%', $search_keyword);
                 }
                 $args->s_user_id = $search_keyword;
                 break;
             case 'user_name':
                 if ($search_keyword) {
                     $search_keyword = str_replace(' ', '%', $search_keyword);
                 }
                 $args->s_user_name = $search_keyword;
                 break;
             case 'nick_name':
                 if ($search_keyword) {
                     $search_keyword = str_replace(' ', '%', $search_keyword);
                 }
                 $args->s_nick_name = $search_keyword;
                 $args->html_nick_name = htmlspecialchars($search_keyword, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
                 break;
             case 'email_address':
                 if ($search_keyword) {
                     $search_keyword = str_replace(' ', '%', $search_keyword);
                 }
                 $args->s_email_address = $search_keyword;
                 break;
             case 'regdate':
                 $args->s_regdate = preg_replace("/[^0-9]/", "", $search_keyword);
                 break;
             case 'regdate_more':
                 $args->s_regdate_more = substr(preg_replace("/[^0-9]/", "", $search_keyword) . '00000000000000', 0, 14);
                 break;
             case 'regdate_less':
                 $args->s_regdate_less = substr(preg_replace("/[^0-9]/", "", $search_keyword) . '00000000000000', 0, 14);
                 break;
             case 'last_login':
                 $args->s_last_login = preg_replace("/[^0-9]/", "", $search_keyword);
                 //$args->s_last_login = $search_keyword;
                 break;
             case 'last_login_more':
                 $args->s_last_login_more = substr(preg_replace("/[^0-9]/", "", $search_keyword) . '00000000000000', 0, 14);
                 break;
             case 'last_login_less':
                 $args->s_last_login_less = substr(preg_replace("/[^0-9]/", "", $search_keyword) . '00000000000000', 0, 14);
                 break;
             case 'birthday':
                 $args->s_birthday = preg_replace("/[^0-9]/", "", $search_keyword);
                 break;
             case 'extra_vars':
                 $args->s_extra_vars = $search_keyword;
                 break;
         }
     }
     // Change the query id if selected_group_srl exists (for table join)
     $sort_order = Context::get('sort_order');
     $sort_index = Context::get('sort_index');
     if (!$sort_index) {
         $sort_index = "list_order";
     }
     if (!$sort_order) {
         $sort_order = 'asc';
     }
     if ($sort_order != 'asc') {
         $sort_order = 'desc';
     }
     if ($args->selected_group_srl) {
         $query_id = 'member.getMemberListWithinGroup';
         $args->sort_index = "member." . $sort_index;
     } else {
         $query_id = 'member.getMemberList';
         $args->sort_index = $sort_index;
     }
     $args->sort_order = $sort_order;
     Context::set('sort_order', $sort_order);
     // Other variables
     $args->page = Context::get('page');
     $args->list_count = 20;
     $args->page_count = 10;
     debugprint($query_id);
     $output = executeQuery($query_id, $args);
     return $output;
 }
 function dispNstore_digitalAdminIndividualOrderManagement()
 {
     $oNstore_coreModel =& getModel('nstore_digital');
     $oEpayModel =& getModel('epay');
     $config = $oNstore_coreModel->getModuleConfig();
     /*
     $order_srl = Context::get('order_srl');
     
     $order_info = $oNstore_coreModel->getOrderInfo($order_srl);
     
     $payment_info = $oEpayModel->getTransactionByOrderSrl($order_srl);
     Context::set('payment_info',$payment_info);
     Context::set('order_info', $order_info);
     */
     if (!Context::get('status')) {
         Context::set('status', '1');
     }
     if (Context::get('search_key')) {
         $search_key = Context::get('search_key');
         $search_value = Context::get('search_value');
         if ($search_key == 'nick_name' && $search_value == '비회원') {
             $search_key = 'member_srl';
             $search_value = 0;
         }
         $args->{$search_key} = $search_value;
     }
     $args->order_status = Context::get('status');
     $args->page = Context::get('page');
     $output = executeQueryArray('nstore_digital.getPurchasedItemsByStatus', $args);
     if (!$output->toBool()) {
         return $output;
     }
     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);
     $order_list = $output->data;
     if (!is_array($order_list)) {
         $order_list = array();
     }
     foreach ($order_list as $k => $v) {
         if (!$v) {
             continue;
         }
         $item = new nproductItem($v, $config->currency, $config->as_sign, $config->decimals);
         debugprint($item);
         if ($item->option_srl) {
             $item->price += $item->option_price;
         }
         $v->item = $item;
         $vars->order_srl = $v->order_srl;
         $output = executeQuery('nstore_digital.getOrderInfo', $vars);
         if (!$output->toBool()) {
             return $output;
         }
         $v->order_info = $output->data;
         unset($vars);
     }
     Context::set('order_list', $order_list);
     Context::set('order_status', $this->getOrderStatus());
     Context::set('delivery_inquiry_urls', $this->delivery_inquiry_urls);
     $this->setTemplateFile('individual_ordermanagement');
 }